Struggling with Kamal 2 deploy

I have a Rails app I’m trying to deploy to Digital Ocean with Kamal 2. I’ve followed all the guides I can find, created a blank droplet with confirmed ssh-key access, made a Docker Registry on D.O. – but I keep hitting this error:

Log into image registry...
  INFO [abbc5d4a] Running docker login registry.digitalocean.com -u [REDACTED] -p [REDACTED] as sean@localhost
  Finished all in 0.1 seconds
Releasing the deploy lock...
  Finished all in 1.7 seconds
  ERROR (SSHKit::Command::Failed): docker exit status: 256
docker stdout: Nothing written
docker stderr: flag needs an argument: 'p' in -p

This is my deploy.yaml settings showing the stuff I changed (everything else is defaults)

service: flightplan
image: codepilot-registry/flightplan
servers:
  web:
    - 64.23.190.207
proxy:
  ssl: true
  host: plan.codepilot.com
registry:
  server: registry.digitalocean.com
  username: sean@codepilot.com
  password:
    - KAMAL_REGISTRY_PASSWORD
env:
  secret:
    - RAILS_MASTER_KEY

…and I did set my KAMAL_REGISTRY_PASSWORD using rails credentials:edit. What am I doing wrong?

rails credentials:edit is for secrets to be used in your app. For kamal you will need to .kamal/secrets-common - read more about here Kamal — Environment variables. Once you have that run kamal setup

Hey thanks for your help – I finally figured that out. Strange that Rails’ credentials strategy doesn’t work with Rails’ new deployment strategy. I also found that kamal setup/deploy only uses my .env values if I prefix it like this: dotenv kamal deploy. Not sure why I need to do that when it doesn’t show that in the guides or videos I’ve seen.

Kamal recently switch from using .env for variables to .kamal/secrets and using .env is kind of hidden away in the Upgrade Guide

You can see in there an ERB load to get .env to still pull secrets from a local .env

That’s not strange at all. Kamal is a deployment tool which should just deploy your app. It shouldn’t depend on your app to be able to boot / read application specific credentials / etc. For example in CI deployment you shouldn’t need to have your app fully setup to be able to deploy.

Thanks for the clarification. That makes sense.