Cannot login to Nextcloud with correct admin password

  • Nextcloud Server version : 31.0.2
  • Operating system and version: Ubuntu 22.04.5 LTS (GNU/Linux 5.15.0-1073-raspi aarch64)
  • Web server and version: Nginx 1.18.0
  • PHP version: 8.3

After upgrade from 30.0.6.2 to 31.0.2 i received error in my browser:
Downgrading is not supported and is likely to cause unpredictable issues (from 31.0.2 to 30.0.6.2)

I restarted php-FPM service and the problem disappeared.

But then, a new problem appeared:
Cannot login to nextcloud with a valid admin user/password. The login page is merely reloaded. No user is able to log in.

I tried resetting the password for the account, but it didn’t help.

My problem is similar to this topic. But the topic is already closed and there is no solution there

how to fix this?

Log entries

Nextcloud

{"reqId":"llVoGC9oaQETMsfioRAB","level":2,"time":"2025-03-22T20:18:44+00:00","remoteAddr":"192.168.1.1","user":false,"app":"no app in context","method":"GET","url":"/login?direct=1&user=---","message":"Capabilities of OCA\\CloudFederationAPI\\Capabilities took 0.54 seconds to generate.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0","version":"31.0.2.1","data":[]}

Web server /var/log/nginx/access.log

192.168.1.1 - - [23/Mar/2025:00:12:07 +0300] "POST /login HTTP/1.1" 303 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0"
192.168.1.1 - - [23/Mar/2025:00:12:07 +0300] "GET /login?direct=1&user=--- HTTP/1.1" 200 7938 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0"

Configuration

Nextcloud config.php

<?php
$CONFIG = array (
  'instanceid' => '----',
  'passwordsalt' => '-------',
  'secret' => '-------------',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'cloud.myhost.domain',
    2 => '192.168.1.9',
  ),
  'datadirectory' => '/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '31.0.2.1',
  'default_phone_region' => 'EN',
  'overwritehost' => 'cloud.myhost.domain',
  'overwriteprotocol' => 'https',
  'dbname' => 'dbname',
  'dbhost' => '127.0.0.1:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'dbuser',
  'dbpassword' => 'pass',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Memcached',
  'memcached_servers' =>
  array (
    0 =>
    array (
      0 => '127.0.0.1',
      1 => 11211,
    ),
  ),
  'overwrite.cli.url' => 'https://192.168.1.9',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'adm',
  'mail_domain' => 'mail.domain',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'mail.host',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'email',
  'mail_smtppassword' => 'pass',
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' =>
  array (
    0 => 'test',
  ),
  'twofactor_enforced_excluded_groups' =>
  array (
  ),
  'app_install_overwrite' =>
  array (
    0 => 'twofactor_gateway',
    1 => 'admin_notifications',
    2 => 'bruteforcesettings',
  ),
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'simpleSignUpLink.shown' => false,
  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\TXT',
    1 => 'OC\\Preview\\MarkDown',
    2 => 'OC\\Preview\\OpenDocument',
    3 => 'OC\\Preview\\PDF',
    4 => 'OC\\Preview\\MSOffice2003',
    5 => 'OC\\Preview\\MSOfficeDoc',
    6 => 'OC\\Preview\\Image',
    7 => 'OC\\Preview\\Photoshop',
    8 => 'OC\\Preview\\TIFF',
    9 => 'OC\\Preview\\SVG',
    10 => 'OC\\Preview\\Font',
    11 => 'OC\\Preview\\MP3',
    12 => 'OC\\Preview\\Movie',
    13 => 'OC\\Preview\\MKV',
    14 => 'OC\\Preview\\MP4',
    15 => 'OC\\Preview\\AVI',
    16 => 'OC\\Preview\\HEIC',
  ),
  'updater.release.channel' => 'stable',
  'maintenance_window_start' => 1,
);

Did you search/see?

Here only reboot was needed.

I tried rebooting, it didn’t help

I turned on the advanced logging level and saw an error related to the bruteforce module

Nextcloud

{"reqId":"oDdM1rF1JTtgOI9qBQEE","level":0,"time":"2025-03-23T07:23:17+00:00","remoteAddr":"192.168.1.1","user":false,"app":"no app in context","method":"POST","url":"/login","message":"Logging out","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0","version":"31.0.2.1","data":{"user":"null"}}
{"reqId":"wEQnmb1DnpIYQz033aL1","level":0,"time":"2025-03-23T07:23:17+00:00","remoteAddr":"192.168.1.1","user":false,"app":"bruteForce","method":"GET","url":"/login?direct=1&user=----","message":"The loading of lazy AppConfig values have been triggered by app \"bruteForce\"","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0","version":"31.0.2.1","exception":{"Exception":"RuntimeException","Message":"The loading of lazy AppConfig values have been triggered by app \"bruteForce\"","Code":0,"Trace":[{"file":"/data/www/nextcloud/lib/private/AppConfig.php","line":1193,"function":"loadConfig","class":"OC\\AppConfig","type":"->"},{"file":"/data/www/nextcloud/lib/private/AppConfig.php","line":106,"function":"loadConfigAll","class":"OC\\AppConfig","type":"->"},{"file":"/data/www/nextcloud/lib/private/Security/Ip/BruteforceAllowList.php","line":39,"function":"getKeys","class":"OC\\AppConfig","type":"->"},{"file":"/data/www/nextcloud/lib/private/Security/Bruteforce/Throttler.php","line":86,"function":"isBypassListed","class":"OC\\Security\\Ip\\BruteforceAllowList","type":"->"},{"file":"/data/www/nextcloud/lib/private/Security/Bruteforce/Throttler.php","line":112,"function":"isBypassListed","class":"OC\\Security\\Bruteforce\\Throttler","type":"->"},{"file":"/data/www/nextcloud/lib/private/Security/Bruteforce/Throttler.php","line":129,"function":"getAttempts","class":"OC\\Security\\Bruteforce\\Throttler","type":"->"},{"file":"/data/www/nextcloud/core/Controller/LoginController.php","line":153,"function":"getDelay","class":"OC\\Security\\Bruteforce\\Throttler","type":"->"},{"file":"/data/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":200,"function":"showLoginForm","class":"OC\\Core\\Controller\\LoginController","type":"->"},{"file":"/data/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/data/www/nextcloud/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/data/www/nextcloud/lib/private/Route/Router.php","line":307,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/data/www/nextcloud/lib/base.php","line":1025,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/data/www/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/data/www/nextcloud/lib/private/AppConfig.php","Line":1208,"message":"The loading of lazy AppConfig values have been triggered by app \"bruteForce\"","exception":{},"CustomMessage":"The loading of lazy AppConfig values have been triggered by app \"bruteForce\""}}

And if you disable the app? Login possible?

I did:

  1. Added trusted proxy IP:192.168.1.1 since my router acts as a reverse proxy and all requests to the NC come from one IP

config.php

  'trusted_proxies' =>
  array (
    0 => '192.168.1.1',
  ),
  1. Disable brute force

config.php

'auth.bruteforce.protection.enabled' => false,
  1. Restart php-fpm.

But nothing has changed, the same entry log file, I can’t login into the interface

It is important to note that those users who authenticated before the update still have access to the NC

Did you try different browsers or deleting the cache?

Yes, I deleted cookies, used different browsers, it doesn’t help

Please check the web console as described in the support template, while attempting to log in.

Also, do you have any errors or warnings under Admin settings-Overview?

Lastly, is there a reason you’re using both Redis and MemcacheD? That is unusual.

  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Memcached',
  'memcached_servers' =>
  array (
    0 =>
    array (
      0 => '127.0.0.1',
      1 => 11211,
    ),
  ),
  'overwrite.cli.url' => 'https://192.168.1.9',
  'memcache.locking' => '\\OC\\Memcache\\Redis',

All requests is green 200 answers

POST
	https://cloud.domain/login
Status
303
Version HTTP/2
Transfered 8,71 kB (size 19,06 kB)
Referrer policysame-origin
Request priority Highest


	
cache-control
	no-cache, no-store, must-revalidate
content-length
	0
content-security-policy
	default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'
content-type
	text/html; charset=UTF-8
date
	Sun, 23 Mar 2025 19:38:01 GMT
feature-policy
	autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'
location
	/login?direct=1&user=useradmin
referrer-policy
	no-referrer
server
	Web server
set-cookie
	nc_username=deleted; expires=Thu, 01 Jan 1970 00:00:01 GMT; Max-Age=0; secure; HttpOnly
set-cookie
	nc_token=deleted; expires=Thu, 01 Jan 1970 00:00:01 GMT; Max-Age=0; secure; HttpOnly
set-cookie
	nc_session_id=deleted; expires=Thu, 01 Jan 1970 00:00:01 GMT; Max-Age=0; secure; HttpOnly
set-cookie
	nc_username=deleted; expires=Thu, 01 Jan 1970 00:00:01 GMT; Max-Age=0; path=/; secure; HttpOnly
set-cookie
	nc_token=deleted; expires=Thu, 01 Jan 1970 00:00:01 GMT; Max-Age=0; path=/; secure; HttpOnly
set-cookie
	nc_session_id=deleted; expires=Thu, 01 Jan 1970 00:00:01 GMT; Max-Age=0; path=/; secure; HttpOnly
set-cookie
	och6fk1nru65=fl2t402n2688kbpnh4srn825se; path=/; secure; HttpOnly; SameSite=Lax
strict-transport-security
	max-age=15552000; includeSubDomains; preload;
x-content-type-options
	nosniff
x-download-options
	noopen
X-Firefox-Spdy
	h2
x-frame-options
	SAMEORIGIN
x-permitted-cross-domain-policies
	none
x-request-id
	mfKfV3mauiSFAWYdvdu5
x-robots-tag
	noindex, nofollow
x-robots-tag
	noindex, nofollow
x-xss-protection
	1; mode=block
	
Accept
	text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding
	gzip, deflate, br, zstd
Accept-Language
	en-US,en;q=0.5
Connection
	keep-alive
Content-Length
	229
Content-Type
	application/x-www-form-urlencoded
Cookie
	oc_sessionPassphrase=hI6kvhPFJIo74OM9mi5W0dfqaZcvmuLPqPQSa3jSE3CSs5HycVHdTuAwB1xG2VOT2QiLRdKVWGfvk0SVVl%2BK8txRWpTuKIzHTv0k9CyhDCc6vYtRkT66t%2FJNFuh%2BpB1U; __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; och6fk1nru65=ejueah6r51t2tuemjiofna5v1q
Host
	cloud.domain
Origin
	https://cloud.domain
Priority
	u=0, i
Referer
	https://cloud.domain/login?direct=1&user=useradmin
Sec-Fetch-Dest
	document
Sec-Fetch-Mode
	navigate
Sec-Fetch-Site
	same-origin
Sec-Fetch-User
	?1
TE
	trailers
Upgrade-Insecure-Requests
	1
User-Agent
	Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0
	
	
	
	
	
	
	
	
	
	
	
	
GET
	https://cloud.domain/login?direct=1&user=useradmin
Status
200
Version HTTP/2
Transfered 8,48 kB (размер 19,06 kB)
Referrer policyno-referrer
Request priority Highest


	
cache-control
	no-cache, no-store, must-revalidate
content-encoding
	gzip
content-length
	7238
content-security-policy
	default-src 'none';base-uri 'none';manifest-src 'self';script-src 'nonce-OgisRWRXSroct6PBc0kwJf0LLGxHmhRmGJ4gYY0LrqE=';script-src-elem 'strict-dynamic' 'nonce-OgisRWRXSroct6PBc0kwJf0LLGxHmhRmGJ4gYY0LrqE=';style-src 'self' 'unsafe-inline';img-src 'self' data: blob: https://*.tile.openstreetmap.org;font-src 'self' data:;connect-src 'self';media-src 'self';frame-src 'self';frame-ancestors 'self';form-action 'self'
content-type
	text/html; charset=UTF-8
date
	Sun, 23 Mar 2025 19:38:02 GMT
feature-policy
	autoplay 'self';camera 'none';fullscreen 'self';geolocation 'none';microphone 'none';payment 'none'
referrer-policy
	no-referrer
server
	Web server
set-cookie
	och6fk1nru65=fl2t402n2688kbpnh4srn825se; path=/; secure; HttpOnly; SameSite=Lax
strict-transport-security
	max-age=15552000; includeSubDomains; preload;
x-content-type-options
	nosniff
x-download-options
	noopen
X-Firefox-Spdy
	h2
x-frame-options
	SAMEORIGIN
x-permitted-cross-domain-policies
	none
x-request-id
	t81eWqFBGdG056echxvB
x-robots-tag
	noindex, nofollow
x-robots-tag
	noindex, nofollow
x-xss-protection
	1; mode=block
	
Accept
	text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding
	gzip, deflate, br, zstd
Accept-Language
	en-US,en;q=0.5
Connection
	keep-alive
Cookie
	oc_sessionPassphrase=hI6kvhPFJIo74OM9mi5W0dfqaZcvmuLPqPQSa3jSE3CSs5HycVHdTuAwB1xG2VOT2QiLRdKVWGfvk0SVVl%2BK8txRWpTuKIzHTv0k9CyhDCc6vYtRkT66t%2FJNFuh%2BpB1U; __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; och6fk1nru65=fl2t402n2688kbpnh4srn825se
Host
	cloud.domain
Priority
	u=0, i
Sec-Fetch-Dest
	document
Sec-Fetch-Mode
	navigate
Sec-Fetch-Site
	same-origin
Sec-Fetch-User
	?1
TE
	trailers
Upgrade-Insecure-Requests
	1
User-Agent
	Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0

Now I can’t get into the admin interface.

But before the update there was only one warning related to

The OPcache buffer is nearly full

I configured these parameters when installing the NC, about 2 years ago, or as a result of correcting warnings or recommendations in the window - Admin settings-Overview

Hello everyone!
Please tell me what else can I check?
Or will I have to reinstall NC?

hi!
check available disk space.
I had the same symptoms, then the database stopped responding and nextcloud started responding 500 and I found 0kb free space.

In the end, I did not wait for an answer.

I restored the configuration data and DB data from the backup.

Authorization works again. I will leave the version 30.0.6 for now

I highly recommend performing regular backup of the configuration and DB and having several copies of the backup so that it is possible to return to the latest working version of the NC

Disk space is OK

df -h
Filesystem                   Size  Used Avail Use% Mounted on
tmpfs                        781M  3.2M  778M   1% /run
/dev/mmcblk0p2                30G  7.1G   21G  26% /
tmpfs                        3.9G     0  3.9G   0% /dev/shm
tmpfs                        5.0M     0  5.0M   0% /run/lock
/dev/mmcblk0p1               253M  137M  116M  55% /boot/firmware
/dev/mapper/vg_data-lv_data  1.8T  266G  1.5T  16% /data
tmpfs                        781M  4.0K  781M   1% /run/user/1000

The database, NC and user files are located in /data

i have the same issue

Are you using Redis or Memcached for PHP session management? A session.save_path typo or password mistake will cause login loops.

Edit: by “password mistake” I don’t mean your NC pwd. I’m referring to how requirepass is defined in redis.conf and mismatches in other files.

I have the same problem:
I can login into NC, but when opening the Apps pages I only get an error.

Logfile tells me something like:

:{“Exception”:“RuntimeException”,“Message”:“The loading of lazy AppConfig values have been triggered by app "bruteForce"”

Also problem is:

sudo -u www-data php occ app:update --all

In File.php line 35:
[OCP\Files\GenericFileException]

app:update [–all] [–showonly] [–allow-unstable] [–] []

No Idea what crashed here:

{“reqId”:“1PIMcJmJTPPIFJTaoRQg”,“level”:3,“time”:“2025-04-01T09:11:19+00:00”,“remoteAddr”:“147.161.136.96”,“user”:“benjamin”,“app”:“index”,“method”:“GET”,“url”:“/nextcloud/index.php/settings/apps”,“message”:“Exception thrown: OCP\Files\GenericFileException”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0”,“version”:“31.0.2.1”,“exception”:{“Exception”:“OCP\Files\GenericFileException”,“Message”:“”,“Code”:0,“Trace”:[{“file”:“/var/www/domainname/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php”,“line”:55,“function”:“getContent”,“class”:“OC\Files\Node\File”,“type”:“->”},{“file”:“/var/www/domainname/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php”,“line”:138,“function”:“getContent”,“class”:“OC\Files\SimpleFS\SimpleFile”,“type”:“->”},{“file”:“/var/www/domainname/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php”,“line”:156,“function”:“get”,“class”:“OC\App\AppStore\Fetcher\Fetcher”,“type”:“->”},{“file”:“/var/www/domainname/nextcloud/lib/private/Installer.php”,“line”:381,“function”:“get”,“class”:“OC\App\AppStore\Fetcher\AppFetcher”,“type”:“->”},{“file”:“/var/www/domainname/nextcloud/apps/settings/lib/Controller/AppSettingsController.php”,“line”:205,“function”:“isUpdateAvailable”,“class”:“OC\Installer”,“type”:“->”},{“file”:“/var/www/domainname/nextcloud/apps/settings/lib/Controller/AppSettingsController.php”,“line”:93,“function”:“getAppsWithUpdates”,“class”:“OCA\Settings\Controller\AppSettingsController”,“type”:“->”},{“file”:“/var/www/domainname/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“line”:200,“function”:“viewApps”,“class”:“OCA\Settings\Controller\AppSettingsController”,“type”:“->”},{“file”:“/var/www/domainname/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“line”:114,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/domainname/nextcloud/lib/private/AppFramework/App.php”,“line”:161,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/domainname/nextcloud/lib/private/Route/Router.php”,“line”:307,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:“::”},{“file”:“/var/www/domainname/nextcloud/lib/base.php”,“line”:1025,“function”:“match”,“class”:“OC\Route\Router”,“type”:“->”},{“file”:“/var/www/domainname/nextcloud/index.php”,“line”:24,“function”:“handleRequest”,“class”:“OC”,“type”:“::”}],“File”:“/var/www/domainname/nextcloud/lib/private/Files/Node/File.php”,“Line”:35,“message”:“”,“exception”:{},“CustomMessage”:“Exception thrown: OCP\Files\GenericFileException”}}

root@Nextcloud:/var/www/domainname/nextcloud# sudo -u www-data php occ app:update --showonly -vvv

In File.php line 35:

[OCP\Files\GenericFileException]

Exception trace:
at /var/www/domainname/nextcloud/lib/private/Files/Node/File.php:35
OC\Files\Node\File->getContent() at /var/www/domainname/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php:55
OC\Files\SimpleFS\SimpleFile->getContent() at /var/www/domainname/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php:138
OC\App\AppStore\Fetcher\Fetcher->get() at /var/www/domainname/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php:156
OC\App\AppStore\Fetcher\AppFetcher->get() at /var/www/domainname/nextcloud/lib/private/Installer.php:381
OC\Installer->isUpdateAvailable() at /var/www/domainname/nextcloud/core/Command/App/Update.php:80
OC\Core\Command\App\Update->execute() at /var/www/domainname/nextcloud/3rdparty/symfony/console/Command/Command.php:326
Symfony\Component\Console\Command\Command->run() at /var/www/domainname/nextcloud/3rdparty/symfony/console/Application.php:1078
Symfony\Component\Console\Application->doRunCommand() at /var/www/domainname/nextcloud/3rdparty/symfony/console/Application.php:324
Symfony\Component\Console\Application->doRun() at /var/www/domainname/nextcloud/3rdparty/symfony/console/Application.php:175
Symfony\Component\Console\Application->run() at /var/www/domainname/nextcloud/lib/private/Console/Application.php:187
OC\Console\Application->run() at /var/www/domainname/nextcloud/console.php:87
require_once() at /var/www/domainname/nextcloud/occ:33

I think I was able to solve it:

sudo -u www-data php occ files:scan-app-data

solved it for me, now everything is working agin.

I have this problem too.
All versions are similar as in the description of this topic.
And the router also works as a proxy (Keenetic and its KeenDNS).
When downgrading to version 30.0.8, everything is OK.
On version 31.0.2 сannot login to Nextcloud with 100%-correct password.
I added ‘trusted_proxies’ and did everything I found, but the problem was not solved(

Please share it here if you have any information.

Thank you. I was having the same problem with a new instance running in docker behind a traefik proxy. I had added and configured a redis container for session storage and didn’t check that the config .php file had also been configured with memcache. I updated the config.php to use redis and it worked.