Forums

scheduled tasks not running

I have a scheduled task that is set to run 15 mins past the hour and the latest task timestamp says 17:16 even though the server time says UTC 18:22. Why isn't there another item in the log with a timestamp around 18:15 mark?

PA staff will most likely end up being needed to help you on this, but in the mean time, please confirm that:

  1. The task you have set up is configured for "Hourly" not "Daily"
  2. The task isn't listed further down the <Schedule> page under <Currently running tasks>. If it is listed here, you can click the kill in order to set things right. If the <kill> needs to be repeated hourly, look into your code to determine why the script isn't ending as you expect.

It is definitely set to hourly and it is not showing up in the scheduled tab as a running process that needs to be killed. I have verified that running it from the shell works as expected and that it points to the right python interpreter with #!/usr/local/bin/python2.7.

Looks like you've tripped across a bug in our unicode handling. I'll investigate today.

Kudos to davidk01. Not everyone gets the honor of finding a bug...:)

Unicode. I was tripped up while writing one of my scripts as well. I had to use encode('utf-8') to work around them.

Unicode's been a pain, it's true. We have a bunch of tests to make sure it works in all kinds of circumstances, from the everyday to the truly obscure, but it looks like something slipped through the net. Glenn's still looking into this; hopefully we'll have more news tomorrow.

No worries. If there is more information I can provide let me know. At some point I caught my script running so it looks like my script runs but the log isn't updated to reflect the change so I'm no longer as concerned as I was before about the problem

It looks like the problem is that if the log contains ASCII text from a previous run and then the current run generates non-ASCII, we try to append it to the log with old_ascii + new_unicode, which fails. Ironically, if your first run generates any non-ASCII text, the problem doesn't happen...

Anyway, as you spotted -- thanks! -- it's a logging error only: the tasks continue to run. We'll get a fix into our integration system today, and if it doesn't break anything in the build farm over the weekend, we should be able to get it live on Monday.

Ok. In the meantime I will keep a lookout for runaway processes and not run the scrip that is causing problems. It looks like I had 4 stalled tasks overnight so I will disable the offending task for now.

I can't kill those stalled tasks. If somebody on your side can take a look and kill those processes I would appreciate that. If there is a way to kill them from somewhere other than the schedule tab let me know.

Hi David -- that's done.

OK, we've found a fix and it was simple enough that we decided to push it live. The problem should be gone now. Let me know if it doesn't sort it out for you!

@davidk01 If you need to kill tasks in the future check out this SO entry.

Thanks a2j. Not having some of the familiar shell commands is a little disorienting so I didn't even think of kill.

@davidk01 I'm glad to help!! I really enjoy this PA community we're building.

Indeed. PythonAnywhere has the awesomest friends!