Can't start nginx in step 6 Running Extensible Service Proxy of Quickstart

1,067 views
Skip to first unread message

bitr...@gmail.com

unread,
Sep 9, 2016, 4:59:13 AM9/9/16
to Google Cloud Endpoints
When I get to step 6, and try and restart the nginx, I get the following:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Sep  8 13:59:14 2016 from 173.xxx.xxx.xxx
user1@linux:~$ sudo service nginx restart
Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.
user1@linux:~$ systemctl status nginx.service
Failed to get D-Bus connection: No such file or directory
user1@linux:~$ journalctl -xn
No journal files were found.

As you can see I am using the Debian Linux Compute Engine Instance.

Any help appreciated.

qiwz...@google.com

unread,
Sep 9, 2016, 1:10:52 PM9/9/16
to Google Cloud Endpoints, bitr...@gmail.com
I just tried it. It works for me.

It is possible that the service file was not downloaded if two metadata values were not set correctly.

Inside your GCE VM instance, you can check the folder /etc/nginx/endpoints/, it should have a file service.json.  If it is not there,  the service file was not downloaded. Most likely you did not set the two metadata value correctly. You can go to your VM instance in the Console to check the two metadata values.

They are set in the "Creating a Compute Engine instance" section,  the step 4. 

If they are not correct,  you have to delete this instance, and start over again at creating a new VM instance.

Thanks
-Wayne

bitr...@gmail.com

unread,
Sep 10, 2016, 3:44:33 AM9/10/16
to Google Cloud Endpoints, bitr...@gmail.com, qiwz...@google.com
Thanks Wayne! That did it. I missed the step where I set the endpoints-service-version. It assumed I would do Add item again, as there is no step d telling me to do so.

chandrachu...@stillmind.in

unread,
Jul 23, 2018, 9:16:36 PM7/23/18
to Google Cloud Endpoints
Hi,


I am unable to get nginx (Extensible Service Proxy) working. Here's the contents of /var/log/nginx/error.log. I think I have set all the metadata values correctly. (Initially I had not set the config ID / service version, but had to set that to remove one error). 

Now facing this error. Is it due to a missing API key? Because when I paste the url into a browser, it says "The request is missing a valid API key."

Can you please help? Thanks.

cat /var/log/nginx/error.log 

INFO:Fetching an access token from the metadata service

INFO:Fetching the service name from the metadata service

INFO:Service name: echo-api.endpoints.example-serious-unison-203011.cloud.goog

INFO:Fetching the service config rollout strategy from the metadata service

INFO:Service config rollout strategy: managed

INFO:Fetching the service config ID from the metadata service

INFO:Service config ID:2018-07-23r3

INFO:Fetching the service configuration from the service management service

ERROR:Fetching service config failed (status code 403, reason Forbidden, url https://servicemanagement.googleapis.com/v1/services/echo-api.endpoints.example-serious-unison-203011.cloud.goog/config?configId=2018-07-23r3)

qiwz...@google.com

unread,
Jul 24, 2018, 5:04:42 PM7/24/18
to Google Cloud Endpoints
ESP is getting access token from GCE metadata server, and pass it to  https://servicemanagement.googleapis.com to fetch the service config.   It failed with 403.

My speculation is:  GCE VM was not created with the same project as the service "echo-api.endpoints.example-serious-unison-203011.cloud.goog"

So it could not access the service config.

-Wayne
Reply all
Reply to author
Forward
0 new messages