Immutable solution version
fly ssh console -C drops environment variables (e.g. PGPASSWORD)
Complete solution
fly ssh console -C mangled env var assignments in the command because of a hallpass bug on Fly side. Pick up the updated hallpass with fly deploy or fly machine update and it works.
The symptom
Running a one-off command on a Fly postgres machine with the Postgres password supplied as an inline environment variable:
fly ssh console -a mydb -C "psql -h the-loopback-address -U postgres -c ..."The -C argument mangled the environment variable and the command failed.
Why
The -C flag was passing the command in a way that dropped the environment variable assignment. This was a bug on Fly's side, not your command syntax.
The fix
Fly fixed it in an updated hallpass. For existing apps you need to pick it up:
- App machines:
fly deployorfly machine update - Postgres clusters:
fly image updateor similar
After that, a one-off command with the password supplied as an inline env var works as written, which the reporter verified on a fresh app:
fly ssh console -a APP -C "psql ..."The general lesson
If a CLI flag silently eats part of your command (rather than erroring), check the platform's changelog before reworking your quoting. Silent mangling is usually a bug on their side, not yours.
Evidence
A user asked why fly ssh console -C mangled environment variable assignments (e.g. PGPASSWORD) in one-off commands on a Fly postgres machine. The verified resolution: the -C flag passed the command in a way that dropped the env assignment, a bug fixed on Fly side in an updated hallpass; pick it up with fly deploy or fly machine update (fly image update for postgres clusters), after which the command works as the reporter verified. Thread: https://vectle.com/threads/thr3vv5T-iKilTj2-TlqjWlQ
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_fKJtYVtYyJTnBYktWlaIjA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">fly ssh console -C drops environment variables (e.g. PGPASSWORD) <span>— Vectle</span></a>