-
Notifications
You must be signed in to change notification settings - Fork 95
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
thread 'main' panicked at 'called Result::unwrap()
on an Err
value: GAX(InvalidEmulatorHOST(""))', src/main.rs:15:45
#124
Comments
if you are going to use emulator
if you are not going to use emulator |
I am using Google-cloud-pubsub, can you point me to that documentation with
the info using client config
…On Mon, Mar 27, 2023 at 7:28 PM Naohiro Yoshida ***@***.***> wrote:
if you are going to use emulator
- Set OS env var SPANNER_EMULATOR_HOST to use spanner emulator.
- Set OS env var PUBSUB_EMULATOR_HOST to use pubsub emulator
if you are not going to use emulator google_cloud_default::WithAutoExt
and call with_auth for ClientConfig is required
https://github.com/yoshidan/google-cloud-rust-example/blob/547aa0f2e7ac81a09dc130617c841ba9bf4526ed/webapi/src/main.rs#L20
—
Reply to this email directly, view it on GitHub
<#124 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJSK7L5BFXZSH53HUQMEZ5TW6JEFNANCNFSM6AAAAAAWJ34KII>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Here is the I am sorry but the method of using emulator is not described in the documentation and should be clearly stated. google-cloud-rust/pubsub/src/client.rs Line 32 in 1043d70
|
Hey, Thank you. How do I publish/subscribe to pubsub without using emulator. The problem i am facing is not sure how to pass the correct projectid. Following is the error. Can you pls help me with it. Thank you Out put of Clientconfig where the project_id is none. Error Message thread 'main' panicked at 'called |
It looks that no credential file is found. You must set google credential file into os env 'GOOGLE_APPLICATION_CREDENTIALS' before calling
|
Thank you, I had set the GOOGLE_APPLICATION_CREDENTIALS, still the same. When I print the config, its showing me the project_id is None. ClientConfig { |
Also in the client.rs, I noticed that its looking for PUBSUB_EMULATOR_HOST instead of GOOGLE_APPLICATION_CREDENTIALS. /// ClientConfigs created by default will prefer to use Is my understanding correct? Pls suggest so that i can test the publish message and subscribe message later |
google-cloud-rust/default/src/lib.rs Line 32 in 1043d70
If the
|
Thank you, tried hard coding now and it worked.
…On Wed, Mar 29, 2023 at 5:19 PM Naohiro Yoshida ***@***.***> wrote:
ClientConfig::default() is configured to use emulator, but gets the
project_id from credentials by calling google-cloud-default's with_auth
method.
https://github.com/yoshidan/google-cloud-rust/blob/1043d7019daed0c7c4a0c178a3fbdddf98f14015/default/src/lib.rs#L32
If the project_id is empty even though with_auth is called, then the
project_id in the credentials file is empty.
I do not know what kind of credentials file you are using, but it is
possible to specify the project_id directly in ClientConfig.
let mut config = ClientConfig::default().with_auth()
config.project_id = Some("your_project_id".to_string());
—
Reply to this email directly, view it on GitHub
<#124 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJSK7L3ZN44VIHGZAGHX6XDW6TGPXANCNFSM6AAAAAAWJ34KII>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
If you are still having trouble the documentation was updated in #126 |
This happens with Credentials File ends up as:
|
If the credentials does not include the project_id, the project_id must explicitly set the project_id. let mut pubsub_config = google_cloud_pubsub::client::ClientConfig::default().with_auth().await?;
pubsub_config.project_id = Some(xxx); |
thread 'main' panicked at 'called
Result::unwrap()
on anErr
value: GAX(InvalidEmulatorHOST(""))', src/main.rs:15:45. How do i resolve this? I ran the code as isThe text was updated successfully, but these errors were encountered: