nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.57k stars 4.08k forks source link

[Bug]: Blocked installation if admin username is invalid when db is PostgreSQL #36734

Open Vinorcola opened 1 year ago

Vinorcola commented 1 year ago

⚠️ This issue respects the following points: ⚠️

Bug description

During a new NextCloud installation, username & password fields are prompted to the user for initialisation.

If the user enters an invalid username (e.g. Éléonore), the installation process will create all the tables in the database, but the user account creation will failed due to invalid username.

The user is then invited to fix the username, but when the installation is launched again, we have the following error:

Error while trying to initialise the database: An exception occurred while executing a query: SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "oc_migrations" already exists

(which is normal because the database is already initialized)

But then, the user is stuck there and needs to drop the database by hand and restart the installation process from scratch.

Steps to reproduce

  1. Install a new NextCloud instance
  2. Enter an invalid username (containing invalid characters, e.g. é)
  3. Click Install
  4. The user is invited to correct the username, enter a valid username
  5. Click Install
  6. It fails there.

Expected behavior

No error when the user click on Install for the second time.

Installation method

Community Docker image

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

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

Nextcloud is not installed - only a limited number of commands are available

  There are no commands defined in the "config" namespace.

List of activated Apps

Nextcloud is not installed - only a limited number of commands are available

  There are no commands defined in the "app" namespace.

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

szaimen commented 1 year ago

Hi, which nc version?

Vinorcola commented 1 year ago

NextCloud 25