Getting invalid json response body error again

This is happening again. I know the workaround is to redeploy, but can you guys please fix the underlying issue that causes this to occur?

Several other users have also had this issue previously according to Slack search

Hello @better_mockingbird. From what I can see here, the requests that failed were missing the API token. Did you manage to make it work?

(Hi @better_mockingbird, this is just a generic error message, so the underlying cause tends to be different each time.)

What would cause the API token to be dropped? Re-validation does work for a long time, but occasionally hits this issue. When it starts giving that error though, I have to redeploy to fix it.

@uniform_carp The error seems like a bug to me. The response from Plasmic’s API is expected to be JSON, but it isn’t. So the exception is thrown when trying to parse it as JSON.

The ideal situation would be that the error message actually tells the user that the API token has expired, right?

@better_mockingbird I actually agree - we were just discussing changing the format of our errors on Fri

Will follow up with @icaro on why we think the API token is missing - the way you’re describing it (redeploying fixes it) does make it sound like a bug, and they should not be expiring…

I’ll also check on my end that re-validation is working as expected after a fresh deploy

Thanks

@better_mockingbird Are you still experiencing this error?

I haven’t seen a regression as yet. Were there any changes pushed out on your end?

Now we’re getting the following error:

FetchError: request to <https://codegen.plasmic.app/api/v1/loader/code/versioned?cb=12&platform=nextjs&loaderVersion=5&projectId=4oePdgY6VCnvZ6K6n5P4Sx%4029.2.23> failed, reason: read ECONNRESET

First failed at 2022-08-16T08:19:50.189Z

Only 10 minutes earlier the Plasmic API was giving a 429 response

It was then able to revalidate 3 times before the ECONNRESET failure

After which, every single request failed with this error

do you have logs you can paste where you see the 429?

Sorry I don’t at the moment