I am deploying Nextcloud using the official image and postgres:13-alpine
.
I’ve configured the Postgres container such that the username and password (note: this is not the actual password) nextcloud:gq48CHM2QVQ9VV8YrMMLDrehpHKx5U39jwFrVmYMxczXhA9PPeApVqySPDMQE9k2aqCAKhnbRFWezZBnarG99jzpJHPhaRvJy5A7
accesses a Postgres database named nextcloud
. I have confirmed that this works by logging in to that Postgres instance using those credentials and it works.
I have configured the Nextcloud Docker container with these environment variables:
POSTGRES_PASSWORD
:gq
…5A7
(the password above)POSTGRES_USER
:nextcloud
POSTGRES_DB
:nextcloud
POSTGRES_HOST
:nextcloud-postgres:5432
(I have verified the hostname and that it resolves.)NEXTCLOUD_ADMIN_PASSWORD
: another password of similar length and style to the Postgres passwordNEXTCLOUD_ADMIN_USER
: a username
but I get this error:
{
"reqId": "1b9wPWL2w8zcnkYbpAPd",
"level": 3,
"time": "2021-04-24T21:40:36+00:00",
"remoteAddr": "10.0.1.4",
"user": "--",
"app": "index",
"method": "GET",
"url": "/",
"message": {
"Exception": "OC\\DB\\Exceptions\\DbalException",
"Message": "Failed to connect to the database: An exception occurred in the driver: SQLSTATE[08006] [7] FATAL: password authentication failed for user \"nextcloud\"",
"Code": 7,
"Trace": [{
"file": "/var/www/html/lib/private/DB/ConnectionAdapter.php",
"line": 59,
"function": "wrap",
"class": "OC\\DB\\Exceptions\\DbalException",
"type": "::",
"args": [{
"__class__": "Doctrine\\DBAL\\Exception"
}]
}, {
"file": "/var/www/html/lib/private/legacy/OC_DB.php",
"line": 72,
"function": "prepare",
"class": "OC\\DB\\ConnectionAdapter",
"type": "->",
"args": ["SHOW SERVER_VERSION", null, null]
}, {
"file": "/var/www/html/lib/private/legacy/OC_DB.php",
"line": 145,
"function": "prepare",
"class": "OC_DB",
"type": "::",
"args": ["SHOW SERVER_VERSION", null, null]
}, {
"file": "/var/www/html/lib/private/legacy/OC_Util.php",
"line": 989,
"function": "executeAudited",
"class": "OC_DB",
"type": "::",
"args": [{
"sql": "SHOW SERVER_VERSION",
"limit": null,
"offset": null
}]
}, {
"file": "/var/www/html/lib/private/legacy/OC_Util.php",
"line": 969,
"function": "checkDatabaseVersion",
"class": "OC_Util",
"type": "::",
"args": []
}, {
"file": "/var/www/html/lib/base.php",
"line": 650,
"function": "checkServer",
"class": "OC_Util",
"type": "::",
"args": [{
"__class__": "OC\\SystemConfig"
}]
}, {
"file": "/var/www/html/lib/base.php",
"line": 1076,
"function": "init",
"class": "OC",
"type": "::",
"args": []
}, {
"file": "/var/www/html/index.php",
"line": 35,
"args": ["/var/www/html/lib/base.php"],
"function": "require_once"
}],
"File": "/var/www/html/lib/private/DB/Exceptions/DbalException.php",
"Line": 70,
"Previous": {
"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 \"nextcloud\"",
"Code": 7,
"Trace": [{
"file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
"line": 1486,
"function": "connect",
"class": "OC\\DB\\Connection",
"type": "->",
"args": []
}, {
"file": "/var/www/html/3rdparty/doctrine/dbal/src/Statement.php",
"line": 71,
"function": "getWrappedConnection",
"class": "Doctrine\\DBAL\\Connection",
"type": "->",
"args": []
}, {
"file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
"line": 989,
"function": "__construct",
"class": "Doctrine\\DBAL\\Statement",
"type": "->",
"args": ["SHOW SERVER_VERSION", {
"__class__": "OC\\DB\\Connection"
}]
}, {
"file": "/var/www/html/lib/private/DB/Connection.php",
"line": 204,
"function": "prepare",
"class": "Doctrine\\DBAL\\Connection",
"type": "->",
"args": ["SHOW SERVER_VERSION"]
}, {
"file": "/var/www/html/lib/private/DB/ConnectionAdapter.php",
"line": 56,
"function": "prepare",
"class": "OC\\DB\\Connection",
"type": "->",
"args": ["SHOW SERVER_VERSION", null, null]
}, {
"file": "/var/www/html/lib/private/legacy/OC_DB.php",
"line": 72,
"function": "prepare",
"class": "OC\\DB\\ConnectionAdapter",
"type": "->",
"args": ["SHOW SERVER_VERSION", null, null]
}, {
"file": "/var/www/html/lib/private/legacy/OC_DB.php",
"line": 145,
"function": "prepare",
"class": "OC_DB",
"type": "::",
"args": ["SHOW SERVER_VERSION", null, null]
}, {
"file": "/var/www/html/lib/private/legacy/OC_Util.php",
"line": 989,
"function": "executeAudited",
"class": "OC_DB",
"type": "::",
"args": [{
"sql": "SHOW SERVER_VERSION",
"limit": null,
"offset": null
}]
}, {
"file": "/var/www/html/lib/private/legacy/OC_Util.php",
"line": 969,
"function": "checkDatabaseVersion",
"class": "OC_Util",
"type": "::",
"args": []
}, {
"file": "/var/www/html/lib/base.php",
"line": 650,
"function": "checkServer",
"class": "OC_Util",
"type": "::",
"args": [{
"__class__": "OC\\SystemConfig"
}]
}, {
"file": "/var/www/html/lib/base.php",
"line": 1076,
"function": "init",
"class": "OC",
"type": "::",
"args": []
}, {
"file": "/var/www/html/index.php",
"line": 35,
"args": ["/var/www/html/lib/base.php"],
"function": "require_once"
}],
"File": "/var/www/html/lib/private/DB/Connection.php",
"Line": 85
},
"CustomMessage": "--"
},
"userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0",
"version": "21.0.1.1"
}
I (actually, multiple people) have been working at this for over a month but haven’t been able to get anywhere. Any help would be appreciated!