1

I made a test project in Google App Engine a few months back, and shifted gears to other projects, but would like to take another swing at it now, so I logged into my Google Cloud account and fired up the editor to start tweaking my .py files for styling.

When I open the Google Cloud editor on my desktop and from within Google Cloud, I can open the project, but the home directory only has 1 index.yaml (content unrelated to the project) file and a README. I've tried searching for main.py, with no results. If I navigate to my project.appspot.com url, the project is running as if I never left. Also, If I go to Services and select Diagnose >> Source, I can see the code for all the files I am looking for.

I've heard that the Cloud SDK acts like it's own computer with a drive space, so I'm basically asking: How do I navigate to my live project directory in Google cloud editor so I can continue editing?

And once again, Thank you for your help!

Cloud SDK Doesn't show my files?

Files Show fine in the debugger?

Guillermo Cacheda
  • 2,162
  • 14
  • 23
Nathaniel MacIver
  • 387
  • 1
  • 4
  • 21

1 Answers1

2

Your cloud shell home directory may have been deleted due to inactivity. From Usage limits:

If you do not access Cloud Shell for 120 days, we will delete your home disk. You will receive an email notification before we do so and simply starting a session will prevent its removal. Please consider a different solution on Google Cloud Storage for sensitive data you wish to store long term.

Unless you permanently disabled your app code downloads you can download your deployed (standard env only) app code back into your new cloud shell home directory using the GAE SDK (also available in your cloud shell) - see Downloading Your Source Code for details:

You can download an application's source code by running the appcfg.py command with the download_app action. The appcfg.py download_app command is available through the original App Engine SDK for Python.

appcfg.py -A [YOUR_PROJECT_ID] -V [YOUR_VERSION_ID] download_app [OUTPUT_DIR]

Or copy-paste the files from the StackDriver (tedious)

If you're using the flexible environment check out this answer: Downloading App Engine source code.

But a better idea would be to have your code managed in a remote repository somewhere, accessible from your clod shell machine, so that you can restore any version at any time. Maybe Google Cloud Source Repositories, integrated with various GCP products.

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
  • Thanks Dan. I figured having my workspace purged would have brought down the app engine, but I suppose not. Since I'm a python newb, I think I'll start up a web space on pythonanywhere.com to get my sea legs before I try to host another app on Google Directly. – Nathaniel MacIver Aug 01 '18 at 13:54