appcfg.py download_app fails silently

722 views
Skip to first unread message

Lewis

unread,
May 20, 2017, 5:53:11 PM5/20/17
to Google App Engine

I'm trying to take a look at a Google App Engine project started by another developer and deployed to the Google Cloud Platform. I have project owner rights. When running appcfg.py -A [appID] -V  [version] download_app [location] there are no errors, but no files come down. 

12:00 PM Host: appengine.google.com
12:00 PM Fetching file list...
12:00 PM Fetching files...

If the appID is invalid, or the version is invalid appfcg.py displays an error, 

12:00 PM Host: appengine.google.com
12:00 PM Fetching file list...
Error 404: --- begin server output ---
This application does not exist (project_id=u'invalid'). To create an App Engine application in this project, run "gcloud app create" in your console.

or

12:00 PM Host: appengine.google.com
12:00 PM Fetching file list...
Error 400: --- begin server output ---
Major version "123" does not exist.

but when the appID and version are valid it simply downloads nothing. Any suggestions?

Nicholas (Google Cloud Support)

unread,
May 23, 2017, 3:28:40 PM5/23/17
to Google App Engine
Interesting.  If you are an owner of the Cloud Platform project where this application is deployed, you should indeed be able to download the application code using appcfg.py download_app as documented in Downloading Your Source Code.
  • Does the request complete successfully despite returning 0 files or does is hang on Fetching file list...?
  • Has anyone working with the project ever permanently prohibited code downloads as available in the App Engine Settings of the Cloud Console?  I haven't tried this in some time but I believe you should get an error message if this is the case and not a hang.
  • Can anyone else working with the project successfully download the code using appcfg.py download_app?
  • If you have App Engine Code Viewer ACLs, you should be able to view the code in the Stackdriver Debug page.  Is there any code shown there?
If code download has not been disabled and you still cannot access the application code even with all the proper ACLs mentioned above, it's possible that your project is in a strange state.  In which case, I would recommend filing a public issue on our Issue Tracker.  If you do so, post a link to it here.  We can make the issue private so that you can disclose your project ID.

Lewis

unread,
May 23, 2017, 10:11:41 PM5/23/17
to Google App Engine
The request completes without error despite fetching 0 files.
No one has prohibited code downloads. The option is still available.
I'm currently the only developer on the project but will see if we can get someone else in the organization to try a download.
There is no code shown in the Stackdriver Debug page. The left side panel reports "Source Not Available" and the center panel "No source code was found."

I will post to the issue tracker. Thank you for your time and help.

Nicholas (Google Cloud Support)

unread,
Jun 2, 2017, 9:34:10 AM6/2/17
to Google App Engine
Is your deployed application using the standard or flexible environment?  I ask because I tested appcfg.py download_app using a standard Python application and a flexible Node.js application.  With the Python application, I was able to retrieve the code from both appcfg.py download_app and view it in Stackdriver Debug.  With the flexible Node.js application, I could not access the code from either.

While the appcfg.py documentation is shown under the standard runtime docs like Python and Go, some or most of its commands seem to work as expected with flexible runtimes.  This contrast makes the expected behavior here somewhat unclear.

If your application is one of a standard runtime, I believe appcfg.py download_app should succeed and this is therefore likely an issue with the platform which we should investigate.  I would recommend filing a public issue on our Issue Tracker.  If it is one of the flexible environment, I would also recommend filing a public issue.  If it's determined that this is intended behavior, the issue could become a feature request coupled with a documentation update to clarify appcfg.py expectations.

T Mst

unread,
Jun 21, 2017, 7:36:20 PM6/21/17
to Google App Engine
This works for me. I neglected to put pubspec.lock under source control and found myself with incompatible dependency(s) after doing a `pub get` in my Dart project. My only hope was to download my deployed project. I'm using the gcloud toolkit but downloaded appcfg.py spefically for this purpose. It took me a few tries to get the version right, as it was simply '1' rather than what is listed using an output  of `gcloud app versions list`.

Pablo Martinez

unread,
Aug 3, 2017, 3:13:33 PM8/3/17
to Google App Engine
Same situation... same problem.
Any Help?

Thanks

Dovi Lilling

unread,
Aug 9, 2018, 3:02:46 PM8/9/18
to Google App Engine
After struggling with this for several days, I stumbled across an extremely easy way to download my version's code.
IMHO, I think this is the easiest way to download it.

Under the main menu, under Products, go to Tools -> Cloud Build -> Build history.
There, click the ID of the build you want.
Then, in the opened window (Build details), click the "source" link, the download of your compressed code begins.
As simple as that.

HTH.

Dan S (Cloud Platform Support)

unread,
Aug 9, 2018, 5:38:21 PM8/9/18
to Google App Engine
Hello,

you can run the appcfg.py download_app as documented in Downloading in your cloud Shell and after download the project you can just upload to some repository.
1. open the Cloud Shell (sole.cloud.google.com)
2. create a folder (mkdir myApp)
appcfg.py -A [YOUR_PROJECT_ID] -V [YOUR_VERSION_ID] download_app myApp
4. upload your files to your repo.


On Saturday, May 20, 2017 at 5:53:11 PM UTC-4, Lewis wrote:

Dovi Lilling

unread,
Aug 9, 2018, 6:28:44 PM8/9/18
to google-a...@googlegroups.com
No can do, it also fails in cloud shell.

--
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/24bab34a-bf1f-4725-8789-aae4809cddf2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Katayoon (Cloud Platform Support)

unread,
Aug 10, 2018, 6:37:47 PM8/10/18
to Google App Engine

Hi,


I tried the command and it works fine for me.  I recommend that you raise a PRIVATE report in the Issue Tracker and provide us the project number and the version number so that we would be able to investigate the issue efficiently.




Reply all
Reply to author
Forward
0 new messages