Error: machines could not be retrieved -- when updating PG config

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”.

Hi @dad, I see the parsing error when I run your first command (without --verbose). Did you repeatedly see the same error? If not, I’m wondering if perhaps you had a coincidental connection issue during the first invocation.

@jfent I repeatedly saw the error, switched to --verbose, removed --verbose and then created the issue here.

I have checked again this morning and I am seeing the “correct” thing:

❯ flyctl pg config update --log-min-duration-statement 1s --app app-name          
Error: strconv.Atoi: parsing "1s": invalid syntax

I’m wondering if perhaps you had a coincidental connection issue during the first invocation

I guess I was having connection issues or the fly.io API wasn’t able to query the machines - at the time my internet was fine so I guess we can put this down to a hiccup.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.