Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fedora docker daemon not running on kamal deploy #1201

Open
acetousk opened this issue Nov 7, 2024 · 4 comments
Open

Fedora docker daemon not running on kamal deploy #1201

acetousk opened this issue Nov 7, 2024 · 4 comments

Comments

@acetousk
Copy link

acetousk commented Nov 7, 2024

On a fresh fedora instance, and a working kamal project, I ran

kamal init

Updated config/deploy.yml to my docker hub repo / user
Set working KAMAL_REGISTRY_PASSWORD
After running

kamal setup

I get

  Finished all in 302.2 seconds
Releasing the deploy lock...
  Finished all in 303.1 seconds
  ERROR (SSHKit::Command::Failed): Exception while executing on host myip: docker exit status: 1
docker stdout: Nothing written
docker stderr: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Then to continue using kamal I have to manually ssh into my machine and run the following to keep docker running despite restarts

systemctl start docker
systemctl enable docker

Problem: Should have started the docker daemon automatically upon install for future commands to work

@fidalgo
Copy link

fidalgo commented Nov 7, 2024

ERROR (SSHKit::Command::Failed): Exception while executing on host myip: docker exit status: 1

The error seems to be related with SSH not docker, are you able to SSH into the machine?

@acetousk
Copy link
Author

No ssh works fine because when I ran into the same problem again, the only way to fix it was to ssh into the server and run the systemctl commands above. Then the ssh worked fine

I believe that message means that the docker service exit with a status of 1 because the docker service wasn't running.

@fidalgo
Copy link

fidalgo commented Nov 12, 2024

Ah ok I see your point. You should remember that Kamal is a deployment tool, not a system configuration. Not sure if this is the responsibility of Kamal (I'm just a regular user), because those commands are not universal in Linux, so Kamal would have to query for the OS and then run the adequate commands to enable docker daemon at startup.
In my case, I installed everything I need and secured the system and then used kamal to deploy and run the containers.

@acetousk
Copy link
Author

acetousk commented Nov 13, 2024

I understand that it's not a system configuration, but it says that all you need to do is point to an ip you can access over ssh, and it'll install docker and do the rest of the deployment.

When kamal installs docker (see below) on debian and ubuntu, docker will automatically start the docker daemon post install. However because fedora and rhel by default don't start the docker daemon, it would be an impactful low hanging fruit change to just start the docker daemon with systemctl if it isn't started.

kamal setup
  INFO [cc2b9321] Running /usr/bin/env mkdir -p .kamal on myip
  INFO [cc2b9321] Finished in 0.817 seconds with exit status 0 (successful).
Acquiring the deploy lock...
warning: could not open directory 'db/postgres/data/': Permission denied
Ensure Docker is installed...
  INFO [29053175] Running docker -v on myip
  INFO [29053175] Finished in 0.124 seconds with exit status 127 (failed).
  INFO [b5c933cb] Running [ "${EUID:-$(id -u)}" -eq 0 ] || command -v sudo >/dev/null || command -v su >/dev/null on myip
  INFO [b5c933cb] Finished in 0.131 seconds with exit status 0 (successful).
  INFO Missing Docker on myip. Installing…
  INFO [63679fdf] Running /usr/bin/env sh -c 'curl -fsSL https://get.docker.com || wget -O - https://get.docker.com || echo "exit 1"' | sh on myip
  INFO [63679fdf] Finished in 43.739 seconds with exit status 0 (successful).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants