failed to fetch builder image when deploying ruby example

Hi
trying to follow ruby guide, cloned sample repo, flyctl auth login , next when trying to flyctl launch, I am getting output below. Are docs outdated?

❯ flyctl launch
An existing fly.toml file was found for app ruby
? Would you like to copy its configuration to the new app? Yes
Creating app in /Users/<...>/helloruby-builtin
Scanning source code
Detected a Ruby app
Using the following build configuration:
	Builder: heroku/buildpacks:20
? App Name (leave blank to use an auto-generated name): <....>
Automatically selected personal organization: <.....>
? Select region: sjc (Sunnyvale, California (US))
Created app fragrant-waterfall-1630 in organization personal
Wrote config file fly.toml
? Would you like to deploy now? Yes
Deploying fragrant-waterfall-1630
==> Validating app configuration
--> Validating app configuration done
Services
TCP 80/443 ⇢ 8080
Remote builder fly-builder-misty-morning-358 ready
==> Building image with Buildpacks
--> docker host: 20.10.12 linux x86_64
Error failed to fetch builder image 'index.docker.io/heroku/buildpacks:20': 
  resolve auth for ref index.docker.io/heroku/buildpacks:20: 
  error getting credentials - err: exec: "docker-credential-ecr-login": 
  executable file not found in $PATH, out: ``

Same problem here with numerous Rails apps I tried to deploy:

--> docker host: 20.10.12 linux x86_64
Error failed to fetch builder image 'index.docker.io/heroku/buildpacks:20': resolve auth for ref index.docker.io/heroku/buildpacks:20: error getting credentials - err: exec: "docker-credential-desktop": executable file not found in $PATH, out: ``

Looks like the remote builder is failing to pull from dockerhub, this thread could be helpful: I cannot deploy - #24 by kurt

I think this is a different error.

@soap @vittore I’m not sure why this would suddenly be required. We can add docker-credential-ecr-login to our remote builders, but it shouldn’t be needed. This is accessing a docker image on docker hub and shouldn’t require Amazon ECR credentials.

I’m investigating. My first guess is this is a weird and new issue with Docker Hub.

1 Like

Seeing this presently as well, with the go-example app:

Deploying proud-sky-462
==> Validating app configuration
--> Validating app configuration done
Services
TCP 80/443 ⇢ 8080
Remote builder fly-builder-cool-sea-7453 ready
==> Building image with Buildpacks
--> docker host: 20.10.12 linux x86_64
Error failed to fetch builder image 'index.docker.io/paketobuildpacks/builder:base': resolve auth for ref index.docker.io/paketobuildpacks/builder:base: error getting credentials - err: exec: "docker-credential-desktop": executable file not found in $PATH, out: ``

Was a bit of an odyssey but got this sorted.

I don’t have docker installed on this machine but at some point I ended up with a ~/.docker/config.json. It includes "credsStore" : "desktop" at the top level and since the buildpack machinery that drives docker runs locally it was trying to call docker-credential-desktop.

Moving that bogus config out of the way got it going.

9 Likes

Hi @danp Thank you so much!

Your solution solve my problem. There is leftover ~/.docker folder on my machine. Deleting it make the problem dissapear.

This is a good thing to have on FAQ.

6 Likes

rm -rf ~/.docker FTW!

I also saw errors on my local machine “without Docker” (but with ~/.docker dir of unknown origin):

% flyctl version
flyctl v0.0.388 darwin/arm64 Commit: e1708e5f BuildDate: 2022-09-06T21:32:49Z

% flyctl deploy --remote-only
...
Error failed to fetch builder image 'index.docker.io/heroku/buildpacks:20': resolve auth for ref index.docker.io/heroku/buildpacks:20: error getting credentials - err: exec: "docker-credential-desktop": executable file not found in $PATH, out: ``

Deleting the ~/.docker directory fixed it. Thanks!

2 Likes

Fixed my issue as well! Thank you!