[Bug]: Blocked installation if admin username is invalid when db is PostgreSQL
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- Nextcloud Server is running on 64bit capable CPU, PHP and OS.
- I agree to follow Nextcloud's Code of Conduct.
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
- Install a new NextCloud instance
- Enter an invalid username (containing invalid characters, e.g.
é) - Click
Install - The user is invited to correct the username, enter a valid username
- Click
Install - 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?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce a fresh Nextcloud installation with PostgreSQL using an invalid username, then retry with a valid username and inspect the installation initialization flow. Done means the first failed attempt does not block the second installation, so the user need not drop the database manually.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, postgresql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100