There seems to be a mismatch between last deployed API and actually in-use API

1,057 views
Skip to first unread message

Raffael

unread,
Jul 7, 2019, 3:06:26 PM7/7/19
to Google Cloud Endpoints
According to Google Cloud Console > Endpoints > Services > Deployment History this is the currently deployed API spec:

swagger: "2.0"
info
:
  title
: "JSON Ingester"
  description
: "Receive JSON files, transform and load them."
  version
: "1.0.0"

host
: "project-id-123.appspot.com"
schemes
:
 
- "https"

paths
:
 
"/upload":
    post
:
      summary
: "ETL JSON file."
      security
:
       
- api_key: []
      operationId
: "upload"
      consumes
:
       
- multipart/form-data
      parameters
:
       
- in: formData
          name
: file
          type
: string
      responses
:
       
200:
          description
: "File uploaded."
          schema
:
            type
: string
       
400:
          description
: "Error during file upload."

securityDefinitions
:
  api_key
:
    type
: "apiKey"
    name
: "apikey"
   
in: "query"


But the key "apikey" is not accepted - instead it requires "key" which was specified in an openapi.yaml that I deployed few hours ago.

This works while it shouldn't:

$ curl -X POST -F "file=@data/file_6.json" https://project-id-123.appspot.com/upload\?key\=AIzaS...Eaoog


And this doesn't work while it should:

$ curl -X POST -F "file=@data/file_6.json" https://project-id-123.appspot.com/upload\?apikey\=AIzaS...Eaoog
{
 
"code": 16,
 
"message": "Method doesn't allow unregistered callers (callers without established identity). Please use API Key or other form of API consumer identity to call this API.",
 
"details": [
 
{
   
"@type": "type.googleapis.com/google.rpc.DebugInfo",
   
"stackEntries": [],
   
"detail": "service_control"
 
}
 
]
}


Do I have to clear a cache or something?

For deploying the API I use:

gcloud endpoints services deploy "./openapi.yaml"

Any ideas?

Qiwen Zhang

unread,
Jul 8, 2019, 2:26:31 PM7/8/19
to Google Cloud Endpoints
What rollout strategy are you using?  If you use "managed" strategy,  the newly deployed service will be applied.  If you use ESP, there is a flag for you to set the option.  Unfortunately the default is not "managed" 

Thanks
-Wayne
Reply all
Reply to author
Forward
0 new messages