-
Notifications
You must be signed in to change notification settings - Fork 805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] The document security token is not correctly formed #516
Comments
Onlyoffice docker image recently changes its default setting that JSON Web Token validation (JWT_ENABLED) is now set to true. So, the solution is to start onlyoffice with "JWT_ENABLED=false", and it may be also a solution to properly set the token used by filestash for onlyoffice, in plg_editor_onlyoffice/index.go as I am aware of. |
Thank you for the report, that part of Filestash doesn't have any integration tests that could have detect such issue yet. @yy8402 is correct, I'm working on it with a fix coming up very soon |
Somehow I can't start the new version of onlyoffice, not sure what has changed, it does loop over this message:
|
If someone can make a PR for a better fix than bf2bca4, please do |
@mickael-kerjean I've hit the same bug. The "port number invalid" is probably just because of a lack of error handling in the shell script, but the original error is an NPM crash. I've sent in a PR (PR #518). |
I am using the docker version and I had this come up every time I restart the container. The JWT is changing upon restart. |
Any news on this one? Having the same issue |
No, you need to be explicit when passing variables. For example, you could set this variable in the "environment" section of your service:
I'd say this is just a configuration issue, not a bug in Filestash, maybe a missing feature to support those security tokens. |
I solved it yesterday by putting the variable in the docker compose file. |
I had the same problem, i have my documentserver behind reverse proxy, and fix them change it some parameters on nginx
Good Luck! |
Tried to duplicate this on apache as reverse proxy but no dice...
|
This worked for me! But now I'm getting "Download Failed", not sure if this is a related issue or not. Edit: This was an unrelated issue. For posterity: fixed by adding to adding
to "CoAuthoring" in |
I am also getting the "Download failed." error even with your fix below...
You can also set this via environment variable (see available configuration parameters):
|
Off the top of my head, maybe the env var isn't being applied? Try the config fix. Also, do ’docker log -f myid’ for both the filestash and onlyoffice containers and open a word file to find error messages to google. |
In docker logs for onlyoffice, I find
It seems that |
I think it's a push, filestash url for a doc opens an iframe with the onlyoffice url inside passing a one time key in a cookie and filename in url. The filestash image reverse-proxies to the onlyoffice at http://onlyoffice (internal network). A guess, is the docker-compose.yml configured with exactly the same vars as the example, and are the backend vars at default? |
I guess the difference is that I am using a reverse proxy in a separate network. I could reproduce the issue with the following example: version: '3'
services:
app:
image: machines/filestash
environment:
#APPLICATION_URL:
ONLYOFFICE_URL: http://onlyoffice
networks:
- filestash
- nginx
onlyoffice:
image: onlyoffice/documentserver
environment:
ALLOW_META_IP_ADDRESS: "true"
ALLOW_PRIVATE_IP_ADDRESS: "true"
JWT_ENABLED: "false"
networks:
- filestash
security_opt:
- seccomp:unconfined
nginx:
image: nginx:latest
volumes:
- /tmp/filestash/nginx/default.conf:/etc/nginx/conf.d/default.conf
networks:
- nginx
ports:
- 8080:8080
links:
- app
networks:
filestash:
nginx: So So filestash/server/plugin/plg_editor_onlyoffice/index.go Lines 236 to 277 in 513ba65
For this case, I think it would be the easiest to allow manually overwriting EDIT: Or even better, instead of connecting to |
Is there any further progress on this issue? I seem to be having precisely this problem now with filestash and onlyoffice. It works if I access the site without the proxy. The last suggestion, to resolve using the ONLYOFFICE_URL, would this be possible to test? |
import React, { useState, useEffect } from “react”; const OnlyOffc = (props) => { const onDocumentReady = () => { const onLoadComponentError = function (errorCode, errorDescription) { case -2: // Error load DocsAPI from http://documentserver/ case -3: // DocsAPI is not defined useEffect(() => { let file = new File([data], "test.docx"); setDocUrl(URL.createObjectURL(file)); // set object URL of file as docUrl console.log(“docurl”, docUrl); return ( {docUrl && ( ); //local.json environment:
|
Until this is finalised, I will not take extra work on my end. Should be about 3 to 6 more months |
@mickael-kerjean I go through serveral docs and some blogs also but i still not able to resolve that issue if i JWT_ENABLED=true the i get the error "The document security token is not correctly formed. Please contact your Document Server administrator" , |
Description of the bug
Opening any
.docx
document leads to onlyoffice error:Step by step instructions to reproduce the bug
It literally doesn't work on live demo
Can you replicate that error from the demo?
Yep
Observed behavior
Onlyoffice error:
Expected behavior
No error
The text was updated successfully, but these errors were encountered: