Google app engine cron job failed

2,405 views
Skip to first unread message

Anurag Uniyal

unread,
Jan 21, 2011, 6:53:41 AM1/21/11
to Google App Engine
I have added a cron job to google appengine e.g. /mysite/
my_summation_task which does some calcualtions but anyway doesn't
matter. In the google appengine Cron Jobs page show it as 'Failed' @
11:29 AM, though I have no clue why it is showing failed. Logs show a
request for /mysite/my_summation_task around that time and it has no
errors.

What is more mysterious is that I can ran that URL (/mysite/
my_summation_task) manually and have the desired effect.

So i wondering

What could be wrong
Where I can see what is wrong, logs doesn't have any info

Other Details: Cron URL doesn't need any authentication, cron job is
on the latest app version I have and it is the default version. i am
using python runtime.

Anurag Uniyal

unread,
Jan 22, 2011, 2:51:24 AM1/22/11
to Google App Engine
this is the cron job request in log, it shows no error

01-21 11:41PM 50.750 /xxx/resource_summation_task_start 301 4ms
0cpu_ms 0kb AppEngine-Google; (+http://code.google.com/appengine)
0.1.0.1 - - [21/Jan/2011:23:41:50 -0800] "GET /xxx/
resource_summation_task_start HTTP/1.1"
301 170 - "AppEngine-Google; (+http://code.google.com/appengine)"
"xxx.appspot.com" ms=5 cpu_ms=0 api_cpu_ms=0 cpm_usd=0.000048
queue_name=__cron task_name=93800058e445afcf830ee9a295ff1528

this is when I run URL /xxx/resource_summation_task_start manually
from new chrome browser incognito window(without any login/session
etc)

01-21 11:46PM 11.203 /xxx/resource_summation_task_start/ 200 430ms
570cpu_ms 500api_cpu_ms 0kb Mozilla/5.0 (Windows; U; Windows NT 6.1;
en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.237
Safari/534.10,gzip(gfe)
123.236.186.51 - - [21/Jan/2011:23:46:11 -0800] "GET /xxx/
resource_summation_task_start/ HTTP/1.1"
200 125 - "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/
534.10 (KHTML, like Gecko) Chrome/8.0.552.237 Safari/
534.10,gzip(gfe)"
"xxx.appspot.com" ms=430 cpu_ms=571 api_cpu_ms=501 cpm_usd=0.015917

The only difference i see is return code 301, does that mean cron job
can not run with redirected url ?

Greg Darke

unread,
Jan 22, 2011, 7:46:28 PM1/22/11
to google-a...@googlegroups.com
Hi Anurag,

For a cron task to be considered successful it must return a value
between 200 and 299 (inclusive).

Redirects are not followed by the cron system.

> --
> You received this message because you are subscribed to the Google Groups "Google App Engine" group.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
>
>

--
Greg Darke

Siwei ZHU

unread,
Feb 9, 2011, 7:11:59 PM2/9/11
to Google App Engine
Greg is right.
You might want to check your cron.yaml if the "url:" points correctly
to your .py file.

On Jan 23, 1:46 am, Greg Darke <da...@google.com> wrote:
> Hi Anurag,
>
> For a cron task to be considered successful it must return a value
> between 200 and 299 (inclusive).
>
> Redirects are not followed by the cron system.
>
Reply all
Reply to author
Forward
0 new messages