During initial setup, if try to create an admin account if username contains hyphen it will fail, when using postgres.
Successfully create john-smith admin account and show welcome page.
{"reqId":"q2OrFWlsk3ke3gbj8ck8","level":2,"time":"2023-03-07T23:05:42+00:00","remoteAddr":"192.168.122.1","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"","data":[]}
{"reqId":"q2OrFWlsk3ke3gbj8ck8","level":2,"time":"2023-03-07T23:05:42+00:00","remoteAddr":"192.168.122.1","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"","data":[]}
{"reqId":"Paqg1gO16SmUaJuaIYA1","level":2,"time":"2023-03-07T23:06:17+00:00","remoteAddr":"192.168.122.1","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"","data":[]}
{"reqId":"Paqg1gO16SmUaJuaIYA1","level":2,"time":"2023-03-07T23:06:17+00:00","remoteAddr":"192.168.122.1","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"","data":[]}
{"reqId":"Paqg1gO16SmUaJuaIYA1","level":2,"time":"2023-03-07T23:06:17+00:00","remoteAddr":"192.168.122.1","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Error trying to connect as \"postgres\", assuming database is setup and tables need to be created","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"25.0.4.1","exception":{"Exception":"Doctrine\\DBAL\\Exception\\SyntaxErrorException","Message":"An exception occurred while executing a query: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near \"-\"\nLINE 1: CREATE USER oc_john-smith CREATEDB PASSWORD '3o7ZpltFWzOpggv...\n ^","Code":7,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1780,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\PostgreSQL\\ExceptionConverter","type":"->","args":[["Doctrine\\DBAL\\Driver\\PDO\\Exception"],["Doctrine\\DBAL\\Query"]]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1719,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->","args":[["Doctrine\\DBAL\\Driver\\PDO\\Exception"],["Doctrine\\DBAL\\Query"]]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Statement.php","line":193,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":[["Doctrine\\DBAL\\Driver\\PDO\\Exception"],"CREATE USER oc_john-smith CREATEDB PASSWORD '3o7ZpltFWzOpggvZzPnuauA6mZINW7'",[],[]]},{"file":"/var/www/html/lib/private/Setup/PostgreSQL.php","line":174,"function":"execute","class":"Doctrine\\DBAL\\Statement","type":"->","args":[]},{"file":"/var/www/html/lib/private/Setup/PostgreSQL.php","line":73,"function":"createDBUser","
class":"OC\\Setup\\PostgreSQL","type":"->","args":[["OC\\DB\\Connection"]]},{"file":"/var/www/html/lib/private/Setup.php","line":353,"function":"setupDatabase","class":"OC\\Setup\\PostgreSQL","type":"->","args":["john-smith"]},{"file":"/var/www/html/core/Controller/SetupController.php","line":69,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/base.php","line":980,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php","Line":58,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near \"-\"\nLINE 1: CREATE USER oc_john-smith CREATEDB PASSWORD '3o7ZpltFWzOpggv...\n ^","Code":7,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":94,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::","args":[["PDOException",["42601",7,"ERROR: syntax error at or near \"-\"\nLINE 1: CREATE USER oc_john-smith CREATEDB PASSWORD '3o7ZpltFWzOpggv...\n ^"]]]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Statement.php","line":189,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->","args":[null]},{"file":"/var/www/html/lib/private/Setup/PostgreSQL.php","line":174,"function":"execute","class":"Doctrine\\DBAL\\Statement","type":"->","args":[]},{"file":"/var/www/html/lib/private/Setup/PostgreSQL.php","line":73,"function":"createDBUser","class":"OC\\Setup\\PostgreSQL","type":"->","args":[["OC\\DB\\Connection"]]},{"file":"/var/www/html/lib/private/Setup.php","line":353,"function":"setupDatabase","class":"OC\\Setup\\PostgreSQL","type":"->","args":["john-smith"]},{"file":"/var/www/html/core/Controller/SetupController.php","line":69,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/base.php","line":980,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":26,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near \"-\"\nLINE 1: CREATE USER oc_john-smith CREATEDB PASSWORD '3o7ZpltFWzOpggv...\n ^","Code":"42601","Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":92,"function":"execute","class":"PDOStatement","type":"->","args":[null]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Statement.php","line":189,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->","args":[null]},{"file":"/var/www/html/lib/private/Setup/PostgreSQL.php","line":174,"function":"execute","class":"Doctrine\\DBAL\\Statement","type":"->","args":[]},{"file":"/var/www/html/lib/private/Setup/PostgreSQL.php","line":73,"function":"createDBUser","class":"OC\\Setup\\PostgreSQL","type":"->","args":[["OC\\DB\\Connection"]]},{"file":"/var/www/html/lib/private/Setup.php","line":353,"function":"setupDatabase","class":"OC\\Setup\\PostgreSQL","type":"->","args":["john-smith"]},{"file":"/var/www/html/core/Controller/SetupController.php","line":69,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/base.php","line":980,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":92}},"message":"Error trying to connect as \"postgres\", assuming database is setup and tables need to be created","exception":{},"CustomMessage":"Error trying to connect as \"postgres\", assuming database is setup and tables need to be created"}}
{"reqId":"Paqg1gO16SmUaJuaIYA1","level":3,"time":"2023-03-07T23:06:17+00:00","remoteAddr":"192.168.122.1","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] FATAL: password authentication failed for user \"oc_john-smith\"","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"25.0.4.1","exception":{"Exception":"Doctrine\\DBAL\\Exception","Message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] FATAL: password authentication failed for user \"oc_john-smith\"","Code":7,"Trace":[{"file":"/var/www/html/lib/private/Setup/PostgreSQL.php","line":110,"function":"connect","class":"OC\\DB\\Connection","type":"->","args":[]},{"file":"/var/www/html/lib/private/Setup.php","line":353,"function":"setupDatabase","class":"OC\\Setup\\PostgreSQL","type":"->","args":["john-smith"]},{"file":"/var/www/html/core/Controller/SetupController.php","line":69,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/base.php","line":980,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/DB/Connection.php","Line":139,"message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] FATAL: password authentication failed for user \"oc_john-smith\"","exception":{},"CustomMessage":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] FATAL: password authentication failed for user \"oc_john-smith\""}}
Bug description
During initial setup, if try to create an admin account if username contains hyphen it will fail, when using postgres.
Steps to reproduce
docker-compose.ymljohn-smith.Expected behavior
Successfully create john-smith admin account and show welcome page.
Installation method
Community Docker image
Operating system
Debian/Ubuntu
PHP engine version
None
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?
None
What user-backends are you using?
Configuration report
No response
List of activated Apps
Nextcloud Signing status
No response
Nextcloud Logs
{"reqId":"q2OrFWlsk3ke3gbj8ck8","level":2,"time":"2023-03-07T23:05:42+00:00","remoteAddr":"192.168.122.1","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"","data":[]} {"reqId":"q2OrFWlsk3ke3gbj8ck8","level":2,"time":"2023-03-07T23:05:42+00:00","remoteAddr":"192.168.122.1","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"","data":[]} {"reqId":"Paqg1gO16SmUaJuaIYA1","level":2,"time":"2023-03-07T23:06:17+00:00","remoteAddr":"192.168.122.1","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"","data":[]} {"reqId":"Paqg1gO16SmUaJuaIYA1","level":2,"time":"2023-03-07T23:06:17+00:00","remoteAddr":"192.168.122.1","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"","data":[]} {"reqId":"Paqg1gO16SmUaJuaIYA1","level":2,"time":"2023-03-07T23:06:17+00:00","remoteAddr":"192.168.122.1","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Error trying to connect as \"postgres\", assuming database is setup and tables need to be created","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"25.0.4.1","exception":{"Exception":"Doctrine\\DBAL\\Exception\\SyntaxErrorException","Message":"An exception occurred while executing a query: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near \"-\"\nLINE 1: CREATE USER oc_john-smith CREATEDB PASSWORD '3o7ZpltFWzOpggv...\n ^","Code":7,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1780,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\PostgreSQL\\ExceptionConverter","type":"->","args":[["Doctrine\\DBAL\\Driver\\PDO\\Exception"],["Doctrine\\DBAL\\Query"]]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Connection.php","line":1719,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->","args":[["Doctrine\\DBAL\\Driver\\PDO\\Exception"],["Doctrine\\DBAL\\Query"]]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Statement.php","line":193,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":[["Doctrine\\DBAL\\Driver\\PDO\\Exception"],"CREATE USER oc_john-smith CREATEDB PASSWORD '3o7ZpltFWzOpggvZzPnuauA6mZINW7'",[],[]]},{"file":"/var/www/html/lib/private/Setup/PostgreSQL.php","line":174,"function":"execute","class":"Doctrine\\DBAL\\Statement","type":"->","args":[]},{"file":"/var/www/html/lib/private/Setup/PostgreSQL.php","line":73,"function":"createDBUser"," class":"OC\\Setup\\PostgreSQL","type":"->","args":[["OC\\DB\\Connection"]]},{"file":"/var/www/html/lib/private/Setup.php","line":353,"function":"setupDatabase","class":"OC\\Setup\\PostgreSQL","type":"->","args":["john-smith"]},{"file":"/var/www/html/core/Controller/SetupController.php","line":69,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/base.php","line":980,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php","Line":58,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near \"-\"\nLINE 1: CREATE USER oc_john-smith CREATEDB PASSWORD '3o7ZpltFWzOpggv...\n ^","Code":7,"Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":94,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::","args":[["PDOException",["42601",7,"ERROR: syntax error at or near \"-\"\nLINE 1: CREATE USER oc_john-smith CREATEDB PASSWORD '3o7ZpltFWzOpggv...\n ^"]]]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Statement.php","line":189,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->","args":[null]},{"file":"/var/www/html/lib/private/Setup/PostgreSQL.php","line":174,"function":"execute","class":"Doctrine\\DBAL\\Statement","type":"->","args":[]},{"file":"/var/www/html/lib/private/Setup/PostgreSQL.php","line":73,"function":"createDBUser","class":"OC\\Setup\\PostgreSQL","type":"->","args":[["OC\\DB\\Connection"]]},{"file":"/var/www/html/lib/private/Setup.php","line":353,"function":"setupDatabase","class":"OC\\Setup\\PostgreSQL","type":"->","args":["john-smith"]},{"file":"/var/www/html/core/Controller/SetupController.php","line":69,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/base.php","line":980,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":26,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near \"-\"\nLINE 1: CREATE USER oc_john-smith CREATEDB PASSWORD '3o7ZpltFWzOpggv...\n ^","Code":"42601","Trace":[{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":92,"function":"execute","class":"PDOStatement","type":"->","args":[null]},{"file":"/var/www/html/3rdparty/doctrine/dbal/src/Statement.php","line":189,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->","args":[null]},{"file":"/var/www/html/lib/private/Setup/PostgreSQL.php","line":174,"function":"execute","class":"Doctrine\\DBAL\\Statement","type":"->","args":[]},{"file":"/var/www/html/lib/private/Setup/PostgreSQL.php","line":73,"function":"createDBUser","class":"OC\\Setup\\PostgreSQL","type":"->","args":[["OC\\DB\\Connection"]]},{"file":"/var/www/html/lib/private/Setup.php","line":353,"function":"setupDatabase","class":"OC\\Setup\\PostgreSQL","type":"->","args":["john-smith"]},{"file":"/var/www/html/core/Controller/SetupController.php","line":69,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/base.php","line":980,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":92}},"message":"Error trying to connect as \"postgres\", assuming database is setup and tables need to be created","exception":{},"CustomMessage":"Error trying to connect as \"postgres\", assuming database is setup and tables need to be created"}} {"reqId":"Paqg1gO16SmUaJuaIYA1","level":3,"time":"2023-03-07T23:06:17+00:00","remoteAddr":"192.168.122.1","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] FATAL: password authentication failed for user \"oc_john-smith\"","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0","version":"25.0.4.1","exception":{"Exception":"Doctrine\\DBAL\\Exception","Message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] FATAL: password authentication failed for user \"oc_john-smith\"","Code":7,"Trace":[{"file":"/var/www/html/lib/private/Setup/PostgreSQL.php","line":110,"function":"connect","class":"OC\\DB\\Connection","type":"->","args":[]},{"file":"/var/www/html/lib/private/Setup.php","line":353,"function":"setupDatabase","class":"OC\\Setup\\PostgreSQL","type":"->","args":["john-smith"]},{"file":"/var/www/html/core/Controller/SetupController.php","line":69,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/base.php","line":980,"function":"run","class":"OC\\Core\\Controller\\SetupController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/DB/Connection.php","Line":139,"message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] FATAL: password authentication failed for user \"oc_john-smith\"","exception":{},"CustomMessage":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] FATAL: password authentication failed for user \"oc_john-smith\""}}Additional info
docker logs:
docker logs nextclouddocker logs postgres