Google App Engine Flexible Cron Tasks Fail with SSL Redirection

180 views
Skip to first unread message

Chad Paulson

unread,
Sep 22, 2018, 12:51:17 PM9/22/18
to Google App Engine
Hello,

I am having an issue getting cron tasks to work and I'm not sure there is currently a remedy due to the limited nature of SSL support for GAE flexible and the lack of handler support.

Currently all of the tasks are failing because they are returning a 301 HTTP response code.  While this seems like an edge case, it also seems like a bit of an infrastructure oversight and I would greatly appreciate any assistance on this matter.

Thanks,
Chad

Maximiliano Contartesi

unread,
Sep 24, 2018, 1:31:37 PM9/24/18
to google-a...@googlegroups.com
Task are executed inside the GAE, these task are served without SSL, you need to check if you have any redirect in your APP and discrimine it.




--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/2412c304-2407-4e25-851c-d6cde59f4993%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Amit (Google Cloud Support)

unread,
Sep 24, 2018, 6:00:52 PM9/24/18
to Google App Engine

Hi Chad


I went through a couple of posts that could related to this error. I believe this is the cause of the issue - cron accesses target URLs over http, and so when the handler tries to redirect to https it's throwing the 301 'Moved permanently' response. It seems like cron jobs are triggered by the App Engine Cron Service over http. If you're forcing https redirection, consider adding another handler [3] just for the Cron jobs without any redirection. Also you can check this [4] link to enable retrying all failed cron jobs. I hope it helps. If the solutions mentioned in given links doesn’t work for you and convinced it might be a bug, you can report this in issue tracker.


[1] https://groups.google.com/forum/#!topic/google-appengine/PsOGESDKiGk

[2] https://stackoverflow.com/questions/15667681/can-app-engine-cron-jobs-use-https-ssl

[3] https://cloud.google.com/appengine/docs/standard/python/config/cron#securing_urls_for_cron

[4] https://cloud.google.com/appengine/docs/standard/python/config/cron#retrying_cron_jobs_that_fail


Chad Paulson

unread,
Sep 26, 2018, 10:52:12 PM9/26/18
to Google App Engine
Thank you both for the heads up!

I completely forgot about the application-level redirect I put in place and was able to solve this quite easily by adding exceptions.
Reply all
Reply to author
Forward
0 new messages