Jump to content

Nextcloud Error on TrueNAS

Hey guys!

I want to install nextcloud on my TrueNAS and I've encountered the following issue:

Error while trying to create admin user: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'dbadmin'@'localhost' (using password: YES)

Do you know how to fix that? 

 

(latest TrueNAS Version: TrueNAS-12.0-U3.1; latest Nextcloud version: 21.0.1)

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, potatoPCguy said:

SQLSTATE[HY000] [1045] Access denied for user 'dbadmin'@'localhost' (using password: YES)

 

Would indicate that the user 'dbadmin' probably doesnt exist or you have the wrong password. 

Did it prompt you and give you the password for the dbadmin user during setup?

Try opening the iocage console for the NextCloud jail and run 'cat /root/PLUGIN_INFO' 

Spoiler

Desktop: Ryzen9 5950X | ASUS ROG Crosshair VIII Hero (Wifi) | EVGA RTX 3080Ti FTW3 | 32GB (2x16GB) Corsair Dominator Platinum RGB Pro 3600Mhz | EKWB EK-AIO 360D-RGB | EKWB EK-Vardar RGB Fans | 1TB Samsung 980 Pro, 4TB Samsung 980 Pro | Corsair 5000D Airflow | Corsair HX850 Platinum PSU | Asus ROG 42" OLED PG42UQ + LG 32" 32GK850G Monitor | Roccat Vulcan TKL Pro Keyboard | Logitech G Pro X Superlight  | MicroLab Solo 7C Speakers | Audio-Technica ATH-M50xBT2 LE Headphones | TC-Helicon GoXLR | Audio-Technica AT2035 | LTT Desk Mat | XBOX-X Controller | Windows 11 Pro

 

Spoiler

Server: Fractal Design Define R6 | Ryzen 3950x | ASRock X570 Taichi | EVGA GTX1070 FTW | 64GB (4x16GB) Corsair Vengeance LPX 3000Mhz | Corsair RM850v2 PSU | Fractal S36 Triple AIO + 4 Additional Venturi 120mm Fans | 14 x 20TB Seagate Exos X22 20TB | 500GB Aorus Gen4 NVMe | 2 x 2TB Samsung 970 Evo Plus NVMe | LSI 9211-8i HBA

 

Link to comment
Share on other sites

Link to post
Share on other sites

Are you running a MariaDB/MySQL server?

Is it local to the NAS or on a different box? (This one is VERY important since the details you provided are linked to a localhost user)

Did you actually go and create the database, database user and assign it DB permissions?

Is dbadmin your root/admin account? if yes the please do not do that, while locally its not that bad its still VERY bad practice to use a root account as a "main DB account", you should create a user for each DB and assign them only DB specific permissions.

Main Rig:-

Ryzen 7 3800X | Asus ROG Strix X570-F Gaming | 16GB Team Group Dark Pro 3600Mhz | Corsair MP600 1TB PCIe Gen 4 | Sapphire 5700 XT Pulse | Corsair H115i Platinum | WD Black 1TB | WD Green 4TB | EVGA SuperNOVA G3 650W | Asus TUF GT501 | Samsung C27HG70 1440p 144hz HDR FreeSync 2 | Ubuntu 20.04.2 LTS |

 

Server:-

Intel NUC running Server 2019 + Synology DSM218+ with 2 x 4TB Toshiba NAS Ready HDDs (RAID0)

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Master Disaster said:

Are you running a MariaDB/MySQL server?

Is it local to the NAS or on a different box? (This one is VERY important since the details you provided are linked to a localhost user)

Did you actually go and create the database, database user and assign it DB permissions?

Is dbadmin your root/admin account? if yes the please do not do that, while locally its not that bad its still VERY bad practice to use a root account as a "main DB account", you should create a user for each DB and assign them only DB specific permissions.

I'm running it as a TrueNAS plugin and the credentials I used are from the Post Install Notes of nextcloud. I didn't create a MariaDB/MySQL server, I think that should be handled automatically by TrueNAS. Before I installed it I also watched video tutorials but no one had the same issue. 

 

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, Jarsky said:

 

Would indicate that the user 'dbadmin' probably doesnt exist or you have the wrong password. 

Did it prompt you and give you the password for the dbadmin user during setup?

Try opening the iocage console for the NextCloud jail and run 'cat /root/PLUGIN_INFO' 

As far as I know do the Post Install Notes contain the same infos as the PLUGIN_INFO file but I tried both and got the same error

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, potatoPCguy said:

I'm running it as a TrueNAS plugin and the credentials I used are from the Post Install Notes of nextcloud. I didn't create a MariaDB/MySQL server, I think that should be handled automatically by TrueNAS. Before I installed it I also watched video tutorials but no one had the same issue.

Woah dude, remove that image ASAP!!!

 

If you didn't use MySQL then IIRC it will use a local db as the default option. Theres no reason why it should have been OK to create the DB but then fail when trying to add an account to it.

Main Rig:-

Ryzen 7 3800X | Asus ROG Strix X570-F Gaming | 16GB Team Group Dark Pro 3600Mhz | Corsair MP600 1TB PCIe Gen 4 | Sapphire 5700 XT Pulse | Corsair H115i Platinum | WD Black 1TB | WD Green 4TB | EVGA SuperNOVA G3 650W | Asus TUF GT501 | Samsung C27HG70 1440p 144hz HDR FreeSync 2 | Ubuntu 20.04.2 LTS |

 

Server:-

Intel NUC running Server 2019 + Synology DSM218+ with 2 x 4TB Toshiba NAS Ready HDDs (RAID0)

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Master Disaster said:

Woah dude, remove that image ASAP!!!

 

If you didn't use MySQL then IIRC it will use a local db as the default option. Theres no reason why it should have been OK to create the DB but then fail when trying to add an account to it.

Bruh I'm stupid, how did I not think of that risk..

 

I don't know very much about MariaDB and MySQL.. What does that mean, should I do something in the TrueNAS Shell like update or configure MariaDB?

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, potatoPCguy said:

Bruh I'm stupid, how did I not think of that risk..

 

I don't know very much about MariaDB and MySQL.. What does that mean, should I do something in the TrueNAS Shell like update or configure MariaDB?

Don't beat yourself up and TBH, its not that big of a deal for a local instance but if you plan on going internet facing then yeah, don't ever post your admin account info 🙂

 

Its been a while since I used NC but from memory, if you have no SQL server running then it will default to a local copy of SQLite which AFAIK shouldn't have resulted in this error at all.

 

When you installed did you check the box and manually enter any database server info?

Main Rig:-

Ryzen 7 3800X | Asus ROG Strix X570-F Gaming | 16GB Team Group Dark Pro 3600Mhz | Corsair MP600 1TB PCIe Gen 4 | Sapphire 5700 XT Pulse | Corsair H115i Platinum | WD Black 1TB | WD Green 4TB | EVGA SuperNOVA G3 650W | Asus TUF GT501 | Samsung C27HG70 1440p 144hz HDR FreeSync 2 | Ubuntu 20.04.2 LTS |

 

Server:-

Intel NUC running Server 2019 + Synology DSM218+ with 2 x 4TB Toshiba NAS Ready HDDs (RAID0)

Link to comment
Share on other sites

Link to post
Share on other sites

22 minutes ago, Master Disaster said:

Don't beat yourself up and TBH, its not that big of a deal for a local instance but if you plan on going internet facing then yeah, don't ever post your admin account info 🙂

 

Its been a while since I used NC but from memory, if you have no SQL server running then it will default to a local copy of SQLite which AFAIK shouldn't have resulted in this error at all.

 

When you installed did you check the box and manually enter any database server info?

Yeah, thanks 🙂

 

No, I just stayed with the basic options (network, jail name)

Link to comment
Share on other sites

Link to post
Share on other sites

35 minutes ago, potatoPCguy said:

Yeah, thanks 🙂

 

No, I just stayed with the basic options (network, jail name)

Then I'm not sure there's much we can do to help. I suspect the version of NC for TrueNAS has been modified to run on a NAS environment (its pretty common for that to be the case).

 

The error you posted in OP suggests it managed to create a database fine but crapped out after it had already created it when trying to add the admin user to it. Since you had no input in that process I'm not sure how you could possibly fix it plus as I mentioned, with SQLite this type of error should not be possible.

 

I'd suggest either asking on the TrueNAS support site and/or NextCloud support site.

Main Rig:-

Ryzen 7 3800X | Asus ROG Strix X570-F Gaming | 16GB Team Group Dark Pro 3600Mhz | Corsair MP600 1TB PCIe Gen 4 | Sapphire 5700 XT Pulse | Corsair H115i Platinum | WD Black 1TB | WD Green 4TB | EVGA SuperNOVA G3 650W | Asus TUF GT501 | Samsung C27HG70 1440p 144hz HDR FreeSync 2 | Ubuntu 20.04.2 LTS |

 

Server:-

Intel NUC running Server 2019 + Synology DSM218+ with 2 x 4TB Toshiba NAS Ready HDDs (RAID0)

Link to comment
Share on other sites

Link to post
Share on other sites

23 hours ago, Master Disaster said:

Then I'm not sure there's much we can do to help. I suspect the version of NC for TrueNAS has been modified to run on a NAS environment (its pretty common for that to be the case).

 

The error you posted in OP suggests it managed to create a database fine but crapped out after it had already created it when trying to add the admin user to it. Since you had no input in that process I'm not sure how you could possibly fix it plus as I mentioned, with SQLite this type of error should not be possible.

 

I'd suggest either asking on the TrueNAS support site and/or NextCloud support site.

Okay, thank you anyways. I'll try getting help on the Nextcloud and TrueNAS Forums or Support.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×