镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Closed

Description

@whlsxl

⚠️ 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

Activity

  1. added
    0. Needs triagePending check for reproducibility or if it fits our roadmap
    on Jun 12, 2023
  2. added a commit that references this issue on Jun 12, 2023
    f1fe1ab
  3. added and removed
    0. Needs triagePending check for reproducibility or if it fits our roadmap
    on Jun 12, 2023
  4. Doublefire-Chen commented on Dec 14, 2023

    @Doublefire-Chen

    Same issue.

  5. greenais commented on Feb 15, 2024

    @greenais

    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...

  6. added a commit that references this issue on Mar 20, 2024
    c7524d9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions