Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 BUG: Wrangler randomly throws "Received a malformed response from the API" when publishing pages #2794

Open
aswinkp opened this issue Feb 24, 2023 · 6 comments
Labels
api bug Something that isn't working pages Relating to Pages

Comments

@aswinkp
Copy link

aswinkp commented Feb 24, 2023

Which Cloudflare product(s) does this pertain to?

Wrangler

What version of Wrangler are you using?

2.1.13

What operating system are you using?

Linux

Describe the Bug

I often come across this error when running wrangler. Maybe some problem with the API I guess, but there is so consistency that I can find. When I run the same command once again, it executes smoothly without any issues.

Command:
CLOUDFLARE_ACCOUNT_ID=XXXX CLOUDFLARE_API_TOKEN=XXXX wrangler pages publish public --commit-dirty=true --project-name=XXXX --branch main

Error:

✘ [ERROR] Received a malformed response from the API <!DOCTYPE html>  <!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en-US\"> <![endif]-->  <!--[if I... (length = 6510)  GET /accounts/XXXX/pages/projects/XXXX/upload-token -> 502 Bad Gateway
@aswinkp aswinkp added the bug Something that isn't working label Feb 24, 2023
@penalosa penalosa added the pages Relating to Pages label Feb 24, 2023
@jahands
Copy link
Contributor

jahands commented Apr 3, 2023

I've gotten this error as well. We should add retries to this API call (as well as POST /deployments if it doesn't already)

@jakubadamw
Copy link

jakubadamw commented Jun 30, 2023

We've been seeing these a lot in our CI. Also, a lot of 504s such as:

POST /zones/{REDACTED}/workers/routes -> 504 Gateway Time-out

Could we have wrangler retry on these errors, please? Could be configurable, if necessary.

@alexanderglueck
Copy link

We are experiencing the same issue on a different route:

GET /accounts/[MASKED]/pages/projects/[project-slug] -> 504 Gateway Time-out

We are using the npx wrangler pages deploy dist --project-name [PROJECT-NAME] --branch staging command to deploy to Cloudflare pages.

@hellt
Copy link

hellt commented Oct 9, 2023

Started to see this today as well.

@thdoan
Copy link

thdoan commented Nov 2, 2023

Ditto. Seems like a recent issue because I was deploying a few weeks ago with no issues. I get an error no matter what command I use. Example:

$ wrangler whoami
 ⛅️ wrangler 3.15.0
-------------------
Getting User settings...

✘ [ERROR] Received a malformed response from the API

  <!DOCTYPE html>
  <!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
  <!--[if I... (length = 7178)

  GET /user -> 524

  If you think this is a bug, please open an issue at:
  https://github.com/cloudflare/workers-sdk/issues/new/choose

@jakubadamw
Copy link

Ditto. Seems like a recent issue because I was deploying a few weeks ago with no issues. I get an error no matter what command I use. Example:

$ wrangler whoami
 ⛅️ wrangler 3.15.0
-------------------
Getting User settings...

✘ [ERROR] Received a malformed response from the API

  <!DOCTYPE html>
  <!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
  <!--[if I... (length = 7178)

  GET /user -> 524

  If you think this is a bug, please open an issue at:
  https://github.com/cloudflare/workers-sdk/issues/new/choose

Please note there is an ongoing incident with a downgrade in availability of the Cloudflare API, which might be causing these failures at this particular time.

@emily-shen emily-shen added the api label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api bug Something that isn't working pages Relating to Pages
Projects
None yet
Development

No branches or pull requests

8 participants