basecamp / kamal

Deploy web apps anywhere.
https://kamal-deploy.org
MIT License
9.39k stars 359 forks source link

App logs with follow option does not work after upgrade to 1.5 #777

Closed morgoth closed 2 months ago

morgoth commented 2 months ago

Having the command: bin/kamal app logs -r web -f It worked fine on kamal 1.4.0, thus giving output:

  INFO Following logs on i-0d1a6eb781c5d3ad2...
  INFO ssh -o ProxyCommand='aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'' -t ubuntu@<ip> -p 22 'docker ps --quiet --filter label=service=replenisher --filter label=role=web --filter status=running --filter status=restarting --latest | xargs docker logs --timestamps --tail 10 --follow 2>&1'

while on 1.5.0, it throws:

  INFO Following logs on i-0d1a6eb781c5d3ad2...
  INFO ssh -o ProxyCommand='aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'' -t ubuntu@<ip> -p 22 'sh -c 'docker ps --latest --quiet --filter label=service=replenisher --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=ecr-repo-address/image-name:latest --format '\''{{.ID}}'\'') ; docker ps --latest --quiet --filter label=service=replenisher --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker logs --timestamps --tail 10 --follow 2>&1'
sh: 1: Syntax error: Unterminated quoted string

Running `bin/kamal app logs -r web (without follow option) works fine

My nonstandard SSH config:

ssh:
  user: ubuntu
  proxy_command: <%= %q(aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p') %>
djmb commented 2 months ago

Thanks @morgoth - looks like it was generally broken and nothing to do with your specific config. Fixed in https://github.com/basecamp/kamal/pull/779

djmb commented 2 months ago

I've released v1.5.1, could you confirm that it's fixed for you now @morgoth?

morgoth commented 2 months ago

It works. Thank you