Web UI redirection 2.0 - it's even worse

Relating to this which is now closed (despite never being sorted): Web UI: Redirecting Please wait a while. You are being redirected - #10 by jvillafanez

Apologies for the negative tone but I’m getting really p**ed off by this.

Having upgraded and (as I do each time… triumph of hope over experience) trying to access the new Web UI, I ended up in an infinite loop.

ezgif-5-461059f55f

Now, thanks to the awesome ‘feature’ where ownCloud opens on the last-used app when a user logs in, I can’t even log out and back in again with that account.

Uninstalling the Web app gives me an internal server error. Slow handclap anyone? Maybe add an option to the Users page to set their default app so this can be undone.

I don’t think this is true. There is a option in the config.php file to set the default application, so instead of redirecting to the login page you’re redirected to that app, assuming you’re already logged in. You might be redirected to the new web app instead of the default old files app.

You might want to try to remove all the cookies for the site. That should give you a new session, so the login page should appear.

As said, double check the option in the config.php file. I’m assuming the server error comes from the missing web app that you’ve uninstalled / disabled but it’s still configured as default. I don’t know if this case is handled properly, maybe the server logs give more clues.

For the white screen, I guess the web team will need more info. You can also try to remove the cookies and the browser’s local and session storages. If I remember correctly, there might be authentication data being kept in the browser storage, and the web could try to use it

But this was introduced by the web app, I assume. The classic ownCloud web doesn’t have such a feature.

From the release notes for 10.11:

The new server version has more scope for customization and personalization; for example, the default app on login can now be set for an individual user which will automatically be used by ownCloud Web (if installed and enabled), so that users are always redirected to their preferred UI based on their last choice. Simply opening the Web app appears to set this, and I can’t see a way of changing it in the Users settings screen.

The gif of the infinite loop I shared was actually a private browser window (so there were no cookies / session data to mess anything up).

Uninstalling the web app didn’t help - but disabling it did (not sure I fully understand why) so I’m back in, and I’ve calmed down from my initial rage (!). What’s still really annoying is the fact that after two years of issues accessing the Web UI, I still can’t use it - and no-one can explain why. It’s clearly something in the database because with a fresh install and the same config.php file it works fine.

You’re partially right. There should be a button or something like that in the web app to set it as default app for that user, but as far as I know, it should be an opt in: you have to actively click the button.

I guess it was assumed that the web app would be available, so you could revert the default app for the user by clicking the button again (need to check how it works exactly), but your scenario where the app is broken wasn’t considered.

For reference, you can remove the configured value:

occ user:setting <user> core defaultapp --delete

This is for 10.11. Earlier versions don’t support per-user default apps.

@bencgreen could you check if you have multiple versions of the web app in ownCloud? Usually you have only one app directory, but you could have multiple app directories configured. The docker deployment uses multiple directories, for example.

@bencgreen found this issue in the web repo, which sounds like a match with the symptoms you are experiencing: Loop when failing to load user information · Issue #7354 · owncloud/web · GitHub

Could you check if the network request to /ocs/v1.php/cloud/user fails? Since you’re in a redirect loop (that needs to be fixed, should stay on the error page) you need to tell your browser dev tools to preserve the logs. In Chromium that’s a checkbox in the Network tab header that needs to be checked, see screenshot (unchecked in the screenshot).

1 Like

Also, any information that looks like an error in your browser console would be helpful. :slight_smile:

Thanks - I’ve run this!

I am running it in the official Docker container. In the root (/var/www/owncloud) apps directory there is one, and also one in /mnt/data - which is mapped from the host. I have moved that one out and at least the infinite redirect loop has stopped, and I now get this (which is what was popping up before during the loop):

Screenshot 2022-09-21 145610

I have this in the browser console for that page:

Font Awesome Free 6.1.1 by @fontawesome - https://fontawesome.com
License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
Copyright 2022 Fonticons, Inc.
vendor-e2ecbc23.js:113:49553
The resource from “https://***REDACTED***/index.php/apps/web/index.html” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff). index.html
Failed to load theme 'https://***REDACTED***/themes/owncloud/theme.json' is not a valid json file, using default theme. web-runtime-49189e35.js:1:91343
Invalid query, please check the syntax. API specifications are here: http://www.freedesktop.org/wiki/Specifications/open-collaboration-services. DEBUG OUTPUT:
useClientService-0039200a.js:1:107908
    initializeContext https://***REDACTED***/index.php/apps/web/js/chunks/useClientService-0039200a.js:1
user unloaded… useClientService-0039200a.js:1:107286

This returns ‘ok’ and status ‘100’ with my user name so looks like it’s working to me. (FYI trying v2.php also works but returns status ‘200’ instead.)

From the redirection - also the case in the older thread (linked at the top) I get a lot of these in the browser console:

Invalid query, please check the syntax. API specifications are here: http://www.freedesktop.org/wiki/Specifications/open-collaboration-services

I also get this, which is weird because that’s what it’s supposed to be according to this:

Failed to load theme 'https://***REDACTED***/themes/owncloud/theme.json' is not a valid json file, using default theme. web-runtime-49189e35.js:1:91343

My config.json is this:

{
  "server" : "https://***REDACTED***",
  "theme": "https://***REDACTED***/themes/owncloud/theme.json",
  "auth": {
    "clientId": "***REDACTED***",
    "url": "https://***REDACTED***/index.php/apps/oauth2/api/v1/token",
    "authUrl": "https://***REDACTED***/index.php/apps/oauth2/authorize",
    "logoutUrl": "https://***REDACTED***/index.php/logout"
  },
  "apps" : [
    "files",
    "preview",
    "draw-io"
  ],
  "applications" : [
    {
      "title": {
        "en": "Classic Design"
      },
      "icon": "swap-box",
      "url": "https://***REDACTED***/index.php/apps/files"
    },
    {
      "icon": "settings-4",
      "menu": "user",
      "target": "_self",
      "title": {
        "en": "Settings"
      },
      "url": "https://***REDACTED***/index.php/settings/personal"
    }
  ]
}

What I haven’t seen before in the console logs is this:

Uncaught (in promise) Error: Redirected when going from "/access-denied" to "/files/spaces/personal" via a navigation guard.

I’m not sure if Web loads outdated assets after updated from the store · Issue #40167 · owncloud/core · GitHub could be related. There is no good solution for it (at least for now) other than manually adjusting all the urls in the configuration files to point to the latest version of the app.
I think it could affect to urls in the config.json file, and the redirection urls used for oauth2.

Basically, the updates from the market app will be placed in the “custom” folder (assuming the default configuration for the docker container), so you’d need to use ..../index.php/custom/web/.... instead of ..../index.php/apps/web/.... in order to use the updated version.
Note that the php code will still run the latest version of the app regardless of the location

This is making me wonder - seems pretty major, or is it a red herring?