3
votes

I've installed a CakePHP application onto App Engine, and I'm redirecting URLs into it using a wildcard URL in my app.yaml:

  • url: /.* script: app/webroot/index.php

The documentation states that /_ah/* URLs will be ignored (I don't know what these are for yet), but they are being caught by my CakePHP app and throwing errors into the error log. I also suspect this is the cause of 500 errors with an appengine error of 204 that keep happening randomly.

Does anyone have a solution for this? How do I ensure that the /_ah/ urls pass through to the app engine and not my specific application code?

Example error:

E 08:51:48.957 2015-03-17 404 841 B 304ms /_ah/start 0.1.0.3 - - [17/Mar/2015:01:51:48 -0700] "GET /_ah/start HTTP/1.1" 404 841 - - "****.appspot.com" ms=304 cpu_ms=416 cpm_usd=0.000094 loading_request=1 instance=0 app_engine_release=1.9.18 E 08:51:48.854 error: [MissingControllerException] Controller class AhController could not be found.

MissingControllerException is thrown by my app.

1
I'm intrigued, clearly you're not making those request yourself, so do you know where do they come from? - Hanuman
No idea, I've updated the original message with an example error. - Daniel
Take a look at this. - Hanuman
Its a problem of your framework, not GAE (it should give you 404 response instead of error). You SHOULD be able to define these URL to do certain action on instance startup/shutdown. - Dmytro Sadovnychyi
Yes, you can add url: /_ah/start (on a higher level than url: /.*) and a handler to do some work on instance start or just return an empty response. The log entry that you provided is odd though, as 404 for /_ah/start is considered success and usually have info log level. As for 500 + 204 combination, that's pretty common with third party frameworks that attempt writes to local file system. - Nikita Uchaev

1 Answers

2
votes

Request to /_ah/start is an initial request from Appengine itself, to initialize your app. I think you can ignore it, if you don't need to do anything special. Or return empty response.

See docs: https://cloud.google.com/appengine/docs/php/modules/#PHP_Instance_states