-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: NC 25 RC5 not compatible with postgresql 15 #34617
Comments
Did you get some error logs with that or what doesnt work? |
Likely related to this: https://www.postgresql.org/docs/release/15.0/
|
An easy workaround would be creating the user and database manually beforehand: |
Same error on App CI now. |
That doesn't work either.
|
Does the following work? CREATE DATABASE nextcloud_db TEMPLATE template0 ENCODING 'UTF8';
CREATE USER nextcloud_user WITH PASSWORD 'nextcloud_user_password' CREATEDB;
ALTER DATABASE nextcloud_db OWNER TO nextcloud_user ; |
No.
|
found this: https://stackoverflow.com/a/33030572 |
Doesn't work.
I'm not confident in nextcloud actually working even if I can get the database created. Have you contacted any of your enterprise customers or have one of your team members figure out the incompatibilities with postgresql 15? |
Honestly I rather think that your database is wrongly configured. However postgresql 15 is obviously not supported yet. |
It's installed as per https://www.postgresql.org/download/linux/debian/ It's the same way I've installed nextcloud with postgresql for the last couple of years. Have you tested yourself? |
no |
This comment was marked as resolved.
This comment was marked as resolved.
@Neeham Did you upgrade your postgresql cluster? https://www.postgresql.org/docs/current/pgupgrade.html |
Decided to remove all volume/container etc... and do a fresh install. The error: |
This comment was marked as resolved.
This comment was marked as resolved.
Also getting the same error on CI: https://github.com/nextcloud/recognize/actions/runs/3262003961/jobs/5358144416 |
FWIW I can confirm that with NC 24.0.6 migrating from PostgreSQL 14 to 15 using pg_dumpall works fine. |
@Gchbg You moved to 24.0.6 before upgrading PgSQL? For me, the upgrade process from 23.0.10 to 24.0.6 failed, because I moved to PgSQL15 beforehand:
|
@jeffrson how did you upgrade? can you point out the exact steps? |
My Nextcloud is running via Docker. I was starting from some earlier 23.0.x (23.0.6.1, but I'm not sure). I used pg_dumpall to save the database, updated PgSQL (13 to 15), reimported the dump. Now I had to reset all DB user passwords (md5 hash to scram-sha-256). Then my Nextcloud was running, still 23.0.x, but PgSQL 15. I pulled the latest v23: docker pull nextcloud:23 - restart, everything seems fine. docker logs showed, Nextcloud was running a minor upgrade. I was afraid, there might have been something wrong with the database upgrade (first time for me), but the same steps did work with PgSQL14: The upgrade to 24.0.6 was successful now (had to trigger it via occ, though, because it did not start automatically because of maintenance mode). I hope these steps are clear enough. |
All right! I think after the import you need to run |
$DB_USER is the same as "dbuser" from config.php? I wonder, because I realized today, that although I specified a certain user "DBAdmin" via environment POSTGRES_USER_FILE, the initial installation from Docker created "oc_dbadmin". Both are used (DBAdmin is owner of database, for example). Thanks! |
The problem occur because with PostgreSQL, when we use an user that have permission to create new users, the setup will do:
In release notes of version 15 was explained that common users haven't more permission to schema public, the side effect of this is that won't create tables. I followed this suggestion from release notes:
And this solved the problem, adding this row to setup flow:
I opened this PR #34645 fixing the problem |
I was and still am running 24.0.6. On that version upgrading PgSQL from 14 to 15 went smoothly. Note also that my script does this on first installation of Nextcloud, before Nextcloud gets to run at all:
(sorry about the formatting) |
The problem only occur on the first setup using PostgreSQL 15 because need to give the right permissions to database user. If you have a Nextcloud running and only upgrade the database, this will work fine. |
I tried a clean new installation of NextCloud 25.0.0.0 with the changes from your PR applied manually to the PHP code, with PostgreSQL 15. Unfortunately I got the error:
I don't know if this is relevant, but what I do is create the database myself first:
And then I run the Nextcloud setup with your modifications. TIA for any insight. |
No update yet! |
Indeed. The PR #34645 is not yet merged. |
Will there be a v25.0.2 release? |
Yes |
I had the same problem as described by @jeffrson after following his same steps and fixed by executing in the db container: psql -d nextcloud -U nextcloud -c 'GRANT CREATE ON SCHEMA public TO $OC_USER' After that I get back to nextcloud container and executed as user ./occ upgrade
./occ maintenance:mode --off |
Not shure if it's still relevant... I upgraded from NC 25 to NC 26.0.10 with postgresql 15.
I had to change the owner of the tablespace to the $OC_USER: It seems there are not that many people using postgresql as database for nextcloud... |
Bug description
Postgresql 15 was released today and nextcloud 25 RC5 and it is not happy with postgresql 15. Any ETA on a fix?
Steps to reproduce
Install PHP 8.1-fpm and postgresql 15 and try installing NC 25 RC5 on debian 11.
Install using source https://download.nextcloud.com/server/prereleases/nextcloud-25.0.0rc5.zip
Expected behavior
Works as expected
Installation method
No response
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
Nginx
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
No response
List of activated Apps
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
No response
The text was updated successfully, but these errors were encountered: