We have published the default Export Web Map tool as GP Service and embedded the user credebtials to our secured services in it. The printing service works properly but sometimes it starts failing all the print jobs with following message in the log.
Error executing tool.: Layer "<some secured layer>": Unable to connect to map server at <map service url>. ERROR: code:403, User does not have permissions to access '<map server address>'., Access to this resource is forbidden, regardless of authorization. Failed to execute (ExportWebMap). Failed to execute (Export Web Map).
I have tried going through logs but couldn't find anything suspicious which could lead to this error. After this condition, if you restart the printing service, it starts working normally.
Does anyone have any clue about what could be going wrong. Appreciate your help.