Cannot login to Owncloud X after a fresh install

I’m not able to login with my user after a fresh installation of owncloud.

Steps to reproduce

  1. Install dependencies, as well as configure the desired database.
  2. Make a fresh install of Owncloud X. I’ve used the following command:

    sudo -u www-data php occ maintenance:install --database “mysql” --database-name “owncloud” --database-user “owncloud” --database-pass “XX” --admin-user “myuser” --admin-pass “Mypass1234$”

  3. Configure Apache to access owncloud via a subdomain.

Expected behaviour

Login with ‘myuser’ and enter to the web interface of owncloud.

Actual behaviour

When it comes to login with your user, you get a message “Ha tardado demasiado en logearse. por favor inténtelo de nuevo”, which in english would be something similar to “you took too long to login, please try again now”.

Server configuration

Operating system: Ubuntu 16.04 LTS

Web server: Apache/2.4.18 (Ubuntu)

Database: mysql Ver 8.0.11 for Linux on x86_64 (MySQL Community Server - GPL)

PHP version: PHP 7.0.30-0ubuntu0.16.04.1 (cli) ( NTS )

ownCloud version: 10.0.8

Updated from an older ownCloud or fresh install: Fresh install

Where did you install ownCloud from: Repository

Signing status (ownCloud 9.0 and above):

Cannot login...

The content of config/config.php:

{
    "system": {
        "updatechecker": false,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "owncloud.mydomain.com"
        ],
        "datadirectory": "\/var\/www\/owncloud\/data",
        "overwrite.cli.url": "https:\/\/owncloud.mydomain.com",
        "dbtype": "mysql",
        "version": "10.0.8.5",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "instanceid": "oc0qyj9xl4u2"
    }
}

List of activated apps:

Enabled:
  - comments: 0.3.0
  - configreport: 0.1.1
  - dav: 0.3.2
  - federatedfilesharing: 0.3.1
  - federation: 0.1.0
  - files: 1.5.1
  - files_external: 0.7.1
  - files_sharing: 0.10.1
  - files_trashbin: 0.9.1
  - files_versions: 1.3.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - market: 0.2.4
  - notifications: 0.3.3
  - provisioning_api: 0.5.0
  - systemtags: 0.3.0
  - updatenotification: 0.2.1
Disabled:
  - encryption
  - external
  - theme-example
  - user_external

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

Are you using encryption: As long as I know, I’m not using any kind of encryption (I guess it’s related to the data actually)

Are you using an external user-backend, if yes which one: No, users are stored within the database.

LDAP configuration (delete this part if not used)

None

Client configuration

Browser: Google Chrome 67.0.3396.62 (Build oficial) (64 bits)

Operating system: Windows 10 64 bits

Logs

Web server error log

No errors are logged in.

ownCloud log (data/owncloud.log)

{"reqId":"WDTcoEZ8Qa1S660CpS1L","level":3,"time":"2018-06-06T13:07:12+00:00","remoteAddr":"","user":"--","app":"mysql.setup","method":"--","url":"--","message":"Specific user creation failed: An exception occurred while executing 'SELECT user FROM mysql.user WHERE user=?
' with params [\"oc_myuser\"]:\n\nSQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user 'owncloud'@'localhost' for table 'user'"}
{"reqId":"WDTcoEZ8Qa1S660CpS1L","level":3,"time":"2018-06-06T13:07:57+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"--","url":"--","message":"User backend OC\\User\\Database is returning home: \/var\/www\/owncloud\/data\/myuser for user: ingart
ek which differs from existing value: "}
{"reqId":"eeWWvGstaobrVmgbV2hM","level":2,"time":"2018-06-06T13:08:48+00:00","remoteAddr":"192.168.1.1","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"192.168.1.1\" tried to access using \"owncloud.mydomain.com\" as host."}
{"reqId":"weDQFbAVCFoZh00txil1","level":2,"time":"2018-06-06T13:08:48+00:00","remoteAddr":"192.168.1.1","user":"--","app":"core","method":"GET","url":"\/","message":"Trusted domain error. \"192.168.1.1\" tried to access using \"owncloud.mydomain.com\" as host."}
{"reqId":"waSeXutnBYuC2gMBC1YF","level":2,"time":"2018-06-06T13:08:49+00:00","remoteAddr":"192.168.1.1","user":"--","app":"core","method":"GET","url":"\/index.php\/core\/js\/oc.js?v=c29615750e4e7283d8655e0038a0ac0c","message":"Trusted domain error. \"192.168.1.1\" tried
to access using \"owncloud.mydomain.com\" as host."}
{"reqId":"DDNKvEH8jOtJN1A2497t","level":2,"time":"2018-06-06T13:08:49+00:00","remoteAddr":"192.168.1.1","user":"--","app":"core","method":"GET","url":"\/cron.php","message":"Trusted domain error. \"192.168.1.1\" tried to access using \"owncloud.mydomain.com\" as host."}
{"reqId":"7Sah419BGAYPKzFhJPwR","level":3,"time":"2018-06-06T13:45:57+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"--","url":"--","message":"User backend OC\\User\\Database is returning home: \/var\/www\/owncloud\/data\/joninazio for user: jonin
azio which differs from existing value: "}

Browser log

No errors where thrown to console.

PS: I created a new user using command line interface, and I also tried to login with bad credentials.

Can you try to login with https instead of http?

I have searched this forum for a similar issue and that seems to help.

I’m redirecting all the HTTP (80) traffic to HTTPS (443). So, you can type in your browser http://owncloud.mydomain.com, but the server redirects your requests to https://owncloud.mydomain.com

Is this, perhaps, the issue?

maybe. can you try removing this configuration and see if the problem persists?

Try to use the mysql’s root account during ownCloud installation. It should create automatically a custom user with enough privileges over the DB. That should take care of the access problem to the DB.

For the trusted domain error, double check you’re editing the right configuration file. Either the host isn’t in the trusted domain list of the configuration, or ownCloud isn’t installed

Thanks @jvillafanez, I’ll reinstall owncloud with mysql’s root account.

The domain owncloud.mydomain.com is actually added to my config/config.php file, but I’ll double check it before reinstalling owncloud.

I’ll report back with results.

I’ve made a fresh installation and run:

$ sudo -u www-data php occ maintenance:install --database mysql --database-name "owncloud" --database-user "root" --database-pass "XXX" --admin-user "myuser" --admin-pass "Mypass1234$"

ownCloud was successfully installed

I’ve opened data/owncloud.log and it contains:

{"reqId":"Z0MJ582dioQedj8SOy4Z","level":3,"time":"2018-06-07T07:39:39+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"--","url":"--","message":"User backend OC\\User\\Database is returning home: \/var\/www\/owncloud\/data\/myuser for user: myuser which differs from existing value: "}

That message is confiusing, what does it mean?

Edit: Same result…

I’ll try to install a fresh one with web interface.

It’s weird that I cannot install owncloud using the web installer, the same result as when I try to log in: I click on “Complete installation” and just afterwards the same page is loaded (with a little refresh).

Could you check with a default apache configuration in order to discard problems with the ownCloud code?

It seems to be a bug with my current php version… I’ve installed in another environment (ubuntu 18.04 LTS with PHP 7.2) and the installation was fine (including that HTTPS configuration).

Finally it worked!!! I updated PHP to 7.2 and no errors were thrown.