Endpoints tutorial at cloud.google.com fails when deploying

136 views
Skip to first unread message

Will

unread,
Feb 14, 2019, 6:50:49 PM2/14/19
to Google Cloud Endpoints
Hi,

When working through the Endpoints tutorial for Java (https://cloud.google.com/endpoints/docs/frameworks/java/get-started-frameworks-java), the project fails to build after running
 mvn appengine:deploy

The error I get is the following:

Failed to execute goal com.google.cloud.tools:appengine-maven-plugin:1.3.2:deploy (default-cli) on project echo-j8: Execution default-cli of goal com.google.cloud.tools:appengine-maven-plugin:1.3.2:deploy failed: Non zero exit: 1 -> [Help 1]

to...@google.com

unread,
Feb 14, 2019, 7:12:46 PM2/14/19
to Google Cloud Endpoints
Make sure you perform all the steps in section "Installing and configuring required software", particularly in step 6 - Create an App Engine applicaton.

gcloud config set project [YOUR_PROJECT_ID]
gcloud app create \
--project=[YOUR_PROJECT_ID] \
--region=[YOUR_REGION]

Verify on Cloud Console (console.cloud.google.com) that App Engine application is created in your project.

Will

unread,
Feb 14, 2019, 7:33:43 PM2/14/19
to Google Cloud Endpoints
Thanks! I definitely forgot to create an app. However, now I get this error when I deploy?

<html><head>

<meta http-equiv="content-type" content="text/html;charset=utf-8">

<title>500 Server Error</title>

</head>

<body text=#000000 bgcolor=#ffffff>

<h1>Error: Server Error</h1>

</body></html>

Will

unread,
Feb 14, 2019, 7:36:08 PM2/14/19
to Google Cloud Endpoints
To clarify, I'm running this command:
curl \
   
--request POST \
   
--header "Content-Type: application/json" \
   
--data '{"message":"hello world"}' \
    https
://[YOUR_PROJECT_ID].appspot.com/_ah/api/echo/v1/echo

to...@google.com

unread,
Feb 14, 2019, 8:19:17 PM2/14/19
to Google Cloud Endpoints
I'd recommend you to run the sample locally, as described in "Running the sample locally" and make a query using:
curl \
    --request POST \
    --header "Content-Type: application/json" \
    --data '{"message":"hello world"}' \

If there are any errors, they should be printed out to the terminal, where the local server was started.

For the applications hosted on *.appspot.com (uploaded to Cloud) you can see error logs in Stackdriver console.cloud.google.com > Logging > Logs. One of those log entries should correspond to your request and should provide a detailed reason for status code 500.

Will

unread,
Feb 14, 2019, 9:16:36 PM2/14/19
to Google Cloud Endpoints
I got the app to deploy locally, but not to *.appspot.com. When I went to logging, there were no logs...?

Tomasz Boczkowski

unread,
Feb 15, 2019, 5:38:45 PM2/15/19
to Google Cloud Endpoints
If you don't deploy to *.appspot.com , all calls to https://[YOUR_PROJECT_ID].appspot.com/_ah/api/echo/v1/echo will fail. There is no backend to answer your queries. Also no logs would be visible in Stackdriver.

When you deploy locally, make sure to call http://localhost:8080/_ah/api/echo/v1/echo. Application logs, including explanations for any errors will be visible in the terminal, where you've started the application.
Reply all
Reply to author
Forward
0 new messages