flyctl deploy: You hit a Fly API error with request ID...

Just a follow-up! I began look into Docker as a possible root-cause. When I was running:

docker build -t spg2 .

I started seeing an error:

Step 5/12 : RUN gem install bundler &&     bundle config set path 'vendor/bundle' &&     bundle config set deployment 'true' &&     bundle install --jobs=4 --without development test
 ---> Running in 110e7fa1fca8
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/local/bundle directory.
	/usr/local/lib/ruby/3.2.0/rubygems/installer.rb:712:in `verify_gem_home'
	/usr/local/lib/ruby/3.2.0/rubygems/installer.rb:902:in `pre_install_checks'
	/usr/local/lib/ruby/3.2.0/rubygems/installer.rb:302:in `install'
	/usr/local/lib/ruby/3.2.0/rubygems/resolver/specification.rb:104:in `install'
	/usr/local/lib/ruby/3.2.0/rubygems/request_set.rb:194:in `block in install'
	/usr/local/lib/ruby/3.2.0/rubygems/request_set.rb:182:in `each'
	/usr/local/lib/ruby/3.2.0/rubygems/request_set.rb:182:in `install'
	/usr/local/lib/ruby/3.2.0/rubygems/commands/install_command.rb:214:in `install_gem'
	/usr/local/lib/ruby/3.2.0/rubygems/commands/install_command.rb:230:in `block in install_gems'
	/usr/local/lib/ruby/3.2.0/rubygems/commands/install_command.rb:223:in `each'
	/usr/local/lib/ruby/3.2.0/rubygems/commands/install_command.rb:223:in `install_gems'
	/usr/local/lib/ruby/3.2.0/rubygems/commands/install_command.rb:169:in `execute'
	/usr/local/lib/ruby/3.2.0/rubygems/command.rb:323:in `invoke_with_build_args'
	/usr/local/lib/ruby/3.2.0/rubygems/command_manager.rb:251:in `invoke_command'
	/usr/local/lib/ruby/3.2.0/rubygems/command_manager.rb:191:in `process_args'
	/usr/local/lib/ruby/3.2.0/rubygems/command_manager.rb:149:in `run'
	/usr/local/lib/ruby/3.2.0/rubygems/gem_runner.rb:51:in `run'
	/usr/local/bin/gem:10:in `<main>'
The command '/bin/sh -c gem install bundler &&     bundle config set path 'vendor/bundle' &&     bundle config set deployment 'true' &&     bundle install --jobs=4 --without development test' returned a non-zero code: 1

I never seen this before; afterall, I’ve deployed and built the Docker container before.

Updating Docker

After debugging for hours, I tried ugprading Docker as suggested on Stackoverflow here.

For whatever reason, you can’t go to Docker Desktop > Check For Updates. That does NOT work.

Instead, I had to manually reinstall it from the Docker website. Before, I was on 19.x, now I am on Docker version 24.0.2, build cb74dfc

Running Docker Build

Now, I can run: docker build -t spg2 . and do docker run -p 3000:80 -e RAILS_ENV=development -e PORT=3000 spg2

I thought this would fix the:

Error: failed to fetch an image or build from source: error connecting to docker:
You hit a Fly API error with request ID: XYZ

But it DID not fix anything.

fly doctor

Everything checks out and looks good here:

fly doctor
Testing authentication token... PASSED
Testing flyctl agent... PASSED
Testing local Docker instance... Nope
Pinging WireGuard gateway (give us a sec)... PASSED

App specific checks for spg:
Checking that app has ip addresses allocated... Nope
	No ip addresses assigned to this app. If the app is not intended to receive traffic, this is fine.
	Otherwise, it likely means that the services configuration is not correctly setup to receive http, tls, tcp, or udp traffic.
	https://fly.io/docs/reference/configuration/#the-services-sections
No ipv4 or ipv6 ip addresses allocated to app spg
Build checks for spg:
Checking docker context size (this may take little bit)... PASSED (76 MB)
Checking for .dockerignore... PASSED

Final Thoughts

Nothing worked.

I am pretty sure it is something on Fly’s side from what I can see from other conversations:

Going to email billing@fly.io or get help on Twitter.