Hi. When I deploy a site as a ZIP file, I’m getting request timeouts — most of the time. Once in a while, it works, but rarely. I get the same result with PUT and PATCH. Deploy works when I drag the ZIP file onto the deploy page. I’ve only just started using the API to deploy, so I can’t say if this is new behaviour.
I’d appreciate some help here, thanks.
> curl --retry 5 -vH "Content-Type: application/zip" \
-H 'Authorization: Bearer [BEARER_REMOVED]' \
--data-binary "@build/build.zip" \
https://api.netlify.com/api/v1/sites/602d845d06370a4f4a5c5523--hire123.netlify.app/deploys
[…]
> POST /api/v1/sites/602d845d06370a4f4a5c5523--hire123.netlify.app/deploys HTTP/2
> Host: api.netlify.com
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Type: application/zip
> Authorization: Bearer [BEARER_REMOVED]
> Content-Length: 171324
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
* We are completely uploaded and fine
< HTTP/2 408
< content-type: text/html; charset=UTF-8
< referrer-policy: no-referrer
< content-length: 279
< date: Wed, 17 Feb 2021 21:48:03 GMT
< alt-svc: clear
<
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>408 Request Timeout</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Request Timeout</h1>
<h2>Your client has taken too long to issue its request.</h2>
<h2></h2>
</body></html>
When I PUT or PATCH, I use the API URL without the trailing ‘/deploys’, eg.
> curl --retry 5 -X PUT -vH "Content-Type: application/zip" \
-H 'Authorization: Bearer [BEARER_REMOVED]' \
--data-binary "@build/build.zip" \
https://api.netlify.com/api/v1/sites/602d845d06370a4f4a5c5523--hire123.netlify.app
[…]
> PUT /api/v1/sites/602d845d06370a4f4a5c5523--hire123.netlify.app HTTP/2
> Host: api.netlify.com
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Type: application/zip
> Authorization: Bearer [BEARER_REMOVED]
> Content-Length: 171324
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
* We are completely uploaded and fine
< HTTP/2 408
< content-type: text/html; charset=UTF-8
< referrer-policy: no-referrer
< content-length: 279
< date: Wed, 17 Feb 2021 22:06:18 GMT
< alt-svc: clear
<
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>408 Request Timeout</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Request Timeout</h1>
<h2>Your client has taken too long to issue its request.</h2>
<h2></h2>
</body></html>