Method does not exist

1,501 views
Skip to first unread message

dougr...@gmail.com

unread,
Apr 12, 2017, 3:55:10 PM4/12/17
to Google Cloud Endpoints
Hey there,

I'm new to using endpoints and keep getting this error, not sure what the cause is.  Hoping someone has come across this before and can point out the solution

I have a basic yaml file deployed and got a hello world example working.  the path is /1.0.0/test/   .  So I've added some new paths to the file, deployed, but while calls to /1.0.0/test/ continue to work, all calls to the new paths result in the error 404  Method does not exist

here's the steps i'm using -

1.  update my currently deployed and working openapi.yaml file. added a new path  /1.0.0/test2/

2.  deploy the updated yaml file (copied below)    gcloud service-management deploy openapi.yaml

result:  seems to work.  returns a new service indication.  Service Configuration [2017-04-12r1]

3.  then using the new service indication, I head over to the google cloud platform,  edit my compute vm instance
       managed here https://console.cloud.google.com/compute/instancesDetail/[....my compute details here etc]
       and in the metadata I update the endpoints-service-version,  its now set to 2017-04-12r1
       and I save

4.  if I check over at the google cloud platform endpoint page here, and endpoints does seem to know about the new path
     https://console.cloud.google.com/endpoints/[.....my service details here etc]
     at the very bottom of the page /test2 is now listed.  and it shows me the 12 times I've called /1.0.0/test/  which worked

Method Requests Avg req size Avg resp size 4xx 5xx Latency 98% Latency 95% Latency median
GET /1.0.0/test 12 201 B 221 B 0 0 784 ms 460 ms 50 ms
GET /1.0.0/test2 0 - - 0 0 - - -



on that same page there's some links to logs, and so checking the google cloud platform endpoints log, I do see the requests to /test2/  and here's the log detail


url: "/1.0.0/test2/?key=[... my api key ...]" 
producer_project_id: "[.. my project id...]" 
request_latency_in_ms: 0 
request_size: 221 
error_cause: "service_control" 
http_response_code: 404 
response_size: 362 
location: "us-central1-b" 
log_message: "Endpoints management skipped for an unrecognized HTTP call: GET /1.0.0/test2/?key=[... my key here ..]" 
http_method: "GET" 
timestamp: 1492025976.863675



5.   so here's a test call to /1.0.0/test/   just using curl, and you can see the working response "hello world"

curl -k -v -X GET https://[... my host here ...]/1.0.0/test/?key=[... my key here ...]
* About to connect() to [.. my host here ...] port 443 (#0)
*   Trying 130.211.189.191... connected
* Connected to [.. my host here ..] (130.211.189.191) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* warning: ignoring value of ssl.verifyhost
* skipping SSL peer certificate verification
* SSL connection using TLS_RSA_WITH_AES_256_CBC_SHA
* Server certificate:
* subject: CN=[.. my host here ...],OU=PositiveSSL,OU=Domain Control Validated
* start date: Apr 08 00:00:00 2017 GMT
* expire date: Apr 07 23:59:59 2020 GMT
* common name: [... my host here ...]
* issuer: CN=COMODO RSA Domain Validation Secure Server CA,O=COMODO CA Limited,L=Salford,ST=Greater Manchester,C=GB
> GET /1.0.0/test/?key=[... my key here ...] HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: [... my host here ...] 
> Accept: */*
< HTTP/1.1 200 OK
< Server: nginx
< Date: Wed, 12 Apr 2017 19:28:47 GMT
< Content-Type: text/html; charset=UTF-8
< Content-Length: 11
< Connection: keep-alive
< X-Powered-By: PHP/7.1.2
* Connection #0 to host [... my host here ..] left intact
* Closing connection #0
hello world


and here's a call to the path I just added 

curl -k -v -X GET https://[.. my host here..]/1.0.0/test2/?key=[.. my key here..]
* About to connect() to [.. my host here..] port 443 (#0)
*   Trying 130.211.189.191... connected
* Connected to [.. my host here..] (130.211.189.191) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* warning: ignoring value of ssl.verifyhost
* skipping SSL peer certificate verification
* SSL connection using TLS_RSA_WITH_AES_256_CBC_SHA
* Server certificate:
* subject: CN=[.. my host here..],OU=PositiveSSL,OU=Domain Control Validated
* start date: Apr 08 00:00:00 2017 GMT
* expire date: Apr 07 23:59:59 2020 GMT
* common name: [.. my host here..]
* issuer: CN=COMODO RSA Domain Validation Secure Server CA,O=COMODO CA Limited,L=Salford,ST=Greater Manchester,C=GB
> GET /1.0.0/test2/?key=[.. my key here..] HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: [.. my host here..]
> Accept: */*
< HTTP/1.1 404 Not Found
< Server: nginx
< Date: Wed, 12 Apr 2017 19:31:32 GMT
< Content-Type: application/json
< Transfer-Encoding: chunked
< Connection: keep-alive
{
 "code": 5,
 "message": "Method does not exist.",
 "details": [
  {
   "stackEntries": [],
   "detail": "service_control"
  }
 ]
}
* Connection #0 to host [.. my host here..] left intact
* Closing connection #0



just in case you're wondering if  /test2 its there, it is and I can hit both urls on the internal ip



first /1.0.0/test/


curl -v -X GET http://10.1.0.3:8081/1.0.0/test/

* About to connect() to 10.1.0.3 port 8081 (#0)

*   Trying 10.1.0.3... connected

* Connected to 10.1.0.3 (10.1.0.3) port 8081 (#0)

> GET /1.0.0/test/ HTTP/1.1

> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2

> Host: 10.1.0.3:8081

> Accept: */*

< HTTP/1.1 200 OK

< Date: Wed, 12 Apr 2017 19:40:37 GMT

< Server: Apache/2.4.25 (Unix) PHP/7.1.2

< X-Powered-By: PHP/7.1.2

< Content-Length: 11

< Content-Type: text/html; charset=UTF-8

* Connection #0 to host 10.1.0.3 left intact

* Closing connection #0

hello world



and /test2/


curl -v -X GET http://10.1.0.3:8081/1.0.0/test2/

* About to connect() to 10.1.0.3 port 8081 (#0)

*   Trying 10.1.0.3... connected

* Connected to 10.1.0.3 (10.1.0.3) port 8081 (#0)

> GET /1.0.0/test2/ HTTP/1.1

> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2

> Host: 10.1.0.3:8081

> Accept: */*

< HTTP/1.1 200 OK

< Date: Wed, 12 Apr 2017 19:40:44 GMT

< Server: Apache/2.4.25 (Unix) PHP/7.1.2

< X-Powered-By: PHP/7.1.2

< Content-Length: 13

< Content-Type: text/html; charset=UTF-8

* Connection #0 to host 10.1.0.3 left intact

* Closing connection #0

hello world 2




any help appreciated.  while I'm familiar with using api's and all of my experience is with unix/php for this,  I'm still wrapping my head around endpoints and all the terminology around openapi etc. 





-------------

copy of my updated   openapi.yaml

(its the google sample file with a few changes.  note the /test2/  path was the only addition.)

swagger: "2.0"
info:
  description: "A simple Google Cloud Endpoints API example."
  title: "Endpoints Example"
  version: "1.0.0"
host: "[... my host here ...]"
basePath: "/1.0.0"

consumes:
- "application/json"
produces:
- "application/json"
schemes:
- "http"

paths:
  "/test":
    get:
      description: "Echo back a given message."
      operationId: "echo"
      produces:
      - "application/json"
      responses:
        200:
          description: "Echo"
          schema:
            $ref: "#/definitions/echoMessage"
      security:
      - api_key: []

  "/test2":
    get:
      description: "Echo back a given message."
      operationId: "echo2"
      produces:
      - "application/json"
      responses:
        200:
          description: "Echo"
          schema:
            $ref: "#/definitions/echoMessage"
      security:
      - api_key: []

definitions:
  echoMessage:
    properties:
      message:
        type: "string"

securityDefinitions:
  # This section configures basic authentication with an API key.
  api_key:
    type: "apiKey"
    name: "key"
    in: "query"



D. T.

unread,
Apr 12, 2017, 4:00:00 PM4/12/17
to dougr...@gmail.com, Google Cloud Endpoints
You probably just need to restart ESP on your instance. `sudo service nginx restart`.

Thanks,
Daniel

--
You received this message because you are subscribed to the Google Groups "Google Cloud Endpoints" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-endpoints/4753a500-a191-4e3b-bf3f-16759d18b2c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

dougr...@gmail.com

unread,
Apr 12, 2017, 8:08:30 PM4/12/17
to Google Cloud Endpoints, dougr...@gmail.com
you're right, that was it!
awesome thank you
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-endpoints+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages