Unable to deploy apps

I was able to deploy a remix apps without a hassle yesterday but then i started getting a weird bug, whenever i try to deploy (new app or update an app) i’ve been getting this issue

Wrote config file fly.toml
==> Building image
WARN Failed to start remote builder heartbeat: failed building options: agent: failed to start
Error failed to fetch an image or build from source: error connecting to docker: failed building options: agent: failed to start


The agent failed to start with the following error log:

2023/03/29 16:58:26.964092 srv another instance of the agent is already running

Then on the dashboard on in the apps page i can see the builder, but all i get from its logs is this spammed over and over again

2023-03-29T17:01:27.363 app[*] mad [info] time="2023-03-29T17:01:27.362864226Z" level=debug msg="checking docker activity"

2023-03-29T17:01:27.363 app[*] mad [info] time="2023-03-29T17:01:27.363181531Z" level=debug msg="Calling GET /v1.41/containers/json?filters=%7B%22status%22%3A%7B%22running%22%3Atrue%7D%7D&limit=0"

I tried updating the fly cli, switching to a new account etc, nothing seems to work

It looks like there might be an issue with the agent. You can try upgrading to the latest flyctl (if you aren’t already on latest) and restarting the agent by running fly agent restart or force killing any flyctl processes by running killall flyctl.

If you’re curious, you can check the logs from the agent in ~/.fly/agent-logs/ to see what could be causing the issue.

I’m already on the latest flyctl version, and all agent commands fail

$ fly agent stop   
Error failed dialing agent: agent not running

$ fly agent restart
Error failed establishing connection to agent: agent: failed to start

$The agent failed to start with the following error log:

2023/03/29 17:31:16.645991 srv another instance of the agent is already running


A copy of this log has been saved at /home/[user]/.fly/agent-logs/1213848557.log
$ fly agent ping   
Error failed dialing agent: agent not running

Also there is nothing meaningfull in the logs

$ cat ~/.fly/agent-logs/*.log
2023/03/29 17:31:16.645991 srv another instance of the agent is already running
2023/03/29 16:53:58.422382 srv another instance of the agent is already running
2023/03/29 17:30:07.619219 srv another instance of the agent is already running
2023/03/29 16:53:01.495063 srv another instance of the agent is already running
2023/03/29 16:58:20.092268 srv another instance of the agent is already running
2023/03/29 16:53:51.151729 srv another instance of the agent is already running
2023/03/29 16:58:26.964092 srv another instance of the agent is already running
2023/03/29 16:51:28.721792 srv another instance of the agent is already running
2023/03/29 17:30:54.046334 srv another instance of the agent is already running
2023/03/29 17:29:37.194518 srv another instance of the agent is already running
2023/03/29 16:51:21.567914 srv another instance of the agent is already running

They don’t go far enough because in one of my attempts i deleted the ~/.fly directory and reinstalled fly

I guess you were right, there was some other fly process running which i killed killall fly -9 and then restarted the agent, then everything worked. thank you

Oh! I’m glad it worked :tada:

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