RmR
RmR

Reputation: 2283

Google Cloud Endpoints using Google Cloud Run Error: could not handle the request

I have setup Google Cloud endpoints (open-api.yaml) that points to Google Functions. I have created the API Gateway server using Google Cloud Run. I tested the same and found it working.

After doing some update in the YAML and Google Functions I now get an Error: could not handle the request. It is a server 500 error. The YAML file is as follows:

swagger: '2.0'
info:
  title: API gateway
  description: Gateway on Cloud Endpoints with a Google Cloud Functions backend
  version: 1.0.0
host: xxxx-service-abcd-uc.a.run.app
schemes:
  - https
produces:
  - application/json
paths:
  /auth/signup:
    post:
      summary: Create a new user
      operationId: authSignup
      x-google-backend:
        address: https://us-central1-project-id.cloudfunctions.net/api-auth-function
        path_translation: APPEND_PATH_TO_ADDRESS
      responses:
        '200':
          description: A successful response
          schema:
            type: string
  /auth/login:
    post:
      summary: Logs in an existing user
      operationId: authLogin
      x-google-backend:
        address: https://us-central1-project-id.cloudfunctions.net/api-auth-function
        path_translation: APPEND_PATH_TO_ADDRESS
      responses:
        '200':
          description: A successful response
          schema:
            type: string
  /auth/check:
    get:
      summary: check
      operationId: authCheck
      x-google-backend:
        address: https://us-central1-project-id.cloudfunctions.net/api-auth-function
        path_translation: APPEND_PATH_TO_ADDRESS
      responses:
        '200':
          description: A successful response
          schema:
            type: string

When I call the url: https://xxx--service-abcd-uc.a.run.app/auth/login with a post call from Postman or https://xxxx-service-abcd-uc.a.run.app/auth/check with a get call from Postman or the browser I get this error.

The logs on Google Cloud Run merely have entries like:

GET 500 700 B 184 msChrome 79 https://xxxx-service-abcd-uc.a.run.app/auth/check or

POST 500 622 B 99 PostmanRuntime/7.22.0 https://xxxx-service-abcd-uc.a.run.app/auth/login

Since it was earlier working, there must be some silly error that I am not able to detect. Thanks for any help.

Upvotes: 1

Views: 765

Answers (1)

RmR
RmR

Reputation: 2283

I deleted the Google Run service and recreated it with simple API paths and it seems to work.

Upvotes: 3

Related Questions