0

EDIT: Upon further inspection, I found that the URL of the Datastore Admin is already https://ah-builtin-python-bundle-dot-[project-id].appspot.com/_ah/datastore_admin?app_id=[project-id]. It was probably enabled before the "default" tag was put implemented, so it was catching all traffic into the sub-domain. So, no need to re-map the URL.

There is this existing project which I have been added to work on, and it has the [project-id].appspot.com already occupied by a stock Datastore Admin page.

I needed to host a few more appspot URLs, some of which to act as PubSub endpoints, so I found this thread explaining that all I need to do is add a service tag in the app.yaml.

However, on deploying, I get this error

ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: The first service (module) you upload to a new application must be the 'default' service (module). Please upload a version of the 'default' service (module) before uploading a version for the 'upload-watcher' service (module). See the documentation for more information. Python: (https://developers.google.com/appengine/docs/python/modules/#Python_Uploading%%20modules) Java: (https://developers.google.com/appengine/docs/java/modules/#Java_Uploading%%20modules)

with 'upload-watcher' being the service name I assigned to this app engine app.

This user faced a similar issue, but he sought a different workaround and the answer was merely conceptual.

Mechanically, is this the right code to add into the chosen app.yaml? :

service: default 

Further, it appears to me that the Datastore Admin should NOT be made the default service, and should be kept more or less obscured from public view. Hence, ideally, I would like to remap the datastore admin to a secondary service URL, like

datastore-admin-dot-[project-id].appspot.com

How can this be done?

Larry Cai
  • 881
  • 1
  • 11
  • 24

1 Answers1

1

The solution discussed in the first thread you mention means a separate .yaml config file for the new service, not just a service tag into the app.yaml file (the existing one).

Personally I recommend keeping the services in separate side-by-side subdirectories inside the GAE app's dir, see an actual example in Can a default service/module in a Google App Engine app be a sibling of a non-default one in terms of folder structure?

The error you encounter is similar with the second thread you mentioned: you don't have an already a deployed default service when you're trying to deploy the upload-watcher service.

Don't over-think the datastore admin "mapping" part too much - you may be misled by the second thread - the datastore admin is not a GAE service/module, it's an app-level facility covering all of the app's services which share the app's datastore. Get your services running first and, if you see problems in this direction ask a separate question, right now it's just adding confusion.

Update:

Yes, the service: default is correct for the default service. Alternatively you can just have no service config in it at all - same effect.

Depending the deployment command used (more specifically the --version optional argument) a new service version would be created or an existing version would be overwritten. See also Continuous integration/deployment/delivery on Google App Engine, too risky?

But, as you observed, serving the datastore admin facility is done by default, not specifically enabled via configs, so it'll work regardless or overwriting the existing version or not.

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
  • I understood that the `default` service tag had to go into a different .yaml, for the service that I wish to set as `default`, but is that line of code the right usage? Also, I'm worried that if I were to deploy my new service as default, it'll take over the main appspot URL `[project-id].appspot.com`, and the team and users will lose access to the datastore admin? Or will that not be the case? – Larry Cai Jan 14 '19 at 04:34