Try our conversational search powered by Generative AI!

Scheduled Job Problem

Vote:
 

Hi,

First we have created scheduled locally..i am able to run it manually and automatically.Then we moved the code to integration.There i am getting Exception as "Exception has been thrown by the target of an invocation. [Sitemap Creation error at Execute() for SitemapScheduler for Sweden site]".Manul job is working fine..only when job runs automatically i am getting above error.

What access levels we have to set for scheduled job.We are using CMS5

 

#47503
Jan 31, 2011 13:40
Vote:
 

The scheduled job is by default run as an anonymous user, while it will run in your current user's context when you trigger it manually. Also your exception message seems to be a custom one so that should give you clues where in your code to look.

#47504
Jan 31, 2011 13:52
Vote:
 

Guess you have references to HttpContext.Current inside your method. That will not work... cause of reasons Magnus explained

#47513
Jan 31, 2011 14:26
Vote:
 

But then it should fail when running scheduled in the local environment as well. But with the anonymous vs permissions problem there could be a difference in access rights between the two environments.

#47514
Jan 31, 2011 14:28
Vote:
 

Aha, helps to read all the words in the orginal post,, you are right magnus

#47515
Jan 31, 2011 14:29
Vote:
 

Is the scheduled task writing to disk? You need to give IIS_IUSRS write access to the directory you're writing the sitemap too (if this is the case).

/Steve

#47524
Jan 31, 2011 16:49
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.