Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cron urls get a 403 status on Flexible Environment

We are experimenting with Flexible Environment and we want to migrate an existing application. Everything seems to go well except from cron entries.

We have a bunch of cron and every url is secured as admin" (as stated in the documentation), but every time the url is hit by the cron service we get a 403 status, if the url is hit by the user via browser everything works well.

On standard environment everything is good.

Is there anything we can check about?

like image 341
Stefano Ciccarelli Avatar asked Apr 06 '16 15:04

Stefano Ciccarelli


1 Answers

I assume you add login: admin in app.yaml handler section to secure cron service on Google App Engine standard environment.

But on App Engine flex, it changed how to secure your cron handlers like this (PHP example):

Check $_SERVER['HTTP_X_APPENGINE_CRON'] and if it's true, the requests are coming from App Engine cron service.

like image 95
Yao Li Avatar answered Sep 29 '22 14:09

Yao Li