Skip to content

script to review when username is not postgres - permission issue #94

@shuther

Description

@shuther

I tried to migrate from Postgres v14 to v15
The default user was different; the db is expected to start with POSTGRES_USER. This is causing issues to test pgbench (at least)

This is causing a problem (I guess) when I run:

docker run --rm \
	-v "$MIGRATE_OLD_FOLDER":/var/lib/postgresql \
	"tianon/postgres-upgrade:$OLD-to-$NEW" \
	--link

The logs are:

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/15/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok


Success. You can now start the database server using:

    pg_ctl -D /var/lib/postgresql/15/data -l logfile start

initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.

could not open version file "/var/lib/postgresql/14/data/PG_VERSION": No such file or directory
Failure, exiting

I confirm that the file exists:

sudo cat $MIGRATE_OLD_FOLDER/PG_VERSION
14

I guess there is a permission issue.
the old folder is owned by 999:0 (with drwx------)

Is there a way to enforce the uid for the upgrade process?

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