Developer forum

Forum » Integration » JobFailed returns true even when job doesn't

JobFailed returns true even when job doesn't

Lars Larsen
Reply

Hi,

I am using the Dynamicweb.Notifications.Integration.JobFinished notifiction to run some custom code after a job has runned (an import). The job is part of a scheduled task. When I start the scheduled task manually the property JobFailed from Dynamicweb.Notifications.Integration.JobFinishedIntegrationArgs returns true, but the job runs without errors (have checked the logs). If I run the task from "MC - Integration - Data Integration" the property JobFailed returns false as expected. What can be wrong?


Replies

 
Dmitriy Benyuk
Reply

Hi Lars,
I was not able to reproduce your problem, I need to get some more information about this issue from you.
Could you point what Dynamicweb version are you using and what are the Source and Destination providers of your data integration job?
And what type is your scheduled task: Url, AddIn? If it is Url: do you have one job or several jobs in the url query string param: "jobsToRun="?
Kind regards, Dmitrij

 
Lars Larsen
Reply

Hi Dmitriy

I am using v8.6.1.12, source provider is "XML Provider", destination provider is "Dynamicweb Provider". Scheduled task type is "AddIn". The task is importing products, productgroups etc. and users from NAV and was created using the activity template "ErpDataImport". Hope you have enough information, otherwise ask for more again :-)

 
Dmitriy Benyuk
Reply

Hi Lars,
Are you usng the "Import Data Add-In" in your scheduled task? If yes, then it contains two jobs: Users import activity and Data import activity.
The Data import activity is executed at first and before running this data integration selected job( from "Data import activity" list) - it calls the ERP service to gets data from.
After receiving the data it is imported to Dynamicweb.
At the next step the Users import activity is called: in the same way - getting users from ERP and import to Dynamicweb.
So maybe you get an error when contacting the ERP service, error at import ecom data/users, etc.

Could you also check you scheduled task logs? (Files//System/Log/ScheduledTasks)
And data integration job logs that are called from your scheduled task? (Files/System/Log/DataIntegration)
Regards, Dmitrij

 
Lars Larsen
Reply

Hi Dmitrij

Yes I'm using the "Import Data Add-In" in my scheduled task. Both products and users data are received correctly from the ERP service and imported without errors according to the logs. If I run each task manually from "MC - Integration - Data Integration" the property JobFailed returns false, as expected. I'm aware of that the ERP service is then not contacted. So maybe your'e right about that the problem occurs when the task scheduler contacts the ERP service to receive data. But how can I check that?

 
Dmitriy Benyuk
Reply

Hi Lars,
Please open your scheduled task and enable the option: "Log all requests and responses" and fill all the Notification fileds, choose "AddInNotificationTemplate" in the templates list.
After that you can run your scheduled task and check:
- email with some error notitication
- scheduled task last logs in /Files/System/Log/ScheduledTasks
- Data import activity last log in /Files/System/Log/DataIntegration/{Your data activity name}
- Users import activity last log in /Files/System/Log/DataIntegration/{Your user activity name}
Note that the information is written to several log files: to the scheduled task log and to the executed data integration activities logs.
Regards, Dmitrij

 
Lars Larsen
Reply

Hi Dmitriy

My task is already configured to send an email notification and to log all requests and responses and I know of the logs which I have checked several times. To simplify the debugging and to speed up the import I have set the "Data import activity" field on the task to "none" (this activity imports >50Mb). So now my scheduled task only runs the "User import activity". But still the JobFailed property returns true! Here are the logs and email notification:

\Files\System\Log\DataIntegration:
fr, 26 jun 2015 13:21:52: reading configuration
fr, 26 jun 2015 13:21:54: Importing data to table: AccessUser

\Files\System\Log\ScheduledTasks:
fr, 26 jun 2015 13:21:45: Starting scheduled task: Data Product & User Import from NAV
fr, 26 jun 2015 13:21:45: no Data Import activity found, no data imported
fr, 26 jun 2015 13:21:46: Request: <GetEcomData UserGroupDealer="260" UserGroupB2B="259"><tables><Users type="all"/></tables></GetEcomData>.
fr, 26 jun 2015 13:21:52: Response: <?xml version="1.0" encoding="utf-8"?><tables><table tableName="AccessUser"><item table="AccessUser"><colu......(I have removed the rest!)
fr, 26 jun 2015 13:21:58: Incuding file content: D:\Websites\Customer\src\DisPlay.DW.Nellemann.Presentation\Files\System\Log\DataIntegration\ErpUserImport20150626-1321459967153.log
fr, 26 jun 2015 13:21:52: reading configuration
fr, 26 jun 2015 13:21:54: Importing data to table: AccessUser
fr, 26 jun 2015 13:21:58: End of file content: D:\Websites\Customer\src\DisPlay.DW.Nellemann.Presentation\Files\System\Log\DataIntegration\ErpUserImport20150626-1321459967153.log
fr, 26 jun 2015 13:21:58: Scheduled task: Data Product & User Import from NAV completed successfully.

The email notification:

Hello
Scheduled task Data Product & User Import from NAV has been completed.
The add-in executed in this task is: Data Product & User Import from NAV.
Error log information:
*Scheduled_task_completed_successfully 

I can't see why the property JobFailed returns true, but it does!

 

 

 
Dmitriy Benyuk
Reply
This post has been marked as an answer

Hi Lars,
you are right, the new bug was found which is causing this issue. TFS#17714, and will be present in the next 8.6.1 hotfix
Regards, Dmitrij

Votes for this answer: 1
 
Lars Larsen
Reply

Hi Dmitriy

I'm glad that you found the bug. Looking forward to the hotfix :-)

 
Kristian Kirkholt
Reply

Hi Lars

The problem regarding #17714 "Notification isn't fired correctly when import is run using addin."

Has now been resolved in Dynamicweb version 8.6.1.13

You are able to find this build in the download section:

http://developer.dynamicweb-cms.com/downloads/dynamicweb-8.aspx

Please contact Dynamicweb Support if you need any additional help regarding this.

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 

You must be logged in to post in the forum