xwikisas / application-onlyoffice-connector

Edit attachments with OnlyOffice
GNU Lesser General Public License v2.1
0 stars 5 forks source link

Error with OnlyOffice 7.5 #38

Closed Tragen closed 7 months ago

Tragen commented 10 months ago

When I update to OnlyOffice 7.5, I cannot open documents anymore. Can you check what's wrong with the connector?

snazare commented 9 months ago

Kindly note that the Only Office Connector is currently compatible with document server 7.0: https://store.xwiki.com/xwiki/bin/view/Extension/OnlyOfficeConnectorApplication#description

We are investigating the issue for 7.5.

trrenty commented 7 months ago

Hello, @Tragen . I created this issue #40 and fixed it. I am fairly certain that the issues created by you should also be fixed as of v2.2.0. However, since I didn't test on those versions, I can't be 100% sure. Can you confirm everything is good on your side?

Tragen commented 7 months ago

Thanks. I will install the new version and test it.

Tragen commented 7 months ago

I've updated to 8.0 and get the error message: "Unable to push attachment up to OnlyOffice server" With 7.3 it was working. I try to find why I get this error.

Tragen commented 7 months ago

I got some CORS errors which I fixed, now I get something like "Tables loading" and then another error. image which means "Download failed"

The developer tools in FF show me The "documentType" parameter for the config object must take one of the values word/cell/slide/pdf. [api.js:453:29](https://onlyoffice:12448/web-apps/apps/api/documents/api.js)

trrenty commented 7 months ago

Hmm. From my investigation for the #40 issue, the problem on versions 7.2+ was that the JWT was enabled by default which meant that the communication between XWiki and OnlyOfficeServer had to take that into consideration.

Did you manually disable the JWT when configuring the onlyoffice document server?

Alternatively, on the latest version of our integration, you can add the server secret key in the administration page (if you configured it) so that the JWTs can be added to the requests to the OO server. Here is the OnlyOffice documentation for configuring the JWT. https://helpcenter.onlyoffice.com/installation/docs-configure-jwt.aspx

I recommend trying the second option

Tragen commented 7 months ago

I installed the update OO 8.0.1 and set the JWT tokes. I've looked at the administration page for the OO connector but there is no option for the token there.

trrenty commented 7 months ago

Thats odd. There should be a server secret property inside the Administration page. Are you sure you have the latest version of Application OnlyOffice Integration installed? 2.2.0

After you install the application, if you try to create/edit a document you should receive the following error message: image

To solve this, you should go to the administration page and fill in the server secret parameter with the secret configured on your only office document server. In my case, I'm running v8.0 of the OnlyOffice document server using docker.

This is the command that I used:

sudo docker run -i -t -d -p 80:80 --restart=always     
  -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice      
  -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data      
  -v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice     
  -v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql 
  -e JWT_SECRET=my_jwt_secret onlyoffice/documentserver

The secret was configured using the JWT_SECRET variable. The value I set to it is the same value I input in the administration section. image

After saving, when I try to edit the previous document, it works as intended. image

Tragen commented 7 months ago

I've installed OnlyOffice with the repo, I don't use the docker container. I don't have the option to enter the JWT token image The current version 2.2.0 is installed image

Tragen commented 7 months ago

I removed the OO extension and reinstalled it, now I can enter the serversecret. I will try again with OO8

Tragen commented 7 months ago

Whatever I do with OO8, it doesn't work. Now I get CORS errors and this error image

I've tried everything to solve the CORS error but whatever I do, I cannot get it to work. I've put add_header 'Access-Control-Allow-Origin' '*'; at every location I could find

trrenty commented 7 months ago

To avoid having trouble with the CORS policy, I used a browser extension CORS Everywhere (on firefox).

From what I read, the onlyoffice document server does not provide an explicit way of setting the response headers. So you would either have to deploy the server on a different domain or set up a proxy at the same origin (and port) as your XWiki instance.

Tragen commented 7 months ago

Currently I have it running on different computers with the same domain name and different ports. I will give it a new domain name and check again if it's working.

trrenty commented 7 months ago

Hello, I also tested the application on OnlyOffice document server version 7.5 and it worked (both XWiki instance and OnlyOffice document server installed locally, the latter running in a docker container).

To avoid the CORS issue I used the aforementioned CORS Everywhere browser extension, which I only recommend using for testing purposes.

I tested both with JWT enabled and disabled. If you disable the JWT, you might get Download Failed error when trying to open a document in xwiki. This error should only appear if you are running both instances locally (xwiki and onlyoffice) and try to open a document that is located on the same machine. You need to configure the OnlyOffice server to allow local documents editing: https://forum.onlyoffice.com/t/when-i-call-conversion-api-the-editor-seems-to-be-blocked/7584/7