Unable to deploy new Rails Application

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.

What region are you in?

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).

One last thing to suggest is to try https://fly.io/terminal - click on “Launch Web CLI” in the lower left. See Introducing fly.io/terminal - #2 by rubys for the app I would suggest… you can copy/paste those lines directly into the terminal.

I’m pretty close to Amsterdam. But I’ve tried different ones (deleting everything every time) Stockholm and last one I tried US dfw, just in case.

Gonna try the /terminal you recommended.

I’ve ran into a different issue using /terminal:

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.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.