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

[Bug]: fresh install with postgresql, occ maintenance:install error #38749

Closed
5 of 8 tasks
whlsxl opened this issue Jun 12, 2023 · 2 comments · Fixed by #38750
Closed
5 of 8 tasks

[Bug]: fresh install with postgresql, occ maintenance:install error #38749

whlsxl opened this issue Jun 12, 2023 · 2 comments · Fixed by #38750

Comments

@whlsxl
Copy link
Contributor

whlsxl commented Jun 12, 2023

⚠️ This issue respects the following points: ⚠️

Bug description

Fresh install nextcloud & postgresql, when occ maintenance:install, will post an error something like:

PostgreSQL username and/or password not valid
 -> You need to enter details of an existing account.
Trace: #0 /var/www/lib/private/Setup.php(353): OC\Setup\PostgreSQL->setupDatabase()
#1 /var/www/core/Command/Maintenance/Install.php(104): OC\Setup->install()
#2 /var/www/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Maintenance\Install->execute()
#3 /var/www/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
#4 /var/www/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#5 /var/www/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#6 /var/www/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#7 /var/www/console.php(100): OC\Console\Application->run()
#8 /var/www/occ(11): require_once('...')
#9 {main}

Previous: Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] connection to server at "postgres" (192.168.16.6), port 5432 failed: FATAL:  database "nextcloud" does not exist
Trace: #0 /var/www/lib/private/Setup/PostgreSQL.php(112): OC\DB\Connection->connect()
#1 /var/www/lib/private/Setup.php(353): OC\Setup\PostgreSQL->setupDatabase()
#2 /var/www/core/Command/Maintenance/Install.php(104): OC\Setup->install()
#3 /var/www/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Maintenance\Install->execute()
#4 /var/www/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
#5 /var/www/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#6 /var/www/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#7 /var/www/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#8 /var/www/console.php(100): OC\Console\Application->run()
#9 /var/www/occ(11): require_once('...')
#10 {main}

Steps to reproduce

  1. fresh nextcloud
  2. fresh postgresql with superuser postgres & thepassword
  3. occ maintenance:install --database pgsql --database-host localhost:5432 --database-name nextcloud --database-user postgres --database-pass thepassword --admin-user admin --admin-pass adminpassword--data-dir /path/to/data/

Expected behavior

Nextcloud was successfully installed

Installation method

Community Docker image

Nextcloud Server version

26

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?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

This bug is related to this pull request. #34645
Because when execute $connectionMainDatabase->executeQuery('GRANT CREATE ON SCHEMA public TO ' . addslashes($this->dbUser)); the postgres database may not create.

$connectionMainDatabase->executeQuery('GRANT CREATE ON SCHEMA public TO ' . addslashes($this->dbUser));

Same issue: eb7b682#commitcomment-95275498

@whlsxl whlsxl added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jun 12, 2023
whlsxl added a commit to whlsxl/nextcloud-server that referenced this issue Jun 12, 2023
@szaimen szaimen added 2. developing Work in progress and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Jun 12, 2023
@Doublefire-Chen
Copy link

Same issue.

@greenais
Copy link

Same here, but in plain (not Docker) web install of the latest NC.
Spent 3 days trying figure out what's wrong with my Postgres settings - ended here with NC bug.
It's pity that since Jun 2023 Posgtres setup isn't supported in fact despite what's stated on official reqs page...

susnux pushed a commit to whlsxl/nextcloud-server that referenced this issue Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants