Closed gav-fyi closed 2 months ago
Oh, that's a weird one I've not seen before.
Just to double check, there's no partitions anywhere running out of disk space or anything along those lines when the error occurs yeah?
Mostly asking that just in case, as a filled disk can cause all kinds of weird errors.
Note that I'm just about to hit the sack personally, and it looks like I've caught either the flu or Covid (for a 2nd time, ugh). So I might not be looking at any response here for a while.
Hopefully some of the other team members have ideas on what the cause and fix for this might be. :smile:
Ay assistance or pointers would be greatly appreciated.
If all else fails and you need to debug the problem, you can start the container with the environment variable PGAUTO_DEVEL=before
defined, which will start the container (and leave it running) just before the pgautoupgrade script runs. (like is done here, if that helps)
If you do that, then you can exec into the container and manually run the upgrade script commands one (or a few) at a time until you reach the point where it's going wrong/breaking.
With doing that, it should be feasible to figure out exactly why it's breaking, then figure out a fix.
Which could then be applied to the repo here for everyone to benefit from. That's the theory anyway. :smile:
If you're already pretty familiar with shell scripting then it might be a useful option. :smile:
There are some great pointers there, thank you very much. I'll take a look on Monday when I'm back in the office, and will be sure to update you on any progress made.
Thanks for the quick reply, and I hope you start to feel better soon.
The failure was very much with the pg_upgrade
command, so had to dig a little deeper.
I found a solution on a similar library: https://github.com/tianon/docker-postgres-upgrade/issues/83#issuecomment-1960681055
The issue was due to M-chip Macs not supporting the Unix socket filetype, so I had to update the pg_upgrade
command to be
/usr/local/bin/pg_upgrade --username="${POSTGRES_USER}" --link -d "${OLD}" -D "${NEW}" -b "${OLDPATH}/bin" -B /usr/local/bin --socketdir="/var/run/postgresql"
Note: the addition of --socketdir="/var/run/postgresql"
The command then ran fine. Thanks for the pointers. I now have other errors (to do with my DB), but this issue is resolved.
I'll leave it open for now though, as I'm not sure if you'd want to include something in the main README for this, or a way to specify the --socketdir
via environment variables.
Oh wow, that's totally unexpected. I had no idea that limitation existed.
It sounds like we could include your --socketdir
approach by default too, without negatively affecting others. Will need to do some investigation and see how that plays out. :smile:
Initial testing on my desktop system here (Debian 12 x86_64) looks like it works fine too, so I've just thrown together a PR to add the --socketdir
option to all of the docker images: https://github.com/pgautoupgrade/docker-pgautoupgrade/pull/33
k, that PR has been merged. Once the automatic GitHub Actions rebuild of the docker images happens then you should be fine to use them without worrying about this particular issue again.
In theory. :wink:
Amazing. Thanks for the quick turnaround. šš»
No worries at all. Thanks for taking the time to investigate the root cause and figure out a solid solution. :smile:
I can confirm that the latest image from DockerHub works perfectly. šš»
Thanks again.
Hi, I've recently found this package which looks extremely promising for upgrading our development environments from Postgres 15 to Postgres 16.
I'm trying to attempt the one-shot upgrade of a large (~20GB) Postgres 15 databsse to 16, without success. I have attached the output of the command/logs below.
Command
The output I get in the terminal is (reduced for brevity; let me know if you need earlier logs)
With the log file showing
Ay assistance or pointers would be greatly appreciated.
Hardware: MacBook Pro M2 Original Postgres Image:
postgres:15