Skip to content
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

Postgresql issue #2433

Closed
anderotxoa opened this issue Jan 23, 2023 · 6 comments
Closed

Postgresql issue #2433

anderotxoa opened this issue Jan 23, 2023 · 6 comments
Labels

Comments

@anderotxoa
Copy link

Steps To Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. Click on '...'

Expected Result

Installation completed

Actual Result

It just fails after starting the "Installation phase", log below:
Ubuntu 22.04, x86-64, it would look like postgresql refuses to start properly (remains started but exited)
...
Getting current PHP-version...
PHPVER=8.1
Automatically configures pm.max_children for php-fpm...
pm.max_children was set to 206
pm.max_spare_servers was set to 176
Fetching the latest Nextcloud version...
25.0.3
Downloading nextcloud-25.0.3...
Testing if network is OK...
Checking connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 143M 100 143M 0 0 25.9M 0 0:00:05 0:00:05 --:--:-- 27.0M
Checking SHA256 checksum...
nextcloud-25.0.3.tar.bz2: OK
Checking GPG integrity... gpg: key D75899B9A724937A: "Nextcloud Security [email protected]" not changed
gpg: Total number processed: 1 gpg: unchanged: 1
gpg: Signature made Tue Jan 17 10:10:37 2023 CET
gpg: using RSA key 28806A878AE423A28372792ED75899B9A724937A
gpg: Good signature from "Nextcloud Security [email protected]" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 2880 6A87 8AE4 23A2 8372 792E D758 99B9 A724 937A
[⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻]
[⣾⣽⣻⣾⣽⣻Setting secure permissions...
Creating possible missing Directories
chmod Files and Directories ⣾⣽⣻chown Directories
chmod/chown .htaccess ]
Installing Nextcloud...
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user "nextcloud_db_user"
connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user "nextcloud_db_user" in /var/www/nextcloud/lib/private/DB/Connection.php:139
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1519): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Statement.php(73): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1016): Doctrine\DBAL\Statement->__construct()
#3 /var/www/nextcloud/lib/private/DB/Connection.php(238): Doctrine\DBAL\Connection->prepare()
#4 /var/www/nextcloud/lib/private/DB/ConnectionAdapter.php(56): OC\DB\Connection->prepare()
#5 /var/www/nextcloud/lib/private/legacy/OC_DB.php(55): OC\DB\ConnectionAdapter->prepare()
#6 /var/www/nextcloud/lib/private/legacy/OC_DB.php(128): OC_DB::prepare()
#7 /var/www/nextcloud/lib/private/legacy/OC_Util.php(753): OC_DB::executeAudited()
#8 /var/www/nextcloud/lib/private/legacy/OC_Util.php(733): OC_Util::checkDatabaseVersion()
#9 /var/www/nextcloud/lib/private/Console/Application.php(159): OC_Util::checkServer()
#10 /var/www/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#11 /var/www/nextcloud/occ(11): require_once('...')
#12 {main}

Next OC\DB\Exceptions\DbalException: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user "nextcloud_db_user"
connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user "nextcloud_db_user" in /var/www/nextcloud/lib/private/DB/Exceptions/DbalException.php:71
Stack trace:
#0 /var/www/nextcloud/lib/private/DB/ConnectionAdapter.php(59): OC\DB\Exceptions\DbalException::wrap()
#1 /var/www/nextcloud/lib/private/legacy/OC_DB.php(55): OC\DB\ConnectionAdapter->prepare()
#2 /var/www/nextcloud/lib/private/legacy/OC_DB.php(128): OC_DB::prepare()
#3 /var/www/nextcloud/lib/private/legacy/OC_Util.php(753): OC_DB::executeAudited()
#4 /var/www/nextcloud/lib/private/legacy/OC_Util.php(733): OC_Util::checkDatabaseVersion()
#5 /var/www/nextcloud/lib/private/Console/Application.php(159): OC_Util::checkServer()
#6 /var/www/nextcloud/console.php(99): OC\Console\Application->loadCommands()
#7 /var/www/nextcloud/occ(11): require_once('...')
#8 {main}Sorry but something went wrong. Please report this issue to https://github.com/nextcloud/vm/issues and include the output of the error message. Thank you!
sudo -u www-data php /var/www/nextcloud/occ maintenance:install --data-dir=/mnt/ncdata --database=pgsql --database-name=nextcloud_db --database-user=nextcloud_db_user --database-pass=OPRvjTrxT1UKtjm@dojuXwdcu --admin-user=ncadmin --admin-pass=nextcloud failed
Nextcloud is not installed - only a limited number of commands are available
root@nas:/vm# uname -a
Linux nas.el202.net 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
root@nas:
/vm#

However Postgresql looks like ok installed (from the same log):
...
Setting up postgresql-common (238) ... [866/1805]
Not replacing deleted config file /etc/postgresql-common/createcluster.conf
Setting up postgresql-14 (14.6-0ubuntu0.22.04.1) ...
update-alternatives: using /usr/share/postgresql/14/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaste
r.1.gz) in auto mode
Setting up postgresql (14+238) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Scanning processes...
Scanning processor microcode...
Scanning linux images...

Running kernel seems to be up-to-date.

The processor microcode seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
CREATE ROLE
CREATE DATABASE
PostgreSQL password: OPRvjTrxT1UKtjm@dojuXwdcu
[⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻⣾⣽⣻]
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
...

Screenshots, Videos, or Pastebins

No response

Additional Context

No response

Build Version

latest

Environment

By using the scripts

Environment Details

Ubuntu 22.04
PHP 8.1

@anderotxoa anderotxoa added the bug label Jan 23, 2023
@enoch85
Copy link
Member

enoch85 commented Jan 23, 2023

Thanks for reporting!

I will do a test installation and see if I can reproduce the error.

@anderotxoa
Copy link
Author

anderotxoa commented Jan 24, 2023

Hi, some advances, I used listen_addresses = '*' in the postgresql config file as stated here: https://askubuntu.com/questions/50621/can-not-connect-to-postgresql-listening-on-port-5432
It now can find the right port of psql but complains about the password (I manually deleted both the DB and the role in the psql database...)
I add install log
install.log

@anderotxoa
Copy link
Author

More findings, log shows that it ALWAYS tries to install nc with the same password, not with the generated one. where could it be getting this password from?

The DB user was created with this command: CREATE USER nextcloud_db_user WITH PASSWORD 'oE2D5B@Ri4NAMPbTltTf*W1orn'

but the installation tries with another passwd :-(

#8 {main}Sorry but something went wrong. Please report this issue to https://github.com/nextcloud/vm/issues and include the output of the error message. Thank you!
sudo -u www-data php /var/www/nextcloud/occ maintenance:install --data-dir=/mnt/ncdata --database=pgsql --database-name=nextcloud_db --database-user=nextcloud_db_user --database-pass=9HUI8pkOO9s*l1Yo1KUfhHblu --admin-user=ncadmin --admin-pass=nextcloud failed

@enoch85
Copy link
Member

enoch85 commented Jan 24, 2023

Hmm, you're on to something here. Will test it right away.

@enoch85
Copy link
Member

enoch85 commented Jan 24, 2023

OK I officially have no clue. Just tested to install and all went fine.

@enoch85 enoch85 closed this as completed Jan 24, 2023
@enoch85
Copy link
Member

enoch85 commented Jan 24, 2023

If you need help installing, please check here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants