GoogleCloudPlatform / go-endpoints

Cloud Endpoints for Go
https://go-endpoints.appspot.com
Apache License 2.0
255 stars 56 forks source link

Unexpected configuration Error #123

Closed dusano closed 8 years ago

dusano commented 8 years ago

In my application requests to the backend intermittently fail with the error:

SPI request body: {"messages":[{"message":"Endpoints: https://1-dot-api-dot-squrb-v2.appspot.com/_ah/api/squrb@v2.0 ERROR: com.google.api.server.core.config.ApiStartupException: API https://1-dot-api-dot-squrb-v2.appspot.com/_ah/api/squrb@v2.0(https://1-dot-api-dot-squrb-v2.appspot.com/_ah/api/squrb@v2.0): Unexpected configuration Error: Unknown value type: null.\n Root Configuration File: mem:///aHR0cHM6Ly8xLWRvdC1hcGktZG90LXNxdXJiLXYyLmFwcHNwb3QuY29tL19haC9hcGkvc3F1cmJAdjIuMA.","level":"error"}]}

This has only started to happen a few days ago. The application was working just fine for several months before. Is there something specific to my app or has something changed in Google Cloud recently.

Any info will be very appreciated.

dusano commented 8 years ago

After a day of debugging I managed to solve the issue. The problem was that one of the data structures I'm returning in my api had map[string]int. Once I replaced this structure with an array, the problems have disappeared. It seems endpoints have issues with maps.

Better diagnostics and logging messages would definitely help in solving this issue much faster.

aneshas commented 8 years ago

@dusano Dusan you are a life saver, you just saved me days of debugging. I had one of my struct fields defined as interface{}. I agree the error message is undescriptive, and there is inconsistency between the dev server and the production. I had no errors on the dev server, only in production.

dusano commented 8 years ago

👍 :)