We have a google cloud AppEngine service that was written and deployed by a developer who is no longer with our company (we do still have his login credentials, however). The version is on a custom runtime and a flexible environment, and it was last deployed on April 16, 2018.
Our problem is that this service is intermittently throwing 502/nginx errors and we cannot seem to locate the source code for it. When we go to the debug tab on that version, we see the attached screen. Attempting to redeploy following the instructions in the screenshot errors because there are no source files in our local directory.
Does anyone know if it is possible to find out where this code was deployed from? We have of course scoured our GitLab and cannot find the project there.
3
Answers
I found that the code of the App engine services is uploaded to folder in Google Cloud storage
staging.[yourproject].appspot.com
us.gcr.io
this may vary depending on the region of appengineappengine
If this folder was deleted, the code cannot be recovered.
You can try going to App Engine > Instances in your GCP console (https://console.cloud.google.com/appengine/instances). Select the correct service from the dropdown and then choose "SSH" on the instance itself.
A Cloud Shell will open. Do
sudo docker exec -t -i gaeapp /bin/bash
to open the app container (Access app files in ssh session into google app engine flexible?)Now if you do
ls
you should see the files. However, at this point I don’t know how to easily download all of them.@Jans answer would be far more straight forward to access the files, but
staging.[yourproject].appspot.com
by default will delete files that are older than 14 daysAdding another option here, a while ago I was working on several ways of doing so and gathered them in a GitHub repo. So I’ll leave it here in case if it works for you, hope so!