Problem running timer under other user (v7)

Problem running timer under other user (v7)

  
When I change an eSpace with timers to "Run As" administrator, I get the following error
Any idea what goes wrong here ?
Running Community Edition v7

Scheduler Service: Error executing request http://127.0.0.1/myPracticeEmail/_TimerHandler.asmx for Timer GeneralTimer. Request duration = 0 secs. [Will retry later]
Stack: System.InvalidOperationException: Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. The request failed with the error message:


I see I'm not the only one http://www.outsystems.com/forums/discussion/6473/error-running-timer-to-send-emails/

This is what I see in IIS Log:

2013-06-24 18:39:47 127.0.0.1 POST /myPracticeEmail/_TimerHandler.asmx - 80 - 127.0.0.1 Mozilla/4.0+(compatible;+MSIE+6.0;+MS+Web+Services+Client+Protocol+2.0.50727.4223) 500 0 0 156

So it looks like a 500 error ...
  • 500 Syntax error, command unrecognized. This may include errors such as command line too long.
Doesn't ring a bell to me, anybody ???
Hi Joop,

The most likely the error means that the user doesn't have iis permissions. Can you access any page from that eSpace?

Here is a topic that explains how to configure the user permissions to be able to use Run As: http://www.outsystems.com/forums/discussion/5653/how-to-setting-up-applications-access-to-file-systems/

You should also be able to see errors with more details on event viewer or possibly by accessing
/myPracticeEmail/_TimerHandler.asmx?wsdl on your browser.

Regards,
João Rosado
João Rosado wrote:
Hi Joop,

The most likely the error means that the user doesn't have iis permissions. Can you access any page from that eSpace?

Here is a topic that explains how to configure the user permissions to be able to use Run As: http://www.outsystems.com/forums/discussion/5653/how-to-setting-up-applications-access-to-file-systems/

You should also be able to see errors with more details on event viewer or possibly by accessing
/myPracticeEmail/_TimerHandler.asmx?wsdl on your browser.

Regards,
João Rosado
 João

It's a little bit strange, it's all about the HTML2PDF extension ...
Using it from within the website itself, there is no problem at all, PDF's are created and shown/downloaded.
When using the same function from a timer, it does not work, no PDF is created, no error nothing... so I wonder if the timer is run with a different user than the IIS user which executes it.

All users (SYSTEM, NETWORK, IIS_USR, Admin Etc) have ALL rights on the Windows/TEMP directory, where HTML2PDF puts (and not deletes) his temp files

Hope somebody can shine a light on this, and make my fuzzy night clear. 
Hi,

Well, I never used the HTML2PDF myself, so the only thing I can contribute on this topic is that the Timers run with the same user/permissions as the Web Screens.
Is there anything else that can used in the call that is missing? Like a session variable (remember that timers always start with a clean session)?

Did you try using the debugger step by step to see if all runs correctly? Remember that you can debug timers when using the "Debug in public area".

Regards,
João Rosado
Hi Joop,

Just tell me if you can get some logs from IIS when you run this actions.
Try also to put the credencials again in the Run As and then publish your eSpace before running the timer.
Try to debug the timer action and check also the Service Center logs after running it.
It's strange, because I already used that application and it worked fine for me.
Good luck and give us some feedback.

Kind Regards,
Gonçalo M.

I see something in my code which might be the problem. I used GetServerName() from richwidgets to add Header and Footer to HTML2PDF
That function uses GetBookmarkableURL() that might not return the correct name. I changed it into LocalHost to see if it works.
That's certainly a problem. You should always (at least I do it) use "localhost", since your HTML2PDF instance is always executed in your server. So that should make it work.
Hi Joop

The exception "System.InvalidOperationException: Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. The request failed with the error message:" is missing the response returned by the server. That response, which should be in the error logs as well, may have more clues on the real problem that is generating the 500 Error.

Try analyzing it to confirm if this is a file system permissions error or not.

Cheers

Miguel João


That makes perfect sense. GetBookmarkableURL() in a timer is going to return junk... at *best* it will return the string to the hidden URL that runs the timer. Use GetEspaceEntryURL() instead.

J.Ja
Ok, all the stupid things I've done ... The GetBookMarkableURL() was the problem.
Chang to localhost did the trick.

The other error about the xml/html I skipped for now, must have had to do with rights for administrator (...)