Nextcloud won't accept password

I have been running Nextcloud in Docker for about a year without much issue but when I went to sign in to the webui the other day it said invalid username and password. I thought this strange because I use Bitwarden as a password manager so that ruled out forgotten password or a typo. So I click on forgot password and it says it sent me an email but I never received it. Checked spam and everything but no email.

So I do some research today and find that you can run a occ command through the console and reset the password. When I tried it, it says the password has been set… but Nextcloud still won’t accept my login. I have reset it 3 times via the console with very simple passwords making sure I am not mistyping them, but no luck.

How can resolve this and regain access?

youre not really providing much information about your environment and setup… so i can only make a very basic guess:
have you tried restarting your docker AND the machine it’s running on?

I am running Nextcloud in a Docker container in my unRAID server. If you are unfamiliar, unRAID is a NAS software. I have restarted both the Docker container and the machine multiple times.
My hardware is as follows:

M/B: Supermicro - X9DRH-7TF
CPU: 2 x Intel® Xeon® CPU E5-2670 0 @ 2.60GHz
Memory: 48 GB Multi-bit ECC (max. installable capacity 256 GB)
Kernel: Linux 4.18.20-unRAID x86_64

Let me know if you need any further info.

Anyone? My Nextcloud is essentially useless to me like this.

Further update - My wife tried logging into the webui and it wouldn’t accept her login either. The Android app was still working for her with the sign in remembered. She tried the forgot password link and also never received an email. So I then tried the occ command for her user and reset the password. Nextcloud won’t accept her new password either and the Android app now stopped working too.

Here are the logs:

nginx-access.log
nginx-error.log
php-error.log

I’m seeing errors in your nginx log saying stat failed. That usually means you have an issue pertaining to the file system. Is it full or corrupt? Have permissions been changed?

Not that I’m aware of.

I’m not well versed on LInux or the inner workings of Nextcloud. I instealled from a simple Docker template and it got up and running pretty easily. I’m not out of space and I didn’t change any permissions. With that said what should the permissions be?

Browsing the /var/www/nextcloud directory with Krusader and all the files look like they’re rw- permissions.

Here is the output of ls -l:

drwxrwxr-x 32 nobody users 4096 May 16 18:22 3rdparty/
-rw-rw-r-- 1 nobody users 12063 May 16 18:21 AUTHORS
-rw-rw-r-- 1 nobody users 34520 May 16 18:21 COPYING
drwxrwxr-x 43 nobody users 4096 May 16 18:34 apps/
drwxrwxr-x 2 nobody users 66 May 16 18:34 config/
-rw-rw-r-- 1 nobody users 3805 May 16 18:21 console.php
drwxrwxr-x 23 nobody users 4096 May 16 18:21 core/
-rw-rw-r-- 1 nobody users 4986 May 16 18:22 cron.php
-rw-rw-r-- 1 nobody users 156 May 16 18:22 index.html
-rw-rw-r-- 1 nobody users 3172 May 16 18:22 index.php
drwxrwxr-x 6 nobody users 125 May 16 18:21 lib/
-rw-rw-r-- 1 nobody users 283 May 16 18:21 occ
drwxrwxr-x 2 nobody users 23 May 16 18:22 ocm-provider/
drwxrwxr-x 2 nobody users 55 May 16 18:21 ocs/
drwxrwxr-x 2 nobody users 23 May 16 18:21 ocs-provider/
-rw-rw-r-- 1 nobody users 2951 May 16 18:22 public.php
-rw-rw-r-- 1 nobody users 5139 May 16 18:22 remote.php
drwxrwxr-x 4 nobody users 107 May 16 18:22 resources/
-rw-rw-r-- 1 nobody users 26 May 16 18:21 robots.txt
drwxrwxr-x 12 nobody users 248 May 16 18:21 settings/
-rw-rw-r-- 1 nobody users 2232 May 16 18:22 status.php
drwxrwxr-x 3 nobody users 35 May 16 18:21 themes/
drwxrwxr-x 2 nobody users 43 Jul 23 2018 updater/
-rw-rw-r-- 1 nobody users 362 May 16 18:21 version.php

You have a lot of SQL connection refused errors too. Are you able to connect with mysql to verify it’s up?

It looks like it. I am able to view the tables.

Any ideas what else I can look at. I haven’t been able to use Nextcloud for about a week and my family’s photos aren’t being synced. I really need to find a way to fix this.

What container configuration are you using?

I used the template from LinuxServer.io

Hi bozrdang,

Please could you check for the mysql.log which is usually located at /var/log/mysql/ and upload that as well? (Please check the file before you upload it, as it could contain the initial root password!)

As @KarlF12 already mentioned, you have many MySQL server has gone away messages in your nginx-error.log - The MySQL Documentation says that the most common reason for this is that the server timed out. If we have the mysql.log we could compare the time/date of the error in your nginx-error.log and mysql.log to see what the problem is.

Also as @KarlF12 noticed, there a lot of Connection refused messages. This could be due to the database user, you use in your Nextcloud config , being blocked on the database. Again the mysql.log would shed some light on this, as this log file should also log the connection/login attempts and tell us more about the issue.

Thanks for the reply! I am a bit stumped on finding the log. I am running MariaDB also in a Docker container. If I go to /va/log/mysql/ I see files like mariadb-bin.000188. And there contents are mostly gibberish:

þbinèQh] ü 10.3.17-MariaDB-1:10.3.17+maria~bionic-log èQh]8
ä üÝèQh]£ + + Ã;9 °q èQh]¡ - X mariadb-bin.000186¬i­éQh]¢ * ‚ Ä;9 “}éQh] ¸ : UPDATE oc_jobs SET reserved_at = ‘1567117801’, last_checked = ‘1567117801’ WHERE (id = ‘1’) AND (reserved_at = ‘0’) AND (last_checked = ‘1567116901’)E£ºéQh] A { nextcloud aoc_jobs aýà.8Ñ}§éQh] ² - aÿÿ€ ’ OCA\NextcloudAnnouncements\Cron\Crawler nullmtg]eNh] € ’ OCA\NextcloudAnnouncements\Cron\Crawler nullmtg]éQh]éQh] p‚ô.éQh] L Õµc%éQh]¢ * v Å;9 ǸIéQh] N Ä UPDATE oc_jobs SET reserved_at = ‘0’ WHERE id = 1aéúéQh] A nextcloud aoc_jobs aýà.8(
ÌéQh] ² · aÿÿ€ ’ OCA\NextcloudAnnouncements\Cron\Crawler nullmtg]éQh]éQh] € ’ OCA\NextcloudAnnouncements\Cron\Crawler nullmtg]éQh] GؐçéQh] Ö a ºL£éQh]¢ * Æ;9 Óòí#éQh] Ÿ Ÿ UPDATE oc_appconfig SET configvalue = ‘1’ WHERE (appid = ‘backgroundjob’) AND (configkey = ‘lastjob’) AND (configvalue <> ‘1’)“RÁéQh] C â nextcloud oc_appconfig üÀ €aQléQh] \ > ÿÿø backgroundjobalastjob 140ø backgroundjobalastjob 1FØé‘éQh] ] îÉ{ÖéQh]¢ * ‡ Ç;9 ¸kÏéQh] ¸ ?a UPDATEoc_jobsSETreserved_at= '1567117801',last_checked= '1567117801' WHERE (id= '2') AND (reserved_at= '0') AND (last_checked= '1567116901')&’M\éQh] A €a nextcloud aoc_jobs aýà.8¹NäeéQh] ¼ < aÿÿ€ , OCA\Files_Trashbin\BackgroundJob\ExpireTrash null]Gh]eNh] € , OCA\Files_Trashbin\BackgroundJob\ExpireTrash null]Gh]éQh]éQh] „ÔUOéQh] [ •‰z–éQh]¢ * … È;9 ÅÈ¢~éQh] R × UPDATEoc_jobsSETlast_run= 1567117801 WHEREid= 2I‘š$éQh] A nextcloud aoc_jobs aýà.8}ƒ¯¶éQh] ¼ Ô aÿÿ€ , OCA\Files_Trashbin\BackgroundJob\ExpireTrash null]Gh]éQh]éQh] € , OCA\Files_Trashbin\BackgroundJob\ExpireTrash nulléQh]éQh]éQh] FÚ{¡éQh] ó ‚ÙúéQh]¢ * É;9 øM©éQh] N k UPDATEoc_jobsSETreserved_at= '0' WHEREid` = 2G

I do not see a mysql.log anywhere

mariadb-bin.000188 is a binary log file from the database. This however only contains data but no logs as such.

Did you get the MySQL / MariaDB Docker from your above source LinuxServer.io as well?

Yes I did.

Ok, I had a look, they changed the log directory to /config/log/mysql (on the docker hub website it says /config/log/myqsl which is probably a typo)

If in doubt, you can always run ls -lah /config/log to see the content of that folder structure

It was indeed a typo but as you can see in /config/log/mysql there are just those files I mentioned earlier.

# ls -lah /config/log/mysql

total 196M
drwxrwxrwx 2 abc users 161 Sep 5 10:16 .
drwxr-xr-x 3 abc users 19 Jul 24 2018 …
-rw-rw---- 1 abc users 94M Aug 28 15:32 mariadb-bin.000184
-rw-rw---- 1 abc users 23M Aug 29 18:29 mariadb-bin.000185
-rw-rw---- 1 abc users 43M Sep 2 11:47 mariadb-bin.000186
-rw-rw---- 1 abc users 298K Sep 2 13:31 mariadb-bin.000187
-rw-rw---- 1 abc users 33M Sep 5 11:30 mariadb-bin.000188
-rw-rw---- 1 abc users 185 Sep 2 13:31 mariadb-bin.index