Viewing code currently deployed in App Engine

Since the Cloud Debugger was deprecated, there doesn't seem to be to a simple way to view the files that are currently deployed. The Snapshot Debugger they suggest goes way over my head and seems like a lot to go through just to confirm the files that are deployed. Other documentation points to the Versions and Services pages in App Engine, but neither of these has an option to access the source code. 

Is there a way to view currently deployed code (or at least the filenames!) in App Engine that someone who's fairly new to this can wrap their head around?

5 6 4,942
6 REPLIES 6

Hi @Snaught,

Welcome to Google Cloud Community!

What App Engine environment are you using?

For Standard App Engine, aside from the Cloud Debugger (which is already deprecated) there used to be a Source in Versions page of GAE however it seems that it has been removed. You can try using the staging bucket to get the source code. Check your cloud storage bucket, the source code by default is available in ‘staging.<project_id>.appspot.com’ with life cycle of 15 days from the deployment. If it's greater than 15 days, I'd strongly recommend you to create a feature request, however please bear in mind that there is no ETA upon submission.

If you' re on App Engine Flex, since you can SSH into them (as Flex instances run on GCE VMs), it is possible to inspect the underlying Docker internals and pull data, including source code.

You can do these steps:

  • Access the VM by using SSH.
  • Execute the command "docker ps" and locate the image name associated with "gaeapp." It should resemble something like "us.gcr.io/vaughan-test-project-252017/appengine/default.20200130t143327."
  • From another machine or a GCE instance with sufficient disk space, use "docker pull" to retrieve that image and then extract it locally. This will provide the original state of the container when it was initially deployed.

You may want to look into these suggestions also.

Hope these help.

Thanks for your reply.

Alas, none of your suggestions have revealed a way to retrieve those files. I'm using standard App Engine, but the staging buckets just show a bunch of objects that don't correspond in any recognizable way to the files in my project, and gsutil just lists those when I use it.

The issue that prompted this search has been resolved, and I suppose it's more convenient than necessary. It's just such a strange thing to eliminate access to, and it's nice to be able to visualize what you actually have out there, so I've submitted a feature request. 

so you took away all the ways to have individuals to get their source code.

When is google going to put back services to allow us to get what we need?!

Any solution to this yet for App Engine Standard? This is a bit frustrating.

See this Stackoverflow response from us for a related question.

 

..... NoCommandLine ......
 https://nocommandline.com
A GUI for Google App Engine
    & Datastore Emulator

I found a command line solution that lists the files.

 

version=$(gcloud app --project=$PROJECT versions list --sort-by '~version' --format='value(version.id)' --hide-no-traffic --limit=1)
 
gcloud app --project=$PROJECT versions describe --service=default "$version" 
 
This works for the most current version of GAE standard project.