NOTE: I wanted to file this under feature enhancement / documentation fix but those options didn’t exist.
I was trying to update my PG config when and the API returned an odd error message:
❯ flyctl pg config update --log-min-duration-statement 1s --app app-name
Error: machines could not be retrieved
This threw me because the PG docs say that is an OK input, leaving off the unit implies ms.
Running the same command with --verbose
gave me a much better idea what the problem is:
❯ flyctl pg config update --log-min-duration-statement 1s --app app-name --verbose
Error: strconv.Atoi: parsing "1s": invalid syntax
The docs kind of suggest ms but take a string:
❯ flyctl pg config update --help
Update Postgres configuration.
Usage:
flyctl postgres config update [flags]
Flags:
-a, --app string Application name
-c, --config string Path to application configuration file
--detach Return immediately instead of monitoring deployment progress
--force Skips pg-setting value verification.
-h, --help help for update
--log-min-duration-statement string Sets the minimum execution time above which all statements will be
logged. (ms)
--log-statement string Sets the type of statements logged. (none, ddl, mod, all)
--max-connections string Sets the maximum number of concurrent connections.
--max-replication-slots string Specifies the maximum number of replication slots. This should
typically match max_wal_senders.
--max-wal-senders string Maximum number of concurrent connections from standby servers or
streaming backup clients. (0 disables replication)
--shared-buffers string Sets the amount of memory the database server uses for shared memory
buffers
--shared-preload-libraries string Sets the shared libraries to preload. (comma separated string)
--wal-level string Sets the level of information written to the WAL. (minimal, replica,
logical).
-y, --yes Accept all confirmations
Global Flags:
-t, --access-token string Fly API Access Token
--debug Print additional logs and traces
--verbose Verbose output
Either way it would be easier to figure out what is wrong if “incorrect value” or something is returned instead of “machines could not be retrieved”.