-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
com.google.cloud.core.ServiceOptions.getDefaultProjectId()
does not work in App Engine local environment
#2209
Comments
Ideally, when running locally on GAE std, you'll try to grab from either |
This appears to be a problem even with clients trying to load project ID implicitly, e.g. BigQuery (user-filed issue: #2235 ) |
Our current approaches to retrieving project/application id fail when using gcloud sdk maven plugin and when application id is not specified in appengine-web.xml. I have filed an issue to app-maven-plugin. On a different note, based on appengine runtime contract, both |
This happens regardless of the Maven plugin. For example, where and how will you get a project ID if an app doesn't use any build system? In such a case, users will run the local server directly at the command-line (which is what the Eclipse plugin does, for example.) I also left some comment in the maven plugin issue: GoogleCloudPlatform/app-maven-plugin#202 (comment) |
@chanseokoh thank you for your reply on this. The information (project/application id) is actually there (in gcloud sdk). Since this is a gcloud sdk-based plugin, I thought it would retrieive a project id when running "mvn appengine:run". I think "mvn appengine:deploy" by default does this - using the project id set by "gcloud init" as the |
The Maven plugin is not the only tool that is Cloud SDK-based. For example, the Eclipse plugin and the IntelliJ plugin (which share the core gcloud-related code with the Maven plugin) run
As you can see, the project ID does not come from So, even if the Maven plugin (and the Gradle plugin) populate and set a project ID configured by |
Also, don't forget the case where users don't use any tool (not even gcloud) but directly invoke the dev server at the command-line.
We need a solution to avoid the problem in this case too. |
Have you reached any resolution? I am very curious. If not, please update later when you come up with one. Whatever it will be, I can anticipate many problems as long as the dev server wants to know some project ID. Ideally, the dev server should just not need it. |
I asked for a feature in GoogleCloudPlatform/appengine-plugins#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. |
This issue seems a bit stale. This is also not actionable in this repository. GoogleCloudPlatform/appengine-plugins#439 is open, so I'm going to close this PR. |
APIs 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()
returnsno-app-id
unless<application>project-id</application>
exists inappengine-web.xml
Note : returns project-id without the application entry when deployed to App Engine.
@ludoch @lesv
The text was updated successfully, but these errors were encountered: