I’ve only been on fly a few weeks. I haven’t had an issue with rails console, but all of a sudden fly ssh console --pty -C "/rails/bin/rails console" ends up with a Error: ssh shell: wait: remote command exited without exit status or exit signal. Bizarre. I’ve followed setup and everything on this page: Running Tasks & Consoles · Fly Docs … any advice?
I’ve had this issue a couple of times in the past month and suspected of either some network instability that drops the connection (perhaps in my local internet provider) or the fly machines are shutting down.
I’ve noticed that every time fly machines list were in stopped state, I could not connect it.
So, sometimes I open the app in the browser and run the rails fly:console.
A week or so ago, I’ve bumped up the machine to performance-1 and disabled the auto stop/start (ref: Fly Launch configuration (fly.toml) · Fly Docs) (DISCLAIMER: at a cost of extra machine time and so extra $) and rails fly:console worked every time.
Looking back now I suspect it may have been the auto_stop/start.
That may work, and I’ll try it later today, but the docs are still not accurate or something is wrong with my account/setup. But… it used to work. That’s the weird thing. @rubys any help?
I’m not sure I have much to add here. The message you would have received if the machines were shut down is:
Error: app <appname> has no started VMs
If you are not using a volume (generally this means that you are using postgres rather than sqlite3), then give the following a try:
fly console
Otherwise, try fly ssh console with no parameters, and then from there try running /rails/bin/rails console to see if you can get any more information. Perhaps you are running out of memory? If so, take a look at Dockerfiles and fly.toml · Fly Docs.
Finally, see if there is anything useful in your logs.
Worked. That did it. I’m not sure why I didn’t try that, but I also had no idea it could be that simple (and yes, it’s postgres, setup through the fly launch process). There was nothing in the logs which was equally as strange. And our memory usage is low and I even gave it an extra gig of ram a week or so ago just to make sure I’d be in the clear. Our metrics/graphs all look good. But… anyway, fly console worked. Thanks.