`com.google.cloud.core.ServiceOptions.getDefaultProjectId()` does not work in App Engine local environment
See original GitHub issueAPIs like google-cloud-pubsub
require users to explicitly provide a project id.
When App Engine Maven Plugin is used to run locally using mvn appengine:run
ServiceOptions.getDefaultProjectId()
returns no-app-id
unless
<application>project-id</application>
exists in appengine-web.xml
Note : returns project-id without the application entry when deployed to App Engine.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Troubleshoot App Engine errors - Google Cloud
If you run into problems deploying your app using the App Engine Admin API, this page lists error messages that you might see...
Read more >Google Cloud Services extension pack for Quarkus
If the project ID is not set, the extensions will default to using ServiceOptions.getDefaultProjectId() that will use the default project detected via ...
Read more >com.google.cloud.ServiceOptions Maven / Gradle / Ivy
The class is part of the package ➦ Group: com.google.cloud ➦ Artifact: ... null) { // Could not resolve appengine classes under GAE...
Read more >In Python, how can I test if I'm in Google App Engine SDK?
When running on App Engine, this value is " Google App Engine/X.Y.Z ". ... app is being run in App Engine") else: print("The...
Read more >com.google.cloud.ServiceOptions.java Source code
Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. *...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I asked for a feature in GoogleCloudPlatform/appengine-plugins-core#439 to set it. It would still be nice if you picked up GOOGLE_CLOUD_PROJECT or .config/gcloud/configurations/config_[.config/gcloud/active_config] and grab "project = " from it.
Ideally, when running locally on GAE std, you’ll try to grab from either
GOOGLE_CLOUD_PROJECT
, if defined, or (typical case), get it fromgcloud
.