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

**URL:** <https://community.fly.io/t/flyctl-deploy-you-hit-a-fly-api-error-with-request-id/7464>\
**Category:** General\
**Created:** [September 27, 2022, 4:54am UTC](https://community.fly.io/t/flyctl-deploy-you-hit-a-fly-api-error-with-request-id/7464 "2022-09-27T04:54:28Z")\
**Posts on this page:** 1\
**Showing post:** 57

<div class="post-metadata">

**Author:** ![dilraj](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/dilraj/32/12781_2.png) [@dilraj](https://community.fly.io/u/dilraj)\
**Post date:** [July 11, 2023, 3:56pm UTC](https://community.fly.io/t/flyctl-deploy-you-hit-a-fly-api-error-with-request-id/7464/57 "2023-07-11T15:56:23Z")

</div>

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:

```auto
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](https://stackoverflow.com/a/68258603/6484367).

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](https://www.docker.com/products/docker-desktop/). 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:

```auto
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:

```auto
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:

- [Failed to start remote builder heartbeat - #6 by rolznz](https://community.fly.io/t/failed-to-start-remote-builder-heartbeat/10397/6)
- [Dashboard error: You hit a Fly API error with request ID - #8 by rugwiro](https://community.fly.io/t/dashboard-error-you-hit-a-fly-api-error-with-request-id/7900/8)

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

---

_[View the full topic](https://community.fly.io/t/flyctl-deploy-you-hit-a-fly-api-error-with-request-id/7464)._
