Login does not work but password is correct

Steps to reproduce

  1. Try to login with correct password.

Expected behaviour

Login accepted.

Actual behaviour

The login is not accepted but there is no error message “Wrong password. Reset it?” unless I actually do mistype the password. So I know that my password is correct.

Server configuration

Operating system: Debian GNU/Linux 9.0

Web server: Apache 2.4.25

Database: MySQL MariaDB 15.1

PHP version: 7.0.30

ownCloud version: 10.1.1

Updated from an older ownCloud or fresh install: Updated

Where did you install ownCloud from: Debian package

Signing status (ownCloud 9.0 and above): Cannot log in to get this.

The content of config/config.php:

{
    "system": {
        "instanceid": "oc1e0d67c158",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "www.malcolm.id.au"
        ],
        "datadirectory": "\/var\/www\/owncloud\/data",
        "3rdpartyroot": "\/var\/www\/owncloud\/",
        "3rdpartyurl": "\/3rdparty",
        "dbtype": "mysql",
        "version": "10.1.1.1",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "forcessl": true,
        "mail_smtpmode": "php",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "app.mail.imaplog.enabled": true,
        "app.mail.server-side-cache.enabled": true,
        "app.mail.transport": "php-mail",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "preview_libreoffice_path": "\/usr\/bin\/soffice",
        "theme": "",
        "maintenance": false,
        "overwritewebroot": "\/owncloud",
        "overwrite.cli.url": "\/owncloud",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "logfile": "\/var\/log\/owncloud.log",
        "loglevel": "2",
        "trashbin_retention_obligation": "auto",
        "updatechecker": false
    }
}

List of activated apps:

Enabled:
  - activity: 2.4.2
  - calendar: 1.6.2
  - comments: 0.3.0
  - configreport: 0.1.2
  - contacts: 1.5.5
  - dav: 0.4.0
  - federatedfilesharing: 0.3.1
  - federation: 0.1.0
  - files: 1.5.2
  - files_external: 0.7.1
  - files_pdfviewer: 0.11.0
  - files_sharing: 0.11.0
  - files_texteditor: 2.3.0
  - files_trashbin: 0.9.1
  - files_versions: 1.3.0
  - files_videoplayer: 0.9.9
  - firstrunwizard: 1.1.1
  - gallery: 16.1.1
  - market: 0.4.0
  - music: 0.9.5
  - notifications: 0.4.1
  - provisioning_api: 0.5.0
  - systemtags: 0.3.0
  - templateeditor: 0.4.0
  - updatenotification: 0.2.1
Disabled:
  - encryption
  - external
  - rainloop
  - tasks
  - user_external

Are you using external storage, if yes which one: No

Are you using encryption: No

Are you using an external user-backend, if yes which one: No

Client configuration

Browser: Chrome

Operating system: Mac OS

Logs

Web server error log

Nothing relevant.

ownCloud log (data/owncloud.log)

{"reqId":"NCpIcsbKYtcdpDlJGws9","level":2,"time":"2019-05-10T18:23:49+00:00","remoteAddr":"192.168.42.123","user":"terminus","app":"core","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/","message":"Login failed: 'terminus' (Remote IP: '192.168.42.123')"}
{"reqId":"NCpIcsbKYtcdpDlJGws9","level":2,"time":"2019-05-10T18:23:50+00:00","remoteAddr":"192.168.42.123","user":"--","app":"core","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/","message":"Login failed: 'terminus' (Remote IP: '192.168.42.123')"}

Browser log

Nothing relevant.

I increased the loglevel to DEBUG and there is some more information:

{"reqId":"q9B57JlhdRoU72IaDOJx","level":2,"time":"2019-05-13T04:31:03+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"terminus","app":"core","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/","message":"Login failed: 'terminus' (Remote IP: 'xxx.xxx.xxx.xxx')"} {"reqId":"q9B57JlhdRoU72IaDOJx","level":0,"time":"2019-05-13T04:31:03+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"terminus","app":"OC\\User\\BasicAuthModule::auth","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/","message":"Invalid password for username terminus, trying as email."} {"reqId":"q9B57JlhdRoU72IaDOJx","level":0,"time":"2019-05-13T04:31:03+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"terminus","app":"OC\\Authentication\\Token\\DefaultTokenProvider::invalidateToken","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/","message":"invalidating token 1d636250d80add81c89f2453e18a3c2f2fec42ae03a1bd23e37fac3dd6ea0f0d1f9ab051cb5d587056183dc05326f6deb365d7c8a13d1f1a6eda0b983a5547b9"} {"reqId":"q9B57JlhdRoU72IaDOJx","level":0,"time":"2019-05-13T04:31:05+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"--","app":"OC\\Authentication\\Token\\DefaultTokenProvider::getToken","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/","message":"token 1d636250d80add81c89f2453e18a3c2f2fec42ae03a1bd23e37fac3dd6ea0f0d1f9ab051cb5d587056183dc05326f6deb365d7c8a13d1f1a6eda0b983a5547b9 does not exist"} {"reqId":"q9B57JlhdRoU72IaDOJx","level":0,"time":"2019-05-13T04:31:05+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"--","app":"OC\\Authentication\\Token\\DefaultTokenProvider::getToken","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/","message":"token 9cb26d53af33efd928da1262d75fe57bb75ebac3361091e44051843ad5e7a9e1b5802d41ce29216efb3ed81a8b9609e498a68ed8a20e2b8bd0a41ab1ac5baaee does not exist"} {"reqId":"q9B57JlhdRoU72IaDOJx","level":0,"time":"2019-05-13T04:31:05+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"--","app":"OC\\User\\Session::login","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/","message":"regenerating session id for uid terminus, password set"} {"reqId":"q9B57JlhdRoU72IaDOJx","level":0,"time":"2019-05-13T04:31:05+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"--","app":"OC\\Authentication\\Token\\DefaultTokenProvider::getToken","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/","message":"token 9cb26d53af33efd928da1262d75fe57bb75ebac3361091e44051843ad5e7a9e1b5802d41ce29216efb3ed81a8b9609e498a68ed8a20e2b8bd0a41ab1ac5baaee does not exist"} {"reqId":"q9B57JlhdRoU72IaDOJx","level":0,"time":"2019-05-13T04:31:05+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"--","app":"OC\\User\\Session::validateToken","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/","message":"token 9cb26d53af33efd928da1262d75fe57bb75ebac3361091e44051843ad5e7a9e1b5802d41ce29216efb3ed81a8b9609e498a68ed8a20e2b8bd0a41ab1ac5baaee, not found"} {"reqId":"q9B57JlhdRoU72IaDOJx","level":2,"time":"2019-05-13T04:31:05+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"--","app":"core","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/","message":"Login failed: 'terminus' (Remote IP: 'xxx.xxx.xxx.xxx')"} {"reqId":"q9B57JlhdRoU72IaDOJx","level":0,"time":"2019-05-13T04:31:05+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"--","app":"no app in context","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/","message":"Current user is not logged in"} {"reqId":"e1c65744-d3aa-46a2-b753-cf161776bbc8","level":0,"time":"2019-05-13T04:31:08+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"terminus","app":"OC\\Authentication\\Token\\DefaultTokenProvider::updateToken","method":"PROPFIND","url":"\/owncloud\/remote.php\/dav\/files\/terminus\/","message":"updating token 4701, last check is now 1557692468"} {"reqId":"e1c65744-d3aa-46a2-b753-cf161776bbc8","level":0,"time":"2019-05-13T04:31:08+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"terminus","app":"OC\\Authentication\\Token\\DefaultTokenProvider::getToken","method":"PROPFIND","url":"\/owncloud\/remote.php\/dav\/files\/terminus\/","message":"token 32ed251eb3efda5a6f46e975c1422d0b7f25adc7bcd4966ad825de8f5bb4a7ccc7cc4c564b31b29468339417825cb62bff4cfaf9e0fad9541e4c315069c39071 does not exist"}

Make sure the apache user can write the session information in whatever directory is configured (https://www.php.net/manual/en/session.configuration.php#ini.session.save-path)
For ubuntu, this is usually in /var/lib/php/sessions/

root@cb9ed44221e6:/# ls -l /var/lib/php/sessions/
total 4
-rw------- 1 www-data www-data 1139 May 14 17:30 sess_djvvl1bt3o43v538g101ot1tl5

Thanks, I thought that you might have been right because the sessions directory had looked like this:

drwx-wx-wt 2 root root 4096 May 5 15:39 sessions

So I changed it to this:

drwx------ 2 www-data www-data 4096 May 5 15:39 sessions

But after restarting Apache there was no change. Any other ideas?

Make sure apache is trying to write there and not in other place. You can check the php.ini file used by apache to know where the sessions are being written. There should be files appearing in that location

/var/lib/php5/sessions in my case. Files are being saved there (even today) and they have the permissions www-data:www-data so I guess the ability to save session files is not the problem that is impeding me from logging in to ownCloud.

PHP version: 7.0.30
/var/lib/php5/sessions

There is something wrong there… why should php7 write in a php5 folder? Are you really using php7? Is it really “/var/lib/php5/sessions” the place where ownCloud is trying to write? Maybe you have other services using php5 in the same server, and those services are the ones writing there, not ownCloud.

Sorry it turns out that Apache is using PHP 5.4.4-14. Although PHP 7 is also installed, it’s only used on the command line.

php 5.4 isn’t supported from quite a long time. The problems might be caused by features not present in php 5.4, so you must upgrade the php version.
php 7.0 works with OC 10.1.1. Newer versions might require php 7.1, so I’d recommend you to upgrade to php 7.1 if possible (as said, php 7.0 is fine)

Thanks, removing PHP5 and ensuring Apache was using PHP7 worked!