question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`com.google.cloud.core.ServiceOptions.getDefaultProjectId()` does not work in App Engine local environment

See original GitHub issue

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() 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.

@ludoch @lesv

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
lesvcommented, Aug 21, 2017

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.

1reaction
lesvcommented, Jul 6, 2017

Ideally, when running locally on GAE std, you’ll try to grab from either GOOGLE_CLOUD_PROJECT, if defined, or (typical case), get it from gcloud.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found