"authentication required" from docker build when running fly launch

Hi, I’m running fly launch on my Phoenix project using all the fly defaults in my docker file, but it’s failing with the following error:

Error error building: failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to do request: Head "https://registry-1.docker.io/v2/hexpm/elixir/manifests/1.13.3-erlang-22.3.4.10-debian-bullseye-20210902": dial tcp 54.210.12.153:443: i/o timeout

The BUILDER_IMAGE I’m using in the Dockerfile is ARG BUILDER_IMAGE="hexpm/elixir:1.13.3-erlang-22.3.4.10-debian-bullseye-20210902", which is the default fly gives me. When I click the link provided by the error, it shows me this json:

{"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"repository","Class":"","Name":"hexpm/elixir","Action":"pull"}]}]}

I’ve tried running fly auth login, and a few different build image s, but I always get the same error. Let me know if you have any ideas!

Update: I tried running with LOG_LEVEL=debug, and I now see:

Error error building: failed to solve with frontend dockerfile.v0: failed to read downloaded context: failed to load cache key: write /data/docker/overlay2/mpjhtxip3idboo153r0pg4ob2/diff/context: no space left on device

It looks like your remote builder ran out of disk space. This is a known issue we’re working on, you can get around by by running:

fly apps destroy <name-of-builder>

Your deploy log should show you the builder name, it’s something like fly-builder-*.

The original io timeout may or may not have been related.

Thanks, but still can’t get it to work. I got further this time, but now I get:

DEBUG <-- 200 https://api.fly.io/graphql (369.33ms) {"data":{"app":{"deploymentStatus":{"id":"a2654071-6a2a-78c1-de07-2ed2d98c76db","inProgress":false,"status":"failed","successful":false,"description":"Failed due to unhealthy allocations - no stable job version to auto revert to","version":0,"desiredCount":1,"placedCount":1,"healthyCount":0,"unhealthyCount":1,"allocations":[{"id":"d92ec00f-2a98-1e6e-0f27-af55a92f87d5","idShort":"d92ec00f","status":"running","region":"ewr","desiredStatus":"run","version":0,"healthy":false,"failed":false,"canary":false,"restarts":2,"checks":[{"status":"warning","serviceName":"tcp-8080"}]}]}}}}
***v0 failed - Failed due to unhealthy allocations - no stable job version to auto revert to and deploying as v1 

That means either the process is crashing, or the health checks are failing.

If you run fly status --all you’ll get a list of running or failed instances. fly vm status <id> will give you more details about health checks and exit codes.

If this is a Phoenix app that you created before version 1.6.4, you’ll need to make sure you’ve changed a bunch of config files to get things listening on the right IPs and configured to connect to Postgres. That’s all documented here: Deploy an Elixir Phoenix Application (pre v1.6.3)

Thanks @kurt, that solved the issue for me. I have a different issue now but I’ll post that in a separate thread. Thanks!