Deploy via Zip API is stuck

My deploys for creative-maamoul-4bc7b8 are getting stuck when I use the Zip REST API. There are no logs to share, because the “Deploy log” screen is just a single spinner, spinning infinitely until I cancel the deploy. I’ve let some deploys run for hours with no change in the process. After canceling, nothing is available in the logs to help me figure out what went wrong.

Some background info:

I am using a container to automate my build process. The final step is to zip up my public directory (zip –recurse-paths public.zip public), then upload to Netlify using this curl command:

curl \
    --request POST \
    --header "Authorization: Bearer {{ netlify_auth }}" \
    --header "Content-Type: application/zip" \
    --data-binary "@public.zip" \
    "https://api.netlify.com/api/v1/sites/{{ site_id }}/deploys?title={{ title }}"

When I step through all of the steps individually on my host machine, the deploy is published as expected. However, when run from my container, it gets stuck. This is true regardless of what machine hosts the container, which of course leads me to believe that something is wrong in the container itself. Double however, this container used to work just fine, and the command hasn’t changed (other than moving from a shell script to a justfile to run commands).

Manually uploading the Zip file created by the container results in a successful deploy.

Is there any way I could get a look at some logs around my failed deploys? I’m running out of ideas to track down this bug on my end, and it’s been plaguing me for a couple of days now.

Can you share an example zip that you’re trying to upload via API?

Sure thing: https://user.fm/files/v2-315c1cbebce4ccb439ec8aab9538b2ed/creative-maamoul-4bc7b8.zip

This file was uploaded via the container this morning at 4:00AM (America/New_York). I just deployed it via drag-and-drop to a separate project (inquisitive-alfajores-f96851), and it published just fine.

Hm… I tried using curl from my local machine for that zip and it worked fine as well (just like you mentioned). Command I used:

curl --data-binary "@<path-to-file>" -D - -H "authorization: Bearer <token>" -H "content-type: application/zip" "https://api.netlify.com/api/v1/sites/<site-id>/deploys"

What kind of a container are you using? Have you ensured the path to the file is correct? Maybe try using an absolute path from the root of the file system?

I just figured out the problem, and it’s with the {{ netlify_auth }} variable I’m using. It had an extra newline after the key, which I only just noticed in the output from the curl command. That extra newline was enough to throw something off, even though the API request returned a 200.

Argh! Chalk it up to PEBKAC.