Cron Job getting failed in Hybris with Admin cronJob user - spring

On production, we are seeing a strange behaviour where our one cronJob is getting failed with product not found error if session user of cronJob is Admin user.
But when we changed the user to another employee user and if we try rerunning this job manually then it works.
Also with same employee user this job again getting failed if job is trying to run on trigger based time.
Can someone help me if any config I am missing here.

Related

Why is my laravel batch failing randomly with ModelNotFoundException?

I have a batch that is scheduled to run every day at 00:05.
On some days, a job in the batch fails immediately with the ModelNotFoundException.
However, the model that was not found does exist.
There were no change to any of the concerned models in the database. (Field, Category, Condition)
There is also no code in the application that allows to delete the category.
Retrying the job manually from the horizon dashboard make the job pass.
The dba said there are no error in the logs and no scheduled maintenance at that time.
What can possibly cause this?

Unable to send email from Job class

I have a functionality where I am sending emails from a Job class file. But it's always going to the faild_jobs table by logging the following ...
ErrorException: file_put_contents(/home/runcloud/webapps/apiv2/storage/framework/views/a3ec55b820a51da4c32fecf3d29285507a159c23.php): failed to open stream: Permission denied in /home/runcloud/webapps/apiv2/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:135
This is what happens when I am trying this on our staging server but in my local, it's working fine.
The same thing is happening when I am trying to Log::info() from the same job class file.
Also, for sometimes, it's also giving the following issue on the faild_jobs table ...
Illuminate\Queue\MaxAttemptsExceededException: App\Jobs\CurlSendEmail has been attempted too many times or run too long. The job may have previously timed out. in /home/runcloud/webapps/apiv2/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:648
What should I need to do to make it work?

Vbscript is working fine in cmd prompt but not working in task scheduler

I have a vbscript to get the records from Oracle database and need to get those records hourly basis.
When I ran the script from cmd , script is executing fine and getting records through email but when I schedule the same script from task scheduler , showing that task completed fine but records are not getting.
Do we need any permission to access the Oracle database from task scheduler
I have logged in the server with admin user.
Is there another way to schedule this script hourly basis.
Thanks in advance
Thanks
Chandrakiran
Without some code I cannot help you much, I suspect this is an authentication issue however.
Note that the Task Scheduler does not take into account the currently logged in user when running, the script needs to authenticate itself with the database or set the "Run As" user in Task Scheduler if needed.

Oracle job that runs a batch file

So I have in my DB a user, that I want to use to run a. bat file. The easiest way to do this, was to use an Oracle Job.
So I created my job, but when I try to run it, it gives me the following errors :
ORA-27370: job slave failed to launch a job of type EXECUTABLE
ORA-27300: OS system dependent operation:accessing job scheduler service failed with status: 2
ORA-27301: OS failure message: The system cannot find the file specified.
ORA-27302: failure occurred at: sjsec 6a
ORA-27303: additional information: The system cannot find the file specified.
Out of curiosity, I created the same job, with the exact settings with the SYS user in its schema(yes, i know that this is not recommanded...), and when I ran the job, it worked perfectly.
So I though that there are probably some permission involved so I gave my user, all the system priviledges and roles that the SYS user had, to see if this is the problem.
However, I got the same errors.. Any ideas why this works in sys schema, and not in my user's schema, although the user has all the priviledges set ?:|
You have not given any information on what exact command you're running. We'll have to guess.
From your description, I would say the behaviour is typical of "SYS is special". In the DBA guide, we can see that an external local job will behave differently if the account is SYS when no credential is provided.
So I'm guessing that you're running your job with DBMS_SCHEDULER without credential and that the default non-SYS OS account has not the same OS rights as the Oracle installer account.
Try to create a credential with DBMS_SCEDULER.CREATE_CREDENTIAL with a sufficiently-privileged OS account and assign this credential to your job.

How to run only failed sessions in a workflow

In a workflow there are sessions connected in parallel and in sequence. Suppose some sessions which are in parallel and in sequential mode are failed, How do I restart the workflow with only failed sessions. How can I design this in Informatica?
Turn 'suspend on error' for workflow
Turn 'restart on recovery' for each session in workflow
Now if any session fail workflow will be suspended until you fix the problem and hit recover on workflow in monitor. When you do so it cause to restart only failed sessions.
A large publishing client asked us to implement something similar to what you asked. We crated a database table to keep track of successful sessions within a workflow. Each session will have a mapping at the end that adds an entry to database which says I passed or failed. When we try to run in a recovery mode we query the database at the beginning of each session to find out if we need to run this session or not.
We also provided a web interface to this table where business users can manually choose which session to run or escape based on their needs.
Recovery option will work only if you have "workflow recovery" turned on in repository. If you dont, then you can check option "fail workflow if task fails" at individual session level and create condition on link that connect workflow to each other. Disadvantage of this method is that your workflow will appear failed and wont execute next sessions until failed one are fixed.
thanks.

Resources