Nextcloud office stopped working after upgrade, getting undefined in request URLs

Hi,

I would really appreciate some help with our Nextcloud office setup. It was working and then broke.

Background

I have two Nextcloud instances using one Collabora instance.

This setup has been working for a long time.

After an upgrade we had issues where only one server could connect in the admin settings.

This is now working and both have a green check mark in the office admin settings.

What broke

The first Nextcloud is able to open documents no problem. However the second Nextcloud when openning documents gets a failed error in the browser.

Undefined in URLs

in console I was able to see the working instance had the following HTTP request.

Working Instance 1:

https://<office-url>/browser/f76e08a/cool.html?WOPISrc=https://<nextcloud-1-url>/index.php/apps/richdocuments/wopi/files/50635_oc6svcz239s0&title=<some-filename>.xlsx&lang=en-GB&closebutton=1&revisionhistory=1

Not working instance 2:

The not working instance had the following HTTP request. Note the 2 undefined in the URL. The path is also odd for the one. /apps/richdocuments/undefined vs /browser/f76e08a/cool.html.

https://<office-url>/apps/richdocuments/undefinedWOPISrc=https://<nextcloud-2-url>/index.php/apps/richdocuments/wopi/files/undefined&title=undefined&lang=en&closebutton=1

Any guidance would be greatly appreciated.

Wich one became upgraded - instance 1 or 2?
Did you also upgrade the Collabora instance?

Please first check the log files, specially on Collabora, whether the request did reach there.
Are both Nextcloud instances permitted to access by collabora?

@Mornsgrans what do you mean by became upgraded.

Both nextclouds are running the same version and when we do upgrades we always upgrade both. They both currently running 27.1.6 and all apps are fully upgraded. Collabora is also running the latest version.

In nextcloud office app configs they both are configured to access Collabora and are showing a green check with no additional errors.

When I look at Collabora logs, the one does reach it and works and I can see the logs but I don’t see anything regarding logs for the not working instance.

And this fits with the error, because main URL to load the Collabora editor comes up with a 404 as the URL has undefined in the URL. Suggesting JS/config issues.

But to my knowledge both instances are configured very similarly with only minor differences in installed apps.

Maybe the following screenshots will illustrate better the issue.

Not working

Working

Hi @NaX - Check the output of occ config:list richdocuments from both servers to compare the underlying Nextcloud richdocuments configuration differences for any discrepancies.

The non-working environment looks very confused. In addition to the undefined, the URL for that POST request looks bogus in other ways.

In theory the first part of that URL (the part up to cool.html? in the working one) gets populated by discovery data received from the Collabora Online server.

After an upgrade we had issues where only one server could connect in the admin settings.

What was the nature of the upgrade? Was this a bump from v27.1.5 to v27.1.6 or something more significant? Happen to know if you were already running the latest richdocuments app for v27 (v8.2.4) or was the integration app updated at the same time?

EDIT: Is there anything showing up in the Nextcloud Server logs in the non-working environment when trying to open a file?

Check the output of occ config:list richdocuments

I found one difference here.

On the non-working system it lists "canonical_webroot": "",.

I must have toggled it on and off resulting in it saving an empty value. Would this matter, can I remove this value. For the working system the canonical_webroot key is not even listed.

I read the docs about what this would be for and I did not understand what I would even fill in here. To me, the word canonical is talking about a URL and webroot is about a filesystem. And what is the context, the Collabora instance or Nextcloud instance?

What was the nature of the upgrade? Was this a bump from v27.1.5 to v27.1.6 or something more significant?

Then we upgraded from v26 to v27 we ran into issues where only the first configured nextcloud was getting a green connected check. We were also getting wopi warnings.

After a lot of trouble shooting we figured out the new aliasgroup1 + aliasgroup2 settings and also add wopi allowlist IP addresses.

And then all warnings and errors went away and the only thing left is this issue when we try to open a document on the one system.

I ran the below to make both the instance configs identical, and no change.

webdo php occ config:app:delete richdocuments canonical_webroot