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.

Unable to run the sample application for google cloud platform

See original GitHub issue

I am just starting off on google-cloud-platform. I have created an account and a project on cloud console. I was trying to run some of the sample apps provided. I started with the sample app for cloud storage provided at:

https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/storage/cloud-client

I have installed apache maven 3.5.0 on my PC. I followed the steps provided in the link, that is I gave the following commands:

mvn clean package -DskipTests and then

mvn exec:java -Dexec.mainClass=com.example.storage.QuickstartSample -Dexec.args="my-bucket-name" The first command succeeded. However, the second command failed. I got the following error:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:06 min
[INFO] Finished at: 2017-06-15T18:27:55+05:30
[INFO] Final Memory: 15M/172M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project storage-google-cloud-samples: An exception occured while executing the Java class. connect timed out -> [Help 1]

Now, the computer where I was running this command on, is behind a proxy. However, my proxy settings have been set in the file conf/settings.xml, also when I ran the first command, it successfully downloaded some packages, so I’m not sure if it is due to some proxy issue, however to check, I tried it on another machine, which is not behind a proxy.

I gave the same two commands. The first one succeeded and the second failed again, with the following (different) error:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:02 min
[INFO] Finished at: 2017-06-15T18:22:31+05:30
[INFO] Final Memory: 13M/32M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (d
efault-cli) on project storage-google-cloud-samples: An exception occured while
executing the Java class. 401 Unauthorized -> [Help 1]

So my queries are:

  1. What could be the cause for the error in the first case? Is it something to do with proxy settings? If yes, then where/how should I specify the settings?
  2. What could be the cause for the error in the second case where I am not behind any proxy?
  3. Am i missing some step here?
  4. Also , if you look at the source for this sample app, there is just a single file which basically creates a bucket. The bucket is passed as an argument from command line. Now, as per my understanding, first there needs to a project in the cloud console to create any resources. So where will this bucket be created? As in shouldn’t we be specifying the project-ID where this bucket is to be created?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
lesvcommented, Jun 15, 2017

Have you done the following:

gcloud init
gcloud auth application-default login

It should pick up the projectID from gcloud.

0reactions
jabubakecommented, Apr 3, 2018

@architsinha Please re-open if you are still running into issues

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Cloud Run issues
This page shows you how to resolve issues with Cloud Run. For other issues not listed below, check to see if they may...
Read more >
Unable to run the sample application for google cloud platform
TL;DR - You're missing the credentials, the example relies on to invoke the desired Google Cloud APIs. Using Application Default Credentials ...
Read more >
Getting started – Google Cloud console
Get Started with. Google Cloud Platform. 90-day, $300 free trial to get you started. Always free products to keep you going. Try For...
Read more >
Incidents - Google Cloud Service Health
Google Cloud Infrastructure is failing to push cloud configs, 8 May 2022 ... NET Cloud Run applications fail if HTTP/2 or gRPC is...
Read more >
Turn Google Cloud on or off for users
For example, you can prevent users from configuring access to VM instances outside of your organization. When Google Cloud is turned off, users...
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