Cannot login to Nextcloud with correct admin password and no browser errors

Nextcloud version: 19.0.0 (19.0.0.12)
Operating system and version: Docker (nextcloud:latest) on x86_64 QNAP QTS (proprietary - based on Busybox)
Apache or nginx version: Apache 2.4.38 (Debian)
PHP version: 7.4.7

The issue you are facing:
Cannot login to nextcloud with a valid admin user/password, despite receiving a 200 from all request/responses for login. The login page is merely reloaded. No user is able to log in.

Is this the first time you’ve seen this error?: Y

Steps to replicate it:

  1. No idea what caused this or how to reproduce. At this point looking for help salvaging the installation.

The output of your Nextcloud log in Admin > Logging:

{"reqId":"cSJwjzRw8CuTDcWwku97","level":3,"time":"2020-06-27T04:12:08+00:00","remoteAddr":"10.255.0.2","user":"--","app":"index","method":"GET","url":"/apps/theming/js/theming?v=0","message":{"Exception":"OCP\\Files\\NotPermittedException","Message":"Could not create folder","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/AppData/AppData.php","line":157,"function":"newFolder","class":"OC\\Files\\Node\\Folder","type":"->","args":["icons"]},{"file":"/var/www/html/lib/private/Template/IconsCacher.php","line":90,"function":"newFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":["icons"]},{"function":"__construct","class":"OC\\Template\\IconsCacher","type":"->","args":[{"__class__":"OC\\Log"},{"__class__":"OC\\Files\\AppData\\Factory"},{"__class__":"OC\\URLGenerator"},{"__class__":"OC\\AppFramework\\Utility\\TimeFactory"}]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":84,"function":"newInstanceArgs","class":"ReflectionClass","type":"->","args":[[{"__class__":"OC\\Log"},{"__class__":"OC\\Files\\AppData\\Factory"},{"__class__":"OC\\URLGenerator"},{"__class__":"OC\\AppFramework\\Utility\\TimeFactory"}]]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":101,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":[{"name":"OC\\Template\\IconsCacher","__class__":"ReflectionClass"}]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":116,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OC\\Template\\IconsCacher"]},{"file":"/var/www/html/lib/private/ServerContainer.php","line":149,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OC\\Template\\IconsCacher",true]},{"file":"/var/www/html/lib/private/Server.php","line":1141,"function":"query","class":"OC\\ServerContainer","type":"->","args":["OC\\Template\\IconsCacher"]},{"file":"/var/www/html/3rdparty/pimple/pimple/src/Pimple/Container.php","line":118,"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/ServerContainer.php","line":124,"function":"offsetGet","class":"Pimple\\Container","type":"->","args":["OC\\Template\\SCSSCacher"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":388,"function":"query","class":"OC\\ServerContainer","type":"->","args":["OC\\Template\\SCSSCacher",true]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":71,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OC\\Template\\SCSSCacher",true]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":101,"function":"buildClass","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":[{"name":"OCA\\Theming\\Controller\\ThemingController","__class__":"ReflectionClass"}]},{"file":"/var/www/html/lib/private/AppFramework/Utility/SimpleContainer.php","line":116,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Theming\\Controller\\ThemingController"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":414,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Theming\\Controller\\ThemingController"]},{"file":"/var/www/html/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":385,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Theming\\Controller\\ThemingController"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":124,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Theming\\Controller\\ThemingController"]},{"file":"/var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Theming\\Controller\\ThemingController","getJavascript",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"theming.Theming.getJavascript"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"_route":"theming.Theming.getJavascript"}]},{"file":"/var/www/html/lib/private/Route/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"_route":"theming.Theming.getJavascript"}]},{"file":"/var/www/html/lib/base.php","line":1007,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/theming/js/theming"]},{"file":"/var/www/html/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/Files/Node/Folder.php","Line":165,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36 Edg/83.0.478.56","version":"19.0.0.12"}

Contents of config.php:

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'instanceid' => 'ocgcifrdrn29',
  'passwordsalt' => '<redacted>',
  'secret' => '<redacted>',
  'trusted_domains' => 
  array (
    0 => '*.<redacted>.com',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '19.0.0.12',
  'overwrite.cli.url' => 'https://nextcloud.<redacted>.com/',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => '',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '<redacted>',
  'installed' => true,
  'mail_from_address' => '<redacted>',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_domain' => '<redacted>',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.mailgun.org',
  'mail_smtpport' => '465',
  'mail_smtpname' => '<redacted>',
  'mail_smtppassword' => '<redacted>',
  'loglevel' => 0,
  'maintenance' => false,
  'updater.release.channel' => 'stable',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'theme' => '',
  'mail_sendmailmode' => 'smtp',
  'data-fingerprint' => 'a3c00f28821788328fa18764d5e05a8e',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
);

The output of your Apache/nginx/system log in /var/log/apache2:

10.255.0.2 - - [27/Jun/2020:04:25:16 +0000] "GET /csrftoken HTTP/1.1" 200 861 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36 Edg/83.0.478.56",
172.1.0.31 - - [27/Jun/2020:04:26:42 +0000] "GET /csrftoken HTTP/1.1" 200 804 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36 Edg/83.0.478.56",
172.1.0.31 - - [27/Jun/2020:04:27:39 +0000] "GET /csrftoken HTTP/1.1" 200 804 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36",
172.1.0.31 - - [27/Jun/2020:04:28:22 +0000] "GET /csrftoken HTTP/1.1" 200 805 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0",
172.1.0.31 - - [27/Jun/2020:04:31:08 +0000] "POST /login HTTP/1.1" 200 2244 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36 Edg/83.0.478.56",
172.1.0.31 - - [27/Jun/2020:04:31:08 +0000] "GET /core/js/oc.js?v=2fe48813 HTTP/1.1" 200 4554 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36 Edg/83.0.478.56",

Read

https://docs.nextcloud.com/server/19/admin_manual/configuration_user/reset_admin_password.html

I already tried that multiple times. I am not getting a password error, but just a refresh of the login screen. I do see one CRSF token request that fails followed by several that get 200 responses.

General:

  1. Request URL: https://nextcloud.[redacted].com/csrftoken
  2. Request Method: GET
  3. Status Code: 404
  4. Remote Address: [WAN_IP_ADDR]:443
  5. Referrer Policy: no-referrer

Response Headers

  1. content-length: 19
  2. content-type: text/plain; charset=utf-8
  3. date: Sat, 27 Jun 2020 03:15:40 GMT
  4. status: 404
  5. x-content-type-options: nosniff

Request Headers

  1. :authority: nextcloud.[redacted].com
  2. :method: GET
  3. :path: /csrftoken
  4. :scheme: https
  5. accept: 3./*
  6. accept-encoding: gzip, deflate, br
  7. accept-language: en-US,en;q=0.9
  8. cookie: nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; oc_sessionPassphrase=bG4wgs…So3oHrc1p1iaHb16wtwrr%2BOTkKxbw5m…; ocgcifrdrn29=98f663h2314b4dea1d2596611d1d745f
  9. dnt: 1
  10. ocs-apirequest: true
  11. requesttoken: iTcnc8SC8pbyl4RSCavy…
  12. sec-fetch-dest: empty
  13. sec-fetch-mode: cors
  14. sec-fetch-site: same-origin
  15. user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
  16. x-requested-with: XMLHttpRequest

Hmm. I presume these results from php occ integrity:check_core indicate at least part of the problem:

www-data@e3d96001468c:~/html$ php occ integrity:check-core     
  - INVALID_HASH:
    - .htaccess:
      - expected: 49b882eed84d95bc41965468746c9183a665...
      - current: cf83e1357eefb8bdf1542850d66d8007d620e4...
  - FILE_MISSING:
    - .user.ini:
      - expected: 4843b3217e91f8536cb9b52700efb20300290292cf6286f927...
      - current: 
    - 3rdparty/.github/workflows/composer.yml:
      - expected: 77f3ab0321bd5aec5bebdcfcfa7de6a6bc597cc3f29211d977...
      - current: 
    - 3rdparty/.gitignore:
      - expected: fd8ca5119be0337cc4b5a96703d9f6ef0dd677bb515bce49b...
      - current: 
    - 3rdparty/bantu/ini-get-wrapper/.gitignore:
      - expected: e4c45701324af2f6a7a5c175009f10e5a25742195eb3f1dce...
      - current: 
    - 3rdparty/bantu/ini-get-wrapper/.scrutinizer.yml:
      - expected: 9aa05974ccb80648f933f6a79f41dfc5641cac6143e8f07df7...
      - current: 
    - 3rdparty/christophwurst/id3parser/.gitignore:
      - expected: 7da59ba3dc117429fe7e7518645c45f99e61b4577c5cc3fc...
      - current: 
    - 3rdparty/doctrine/common/.doctrine-project.json:
      - expected: db937e91a38839bc053e58690582f0e78dc401d8ae3f52...
      - current: 
    - 3rdparty/doctrine/dbal/.appveyor.yml:
      - expected: db6c9eebb317386de94027b46039c7cf2446b00c525d22...
      - current: 
    - 3rdparty/doctrine/dbal/.scrutinizer.yml:
      - expected: 6af95eed62e075b56ad5436f633dc89756a2f54fddbac49...
      - current: 
    - 3rdparty/doctrine/event-manager/.scrutinizer.yml:
      - expected: 631db76407c793575f21c0d322456e0d4a2bf4be2657a8e...
      - current: 
    - 3rdparty/doctrine/persistence/.doctrine-project.json:
      - expected: 168a3d7dbcea56068978d3dbb80d207058dbcb600e87ce...
      - current: 
    - 3rdparty/icewind/searchdav/.gitignore:
      - expected: c4d4500e0ae8dcb011323521ff3307448a567988000af...
      - current: 
    - 3rdparty/icewind/streams/.gitignore:
      - expected: baeb9111886481c4cd957d65be49b8bd71bdaaef0aa...
      - current: 
    - 3rdparty/justinrainbow/json-schema/.gitattributes:
      - expected: b6b6f2fa90a8f5d034fb22ba1a4e0fdec9c2ec56272985f5...
      - current: 
    - 3rdparty/justinrainbow/json-schema/.php_cs.dist:
      - expected: 7b8fffc1185b43737c754ce86ac2cbed286f10e699bfed1c0...
      - current: 
    - 3rdparty/mtdowling/jmespath.php/.gitignore:
      - expected: 38e66ca6a96b6de68eb6a6395ed3225570f379090cf6e21c...
      - current: 
    - 3rdparty/nikic/php-parser/.gitattributes:
      - expected: e2c5bfb8ca7db400ab2dd48d195b920ea385ae80b20396ea...
      - current: 
    - 3rdparty/pear/archive_tar/.gitignore:
      - expected: 166ebe92723ae0d21f2fe8280f5e9d51c1d0a4da04bb036a1...
      - current: 
    - 3rdparty/pear/console_getopt/.gitignore:
      - expected: 7412d81f3252da93bd4ed0f865538eec9cf61083aad2e2...
      - current: 
    - 3rdparty/pear/pear_exception/.gitignore:
      - expected: 5429e2311180f529ea6eadcad18a294994c6920b6715a6572...
      - current: 
    - 3rdparty/php-opencloud/openstack/.gitignore:
      - expected: 6d2bca836e1a84e25eb543e4090d20ac3f6700a611e593338...
      - current: 
    - 3rdparty/php-opencloud/openstack/.php_cs.dist:
      - expected: 1b7e069ff9611fe78ac371c9806e19a981a035cb9ca89f5bd...
      - current: 
    - 3rdparty/php-opencloud/openstack/.scrutinizer.yml:
      - expected: cc06b81b5943c36936d7981d30276fb10c7da040675dc5...
      - current: 
    - 3rdparty/psr/container/.gitignore:
      - expected: ac6d1b2d42e8d9132f487d8e0184f9ff2e4050071ab839...
      - current: 
    - 3rdparty/psr/http-factory/.gitignore:
      - expected: ebda4c36879a0ae17ee3b9507163a8119ab8fac3659257...
      - current: 
    - 3rdparty/psr/http-factory/.pullapprove.yml:
      - expected: d011a1865aa7ef5f7690031f6851e6f5a057e90e21808...
      - current: 
    - 3rdparty/react/promise/.gitignore:
      - expected: 3fbb564fd8c8e725d0227f7624fa78614235b5fa399ed68fa61b12a3b...
      - current: 
    - 3rdparty/sabre/dav/.gitignore:
      - expected: 9dec50ae4ed54f30a8c5bf329210af7036cf9b388d6f99da9578026...
      - current: 
    - 3rdparty/sabre/http/.gitignore:
      - expected: b409c5298b33cabc714b9895abc6f54b58352a4a3feca537a493687e...
      - current: 
    - 3rdparty/sabre/uri/.gitignore:
      - expected: aae80787a95e6b3074e9ea005448a580f709b911e34294c1f48...
      - current: 
    - 3rdparty/sabre/vobject/.gitignore:
      - expected: c2af8470992d1b39480d91d48db09143285297726c55722013... 
    - 3rdparty/sabre/xml/.gitignore:
      - expected: 6183198481030456fc7015b30fb7cea3cf3c1b02c027638b9d9...
      - current: 
    - 3rdparty/swiftmailer/swiftmailer/.github/ISSUE_TEMPLATE.md:
      - expected: 6e29207b4bdc334157c5339e1a6b0d14a10453f4da7764406577b...
      - current: 
    - 3rdparty/swiftmailer/swiftmailer/.github/PULL_REQUEST_TEMPLATE.md:
      - expected: 6caa153cb8eb37017248c63b3ab15c4954aa91df4548d41b9364b...
      - current: 
    - 3rdparty/swiftmailer/swiftmailer/.php_cs.dist:
      - expected: 8c45e0b01320a3c250afeba78d6e609003cd24889c420475818c7a...
      - current: 
    - core/vendor/.gitignore:
      - expected: 674e0b00c9e48a94da19fd79ae8f56cec831f1d348d5e3e41edeacc52...
      - current: 
  - EXTRA_FILE:
    - core/img/filetypes/mindmap.svg:
      - expected: 
      - current: b04849532f10c52afc15112774c158464b4853b4224ff9a7b8f650d0c...

The question is where to go from here?

Are you using CGI or FastCGI Application for PHP? I changed to FPM Application served by Apache and it resolved the issue for me. However, this is not a fix, as it normally should work with FastCGI and CGI. I am still looking for a way to make my NextCloud (latest stable) work with CGI and FastCGI.

Hello @gkoerk @canadamcpherson ,

I currently have the same problem, have you found a solution without having to install the FPM?

I had the same error, in my case the disk that nextcloud was installed on was at 100% disk usage due to a wrong copy command i used earlier. Worth checking your disk usage (df -h) if anyone has the same problem.

I’m getting this too. It’s annoying.

Surely there should be a check to inform the user of a timeout rather than just a login loop

Im suddenly having the same problem. Any time I try and login it’s like the page just reloads and nothing happens. My disk is only 47% full.

Same problem. Nexcloud 25.0.3.2 on CoreElec (docker.linuxserver.nextcloud), it worked fine till today. No errors, nothing in the logs, disk space is available.

Resetting the user’s password via occ did not help.

Has anyone else found ways to solve the issue?

UPDATE: I noticed that I could login using another browser, after which it became evident that the problem was with the cookies. And indeed, after clearing them, I can now login again. Hopefully this will help someone else. :slight_smile: