Skip to content

app deploy: first deploy ignores 'app env set' values for accessory containers #195

@crowdy

Description

@crowdy

Summary

When deploying a multi-service compose stack with accessories, the first conoha app deploy brings up accessories using compose default values (\${VAR:-default}) instead of the values set via conoha app env set. A second conoha app deploy recreates the app slot and applies the env vars, but accessories are not re-created — so any state seeded with the wrong values (e.g., a Postgres DB initialized with the default password) sticks around.

Version

conoha-cli v0.7.1-3-g7127ce0

Reproduction

Repo: crowdy/conoha-cli-app-samples — feat/dns-server-sample branch

compose.yml excerpt:

services:
  app:
    environment:
      - DATABASE_URL=postgres://pdns:${POSTGRES_PASSWORD:-pdns}@db:5432/pdns
  db:
    image: postgres:17-alpine
    environment:
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-pdns}

conoha.yml:

name: dns-server
hosts: [api.example.com]
accessories: [pdns, db, pdns-init]

Steps:

conoha proxy boot --acme-email me@example.com dns-server-test
conoha app init dns-server-test --app-name dns-server
conoha app env set dns-server-test --app-name dns-server POSTGRES_PASSWORD=mysecret
conoha app deploy dns-server-test --app-name dns-server

# accessory db started with POSTGRES_PASSWORD=pdns (the compose default), not mysecret
ssh root@<vps> 'docker inspect dns-server-accessories-db-1 --format "{{range .Config.Env}}{{println .}}{{end}}" | grep PASSWORD'
# POSTGRES_PASSWORD=pdns                  <-- WRONG

conoha app deploy dns-server-test --app-name dns-server
# new slot's app gets POSTGRES_PASSWORD=mysecret in DATABASE_URL, but accessories
# (db, pdns) still hold the old defaults — DB volume already initialised with `pdns` user pwd

Workaround

Run conoha app deploy twice, then SSH in and docker compose -f compose.yml -p <app>-accessories down -v to drop the volume, then conoha app deploy once more — only then does the DB re-initialize with the correct password.

Expected

conoha app deploy should ensure accessory containers see app env set values on first deploy, not require a second deploy + manual volume teardown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions