Can't login by hostname since 10.5

Hi there! I’m a longtime OwnCloud user. First of all, let me take this chance to congratulate with the OwnCloud team for creating such a great software. I am managing a few installs and all of them are working flawlessly! :slight_smile:
This post is about my personal 10.6 community install, which is located at http://myhostname/owncloud. It’s been working like that for many years, but, after upgrading to 10.5 (10.6 now), such url does not work anymore. I can now only login by using the IP url http://192.168.1.1/owncloud.

Steps to reproduce

Not sure. Could it be related to having a “simple” hostname without any dot in it?

Expected behaviour

I would expect to login succesfully

Actual behaviour

Any login attempt receives a redirect back to the login page. In the log, two lines are written:

{"reqId":"X7229XtXww8nwU1aLSOQ","level":2,"time":"2020-12-30T00:06:29+00:00","remoteAddr":"192.168.1.2","user":"bodom","app":"core","method":"GET","url":"\/owncloud\/index.php\/settings\/admin?sectionid=general","message":"Login failed: 'admin' (Remote IP: '192.168.1.2')"}
{"reqId":"X7229XtXww8nwU1aLSOQ","level":2,"time":"2020-12-30T00:06:29+00:00","remoteAddr":"192.168.1.2","user":"--","app":"core","method":"GET","url":"\/owncloud\/index.php\/settings\/admin?sectionid=general","message":"Login failed: 'admin' (Remote IP: '192.168.1.2')"}

Server configuration

Operating system: Ubuntu GNU/Linux 20.04 LTS

Web server: Apache 2.4

Database: MySQL 8.0

PHP version: 7.4

ownCloud version: 10.6

Updated from an older ownCloud or fresh install: updated many times

Where did you install ownCloud from: tarball

Signing status (ownCloud 9.0 and above): No errors have been found.

The content of config/config.php:

{
    "basic": {
        "license key": "***REMOVED SENSITIVE VALUE***",
        "date": "Wed, 30 Dec 2020 00:12:23 +0000",
        "ownCloud version": "10.6.0.5",
        "ownCloud version string": "10.6.0",
        "ownCloud edition": "Community",
        "server OS": "Linux",
        "server OS version": "Linux myhostname 5.4.0-56-generic #62-Ubuntu SMP Mon Nov 23 19:20:19 UTC 2020 x86_64",
        "server SAPI": "apache2handler",
        "webserver version": "Apache\/2.4.41 (Ubuntu)",
        "hostname": "192.168.1.1",
        "logged-in user": "bodom"
    },
    "stats": {
        "users": {
            "Database": {
                "count": 1,
                "seen": 1,
                "logged in (30 days)": 1
            }
        },
        "groups": {
            "OC\\Group\\Database": 1
        }
    },
    "config": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "myhostname",
            "192.168.1.1"
        ],
        "datadirectory": "\/home\/data\/OwnCloud",
        "overwrite.cli.url": "http:\/\/myhostname\/owncloud",
        "dbtype": "mysql",
        "version": "10.6.0.5",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "maintenance": false,
        "loglevel": 2,
        "trashbin_retention_obligation": "7",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "php",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "updatechecker": true,
        "updater.server.url": "https:\/\/updates.owncloud.com\/server\/",
        "theme": "",
        "updater.secret": "***REMOVED SENSITIVE VALUE***",
        "has_rebuilt_cache": true
    },
    "integritychecker": {
        "passing": true,
        "enabled": true,
        "result": []
    },
    "core": {
        "backgroundjobs_mode": "cron",
        "installedat": "1440805542.686",
        "lastcron": "1491384604",
        "lastupdateResult": "[]",
        "lastupdatedat": "1609286980",
        "public_caldav": "calendar\/share.php",
        "public_calendar": "calendar\/share.php",
        "public_files": "files_sharing\/public.php",
        "public_gallery": "gallery\/public.php",
        "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php",
        "remote_caldav": "dav\/appinfo\/v1\/caldav.php",
        "remote_calendar": "dav\/appinfo\/v1\/caldav.php",
        "remote_carddav": "dav\/appinfo\/v1\/carddav.php",
        "remote_contacts": "dav\/appinfo\/v1\/carddav.php",
        "remote_dav": "dav\/appinfo\/v2\/remote.php",
        "remote_files": "dav\/appinfo\/v1\/webdav.php",
        "remote_webdav": "dav\/appinfo\/v1\/webdav.php",
        "repairlegacystoragesdone": "yes",
        "shareapi_allow_mail_notification": "no",
        "shareapi_allow_public_notification": "no",
        "updater.secret.created": "1591350714",
        "vendor": "owncloud"
    },

List of activated apps:

  - activity: 2.6.0
  - calendar: 1.6.4
  - comments: 0.3.0
  - configreport: 0.2.0
  - contacts: 1.5.5
  - dav: 0.6.0
  - federatedfilesharing: 0.5.0
  - federation: 0.1.0
  - files: 1.5.2
  - files_external: 0.7.1
  - files_mediaviewer: 1.0.3
  - files_pdfviewer: 0.11.2
  - files_sharing: 0.14.0
  - files_texteditor: 2.3.0
  - files_trashbin: 0.9.1
  - files_versions: 1.3.0
  - firstrunwizard: 1.2.0
  - gallery: 16.1.1
  - market: 0.6.0
  - notifications: 0.5.2
  - provisioning_api: 0.5.0
  - systemtags: 0.3.0
  - tasks: 0.9.7
  - templateeditor: 0.4.0
  - updatenotification: 0.2.1

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: Firefox 84.0

Operating system: Ubuntu GNU/Linux 20.04 LTS

Logs

Web server error log

nothing relevant, almost empty, last message:
[Wed Dec 30 00:36:19.598333 2020] [mpm_prefork:notice] [pid 1516313] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations

ownCloud log (data/owncloud.log)

please see at the beginning of the post

Browser log

looks like nothing different than when accessing it by IP address

Thank you in advance for any help in troubleshooting and solving this issue.

Anyone? I am quite sure this is a bug in some hostname validation code, but i need an hint on where i should look

In the error message it says Login failed: ‘admin’ but in the log it shows earlier that you are using the user: “bodom”.

Is the problem restricted to the WebUI or does it also happen in the ownCloud client?
Have you tried a private tab, or deleting the browser cache?

And you are 100% sure that your hostname is resolving correctly?

1 Like

Thanks for your reply!

I’m 100% sure hostname is resolved correctly. I also had noticed the difference in the username. The problem only affects the WebUI, the ownlcoud client and the dav sync are fine.

I had already tried wiping the cache, but nothing happened. Now i have tried using an anonymous window and it works, even by hostname.

I am accessing multiple owncloud installs (on different domains), maybe they are conflicting somehow with this local install?

Browsers should only save and use site data based on the URL names. If the other ownClouds are on different URLs this should not interfere.

Just to be clear: you can no longer reproduce the issue in a private tab? If that is true, then it is most likely a browser cache issue.

1 Like

Hi again,

i’ve done more test and i can now confirm it is somehow browser-related. Clearing the cache, cookies, and everything does not help, but it works in privacy mode and on a different PC.

Sorry for bugging you and thank you for your answers: it helped me find the real problem!

2 Likes