I’m trying to deploy a new rails app (my first one on fly.io), I’m following the docs. But the fly deploy command is failing for me since Monday. This is the following error:
$ fly deploy
==> Verifying app config
--> Verified app config
==> Building image
Remote builder fly-builder-dry-tree-179 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 804.6s (0/1)
=> [internal] load remote build context 804.6s
[+] Building 815.8s (1/1) FINISHED
Error failed to fetch an image or build from source: error building: error during connect: Post "http://[redacted_ip_v6]:2375/v1.41/build?buildargs=null&buildid=upload-request%redacted&cachefrom=null&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=&labels=null&memory=0&memswap=0&networkmode=&rm=0&shmsize=0&target=&ulimits=null&version=2": write unix ->/Users/stulzer/.fly/fly-agent.sock: write: broken pipe
Unsure what it is, but and can be potentially some sort of timeout? It supposedly finished, but when I try fly open it states it wasn’t deployed yet.
$ fly open
Error app has not been deployed yet. Please try deploying your app first
No clue what’s going one.
What I’ve tried so far.
Deleted everything on the dashboard, used fly launch again. Didn’t worked.
Tried different regions, closer and far. Still didn’t worked.
Anyone have any idea? Is a super small app, one table, just for test fly.io.
If you have deleted everything on your dashboard, including the builder, you have already done what I would have suggested first.
If you have a super small app, that likely would mean that my next suggestion wouldn’t help (I’ll bet the app I would suggest is smaller, but it probably doesn’t make a difference).
Resolving dependencies...
Don't run Bundler as root. Installing your bundle as root will break this application for all non-root users on this machine.
Your Ruby version is 2.7.4, but your Gemfile specified 3.2.1
Error Failed to install dockerfile-rails gem, exiting: exit status 18
Downgraded ruby (feelsbad). Had to manually install libpq-dev, had to change some yarn stuff, had to manually add the deploy files later on the git repo. But in the end I managed to deploy it.
Problem now is that every time I need to deploy, I have to do it via /terminal because for me locally it timeout.
I’m not an expert on networking, perhaps others can help; but I can provide some context.
At this point we are dealing with three virtual machines: your app, your builder, and your terminal. You can control where your app is ultimately deployed but that’s not the problem here. The problem is that you can’t get to your builder. Both your builder and terminal are created close to you. It seems odd that you can get to your terminal, and it can get to your builder, but you can’t get to your builder.
Should your code be on GitHub, another alternative would be to create a GitHub action which will automatically deploy when you merge code into the main branch:
FYI: you can use rvm or rbenv to install newer versions of Ruby on the terminal, but clearly the goal is to get you able to develop on your machine.