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

starting with just kamal deploy fails (no kamal setup) #538

Open
mcgaw opened this issue Oct 18, 2023 · 6 comments
Open

starting with just kamal deploy fails (no kamal setup) #538

mcgaw opened this issue Oct 18, 2023 · 6 comments

Comments

@mcgaw
Copy link

mcgaw commented Oct 18, 2023

I've manually installed the pre-requisites on the target machine. An initial deploy fails due to a missing .env file it seems:

  INFO [392febf3] Running docker container start traefik || docker run --name traefik --detach --restart unless-stopped --publish 80:80 --volume /var/run/docker.sock:/var/run/docker.sock --env-file .kamal/env/traefik/traefik.env --log-opt max-size="10m" traefik:v2.9 --providers.docker --log.level="DEBUG" on vagrant-box
Releasing the deploy lock...
  Finished all in 16.9 seconds
  ERROR (SSHKit::Command::Failed): Exception while executing on host vagrant-box: docker exit status: 125
docker stdout: Nothing written
docker stderr: Error response from daemon: No such container: traefik
Error: failed to start containers: traefik
docker: open .kamal/env/traefik/traefik.env: no such file or directory.
See 'docker run --help'.

It's remedied by executing the setup command first (which is in itself oddly named and I wouldn't expect it to deploy anything). However the docs state that it should not be necessary to run this step. Personally I'm not convinced the server setup should be conflated with the tool itself, but that's a digression.

@Matic
Copy link

Matic commented Oct 28, 2023

I agree, lost quite a bit of time before I figured out that if I add additional server roles or accessories I need to run setup again.

@jmarchello
Copy link

jmarchello commented Nov 5, 2023

Someone correct me if I'm wrong but I believe running kamal env push creates the requisite directories on the remote server.

Also you can use kamal server bootstrap to set up the servers without deploying.

@Matic
Copy link

Matic commented Nov 6, 2023

kamal env push creates the env directories and pushes the distilled .env files for each container as far as I understand. However when I added a new accessory, a simple deploy didn't work. Maybe it was related to something else. When I nuked everything and retried with setup then everything started working.

@mpolakis
Copy link

Thank you

@dihmeetree
Copy link

dihmeetree commented Jun 9, 2024

Also ran into this issue. The docs make it seem that you only need to do kamal setup and everything will work, however I do get this same error when I do the setup step only.

It looks like kamal env push does fix this issue (if you do it before the setup step)

Can someone confirm that this is required? Should the docs be updated? Or is this a bug?

@dbackeus
Copy link

dbackeus commented Jun 12, 2024

I ran into this error even though the only command I had been running was kamal setup (as advertised in https://kamal-deploy.org/docs/installation/).

I had to explicitly run kamal env push to pass this step.

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

6 participants