Endpoints not working locally (for GO)

287 views
Skip to first unread message

Steven Kampen

unread,
Feb 16, 2017, 2:05:13 PM2/16/17
to Google App Engine
I've previously used Python and Java SDKs (with endpoints), though it's been a while.

When I setup a simple Go app with a single endpoint (similar to https://medium.com/google-cloud/go-cloud-endpoints-and-app-engine-64d1c78bea82#.8xz2ol18k) I'm not able to get any response from the endpoints.

I'm starting the app with both `goapp serve ./` and `dev_appserver.py ./` with the same result. When deployed, the endpoints do work.

```
INFO     2017-02-16 19:00:03,827 devappserver2.py:764] Skipping SDK update check.
INFO     2017-02-16 19:00:03,878 api_server.py:268] Starting API server at: http://localhost:55881
INFO     2017-02-16 19:00:03,881 dispatcher.py:199] Starting module "default" running at: http://localhost:8080
INFO     2017-02-16 19:00:03,887 admin_server.py:116] Starting admin server at: http://localhost:8000
```

I'm trying to access the local endpoint on port 8080.

Nick (Cloud Platform Support)

unread,
Feb 16, 2017, 7:46:45 PM2/16/17
to Google App Engine
Hey Steven,

This kind of post - a specific-issue technical support question - would be best sent to Stack Overflow, as there's a much larger user-base there and their site is designed for that kind of post. This forum is meant for more general discussion of the platform and services, design patterns, free-form discussion not necessarily based on 1 question 1 answer. 

But nonetheless, I'll be happy to assist here and possibly we can get this question to a state where it can be posted to Stack Overflow.

Some questions that jump out at me from reading your post:

* What is the error that you see in development? Posting a full stack trace helps to determine what went wrong
* What version of the SDK are you using?

I'll take a look at running the code from the tutorial you linked myself and see if I can also see the error.

Cheers,

Nick
Cloud Platform Community Support

Steven Kampen

unread,
Feb 18, 2017, 6:22:38 AM2/18/17
to Google App Engine
Thanks for the reply Nick,

There is no stacktrace. The API service just seems not to be running. If I hit the endpoint path (verified from production) on the "main" port (8080 by default, and which I assume is the intended behaviour) I get 404s. If I hit the endpoint path at the "API Server" host (port 55881 in the example above), then I get a response like "{app_id: dev~myprojectname, rtok: '0'}". I actually get this response from that host for all paths.

I'm using version 1.9.48 of the SDK.

Steven Kampen

unread,
Feb 18, 2017, 7:38:48 AM2/18/17
to Google App Engine
Looks like this is specific to OSX, judging by this report here: http://stackoverflow.com/questions/42282294/404-when-migrating-go-appengine-app-from-ubuntu-to-macos

I tested out a bunch of GCloud SDK versions until I found that the break starts in v138.0.0, which uses Python Extensions v1.9.49. GCloud SDK v137.0.1 uses Python Extensions v1.9.40, and works fine.

Nick (Cloud Platform Support)

unread,
Feb 22, 2017, 5:53:38 PM2/22/17
to google-a...@googlegroups.com
Hey Steven,

Thanks for letting us know. This seems like something that we could take a look at on the Public Issue Tracker. In order to produce a report there, we'll need a few more details though, for your specific case:

1. How do you run the devserver exactly?
2. What's the exact output?
3. How do you send the request to the server?
4. Can this be reproduced using the endpoints example from the github repo?

With this information, we'll be able to begin work on reproducing the behaviour for specialists to take a look at and correct.


Cheers,

Nick
Cloud Platform Community Support

Steven Kampen

unread,
Mar 3, 2017, 4:36:05 PM3/3/17
to Google App Engine
1. How do you run the devserver exactly?
As mentioned earlier, with `dev_appserver ./` or `goapp serve ./`.
 
2. What's the exact output?
As mentioned earlier, the only "output" is the expected messages about the dev server starting up.
  INFO     2017-02-16 19:00:03,827 devappserver2.py:764] Skipping SDK update check.
  INFO     2017-02-16 19:00:03,878 api_server.py:268] Starting API server at: http://localhost:55881
  INFO     2017-02-16 19:00:03,881 dispatcher.py:199] Starting module "default" running at: http://localhost:8080
  INFO     2017-02-16 19:00:03,887 admin_server.py:116] Starting admin server at: http://localhost:8000

The issue is that the endpoints all return 404.

3. How do you send the request to the server?
HTTP! How do you usually do it?? No, jk, I used curl. 

The API explorer also does not "discover" the API.

4. Can this be reproduced using the endpoints example from the github repo?
No idea. I'm not familiar with that way of using endpoints with appengine & go. However, it can be replicated using the example provided in the README here: https://github.com/GoogleCloudPlatform/go-endpoints (the greetings app).
Reply all
Reply to author
Forward
0 new messages