Skip to content
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

Can't access Nextcloud files "The files could not be saved" #13

Open
stemeinke opened this issue Oct 9, 2018 · 37 comments
Open

Can't access Nextcloud files "The files could not be saved" #13

stemeinke opened this issue Oct 9, 2018 · 37 comments
Labels

Comments

@stemeinke
Copy link

I have been redirected from the onlyoffice docker team to this. Does someone of you know a solution for this? (old Issue)
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
image
When I click on a file in nextcloud the error above appears.
The error says that the file could not be saved (like these issue)

Logs
When I do the docker logs container-id these error is shown after I try to open a file.

/var/log/onlyoffice/documentserver/docservice/out.log <==
[2018-10-09 09:23:25.486] [ERROR] nodeJS - postData error: docId =3369593812;url =http://<nextcloud.domain.tld>/apps/onlyoffice/track?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmaWxlSWQiOjI0MDQsIm93bmVySWQiOiJTdGVmZmVuIiwidG9rZW4iOm51bGwsImFjdGlvbiI6InRyYWNrIn0.vEhw5LcrA_unKBj94tSZXnBzOuY-MmF4K0el1FSNy88;data = {"key":"3369593812","status":1,"users":["username"],"actions":[{"type":1,"userid":"username"}]}Error: Error response: statusCode:301 ;body:

at Request._callback (/var/www/onlyoffice/documentserver/server/Common/sources/utils.js:283:18)
    at Request.self.callback (/var/www/onlyoffice/documentserver/server/Common/node_modules/request/request.js:185:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/var/www/onlyoffice/documentserver/server/Common/node_modules/request/request.js:1161:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/var/www/onlyoffice/documentserver/server/Co mmon/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)

What is the expected behavior?
Editing a file in OnlyOffice
DocumentServer Docker tag:
5.2.0
Nextcloud version:
14.0.1
Host Operating System:
Ubuntu 18.04 LTS

Let me know if you need some more information

@alexanderonlyoffice
Copy link
Member

Hello @stemeinke, please send us a screenshot of the address settings of ONLYOFFICE integration app in your Nextcloud. Click also on the 'Save' button on the page with address settings and check if there is an error.

@stemeinke
Copy link
Author

unbenannt

When I click on save the message says that the setting has been saved successfully.

@alexanderonlyoffice
Copy link
Member

@stemeinke, please specify if your Nextcloud instance is using HTTPS protocol also. We can see that the Document Server is on HTTPS and you are entering Nextcloud via HTTP. Error 301 can mean the failure to redirect to HTTPS.

@stemeinke
Copy link
Author

Yes the Nextcloud instance is also encrypted via HTTPS. Actually the are using the same reverse proxy and just the handling is different because of the different subdomains.

@osscombat
Copy link

Absolutely the same issue after an upgrade to 5.2.2 from rpm. The service itself is up and running, but when I try to save the settings in NC admin panel the following error occurs:

Error when trying to connect (Error occured in the document service: Error while downloading the document to be converted.)

@alexanderonlyoffice
Copy link
Member

alexanderonlyoffice commented Oct 19, 2018

@stemeinke, @osscombat, please try to check if JWT token match each other in Nextcloud and Document Server. Since version 5.2 of the Document Server JWT token should be changed in local,json file and not in default.json file.

Check also the accessibility of the servers to each other. Use wget command to do it: wget https://documentserver_address (from the server with Nextcloud) and wget https://nextcloud_address (from inside the container with the Document Server, if you are using docker-installation). Send us screenshots of the commands output.

@osscombat
Copy link

Thanks for the hints, wget accessibility checks are fine. I used a JWT token in the old default.json, how to properly setup the local.json file for 5.2.2, as I don't see it in /etc/onlyoffice/documentserver folder?
Now the logs are full of these lines:

[2018-10-19 11:03:08.865] [WARN] log4js - Failed to load configuration file undefined

@alexanderonlyoffice
Copy link
Member

@osscombat, local.json file is placed in the same folder /etc/onlyoffice/documentserver/. Please make sure that you are using the latest version of the Document Server. Send us a screenshot of the output of the command yum list installed | grep onlyoffice

@osscombat
Copy link

Is the local.json just a copy of the recent default.json?

[root@office documentserver]# yum list installed | grep onlyoffice
onlyoffice-documentserver.x86_64 5.2.2-2 @ONLYOFFICE
onlyoffice-repo.noarch 1.0.0-9 installed

@alexanderonlyoffice
Copy link
Member

@osscombat, if I understand it right, you cannot find local.json in this folder?

No, this is a new file which contains some connection and, for example, JWT settings. This was made to keep default.json unchangeable.

@osscombat
Copy link

yes, only default.json was installed, how can I generate the correct local.json file?

@alexanderonlyoffice
Copy link
Member

alexanderonlyoffice commented Oct 19, 2018

@osscombat, this file should be generated automatically. Please specify also how you installed the Document Server. Did you execute documentserver-configure.sh script after the update? Please follow this link to find an instruction in the 'Configuring Document Server' section.

@osscombat
Copy link

Thanks, I've got local.json after the documentserver-configure.sh, but still no connection.

I used this guide step by step for my installation:
https://helpcenter.onlyoffice.com/ru/server/linux/document/linux-installation-centos.aspx

@alexanderonlyoffice
Copy link
Member

@osscombat, try to add the following section to Nextcloud config.php:

 'onlyoffice' =>
  array (
    "jwt_secret" => "****",
    "jwt_header" => "****"
	)

Where under **** are your JWT secret and header from local.json.

@osscombat
Copy link

I finally fixed this with setting the secret and token values in local.json. The only problem left is that /var/log/onlyoffice/documentserver/spellchecker/out.log is getting filled with messages:

[2018-10-19 13:05:01.431] [WARN] nodeJS - worker 11980 died (code = 1; signal = null). restart...
how to fix this?

@alexanderonlyoffice
Copy link
Member

@osscombat, ok, I'm glad that the issue has been resolved. Please specify in which log you see this warn message.

@osscombat
Copy link

/var/log/onlyoffice/documentserver/spellchecker/out.log

@alexanderonlyoffice
Copy link
Member

@osscombat, could you please send us this log and also specify the exact version of your OS.

@osscombat
Copy link

The log consists of just this one message, only the worker ID and time is different, there are 4 lines per second, so the CPU load is high:

[2018-10-19 13:45:29.574] [WARN] nodeJS - worker 60473 died (code = 1; signal = null). restart...
[2018-10-19 13:45:29.834] [WARN] nodeJS - worker 60479 died (code = 1; signal = null). restart...
[2018-10-19 13:45:30.093] [WARN] nodeJS - worker 60487 died (code = 1; signal = null). restart...
[2018-10-19 13:45:30.346] [WARN] nodeJS - worker 60493 died (code = 1; signal = null). restart...
[2018-10-19 13:45:30.613] [WARN] nodeJS - worker 60499 died (code = 1; signal = null). restart...
[2018-10-19 13:45:30.868] [WARN] nodeJS - worker 60505 died (code = 1; signal = null). restart...
[2018-10-19 13:45:31.137] [WARN] nodeJS - worker 60511 died (code = 1; signal = null). restart...

CentOS Linux release 7.5.1804 (Core) 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

@osscombat
Copy link

osscombat commented Oct 19, 2018

and the /var/log/onlyoffice/documentserver/spellchecker/err.log contains:

Error: Module version mismatch. Expected 48, got 57.
at Error (native)
at Object.Module._extensions..node (module.js:604:18)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object. (/var/www/onlyoffice/documentserver/server/SpellChecker/sources/spellCheck.js:13:17)
at Module._compile (module.js:577:32)
at Object.Module._extensions..js (module.js:586:10)
module.js:604
return process.dlopen(module, path._makeLong(filename));

@alexanderonlyoffice
Copy link
Member

@osscombat, please check the version of Node.js. If it is 6.14.4, please update it to the version 8.12.0.

@osscombat
Copy link

osscombat commented Oct 19, 2018

Yes, I had v6.14, v.8.12 has resolved the errors, thanks a lot!

@stemeinke
Copy link
Author

stemeinke commented Oct 19, 2018

Okay I have checked with wget but it seems normal to me
this is the output inside the docker container

Resolving nextclouddomain (nextclouddomain)... nextcloudip
Connecting to www.allyourstuff.de (nextclouddomain)|nextcloudip|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://nextclouddomain/login [following]
URL transformed to HTTPS due to an HSTS policy
--2018-10-19 14:53:36-- https://nextclouddomain/login
Reusing existing connection to nextclouddomain:443.
HTTP request sent, awaiting response... 200 OK
Length: 8723 (8.5K) [text/html]
Saving to: ‘index.html’

     0K ........                                              100% 3.50M=0.002s

2018-10-19 14:53:36 (3.50 MB/s) - ‘index.html’ saved [8723/8723]

and this is the output on the nextcloud server:

Resolving officeserver (officeserver)... nextcloudip/officeip
Connecting to officeserver (officeserver)|nextcloudip/officeip|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://officeserver/welcome/ [following]
--2018-10-19 14:59:34--  https://officeserver/welcome/
Reusing existing connection to officeserver:443.
HTTP request sent, awaiting response... 200 OK
Length: 4592 (4,5K) [text/html]
Saving to: ‘index.html.1’

index.html.1        100%[===================>]   4,48K  --.-KB/s    in 0s

2018-10-19 14:59:34 (887 MB/s) - ‘index.html.1’ saved [4592/4592]```

@alexanderonlyoffice
Copy link
Member

@stemeinke, have you tried to add the section below to config.php of Nextcloud?

 'onlyoffice' =>
  array (
    "jwt_secret" => "****",
    "jwt_header" => "****"
	)

Where under **** are your JWT secret and header from local.json.

@stemeinke
Copy link
Author

sorry but can you tell me where I can find the local.json?

@osscombat
Copy link

@stemeinke , it should be generated by the documentserver-configure.sh script into /etc/onlyoffice/documentserver/ path.

@stemeinke
Copy link
Author

@osscombat I'm runnig the docker image of onlyoffice so I think there is no script that could create the file outside the container and I'm not sure but I don't think I can get these information out of it.

@LinneyS
Copy link
Member

LinneyS commented Dec 10, 2018

Please enter https protocol in the field Server address for internal requests from the Document Editing Service

@LinneyS LinneyS added the https label Dec 10, 2018
@mwaeckerlin
Copy link

mwaeckerlin commented Jan 21, 2019

I can confirm the problem. My instances run on:

Both SSL connections are terminated on a docker swarm running a nginx reverse proxy, then in the swarm internally forwarded from nginx to workers using http.

/etc/onlyoffice/documentserver/local.json:

{
  "services": {
    "CoAuthoring": {
      "sql": {
        "dbHost": "localhost",
        "dbName": "onlyoffice",
        "dbUser": "onlyoffice",
        "dbPass": "onlyoffice"
      },
      "redis": {
        "host": "localhost"
      },
      "token": {
        "enable": {
          "request": {
            "inbox": false,
            "outbox": false
          },
          "browser": false
        },
        "inbox": {
          "header": "Authorization"
        },
        "outbox": {
          "header": "Authorization"
        }
      },
      "secret": {
        "inbox": {
          "string": "secret"
        },
        "outbox": {
          "string": "secret"
        },
        "session": {
          "string": "secret"
        }
      }
    }
  },
  "rabbitmq": {
    "url": "amqp://guest:guest@localhost"
  }
}

The configuration used to work for a long time (at least until 12/2018), now (01/2019) no more.

@Edzilla2000
Copy link

Hi, I have the exact same issue as @mwaeckerlin , nextcloud and onlyoffice running in docker swarm, used to work but now doesn't, and I have the same local.json file.

@jumerkel
Copy link

Hi, I had the same issue. Check your Server address for internal requests from the Document Editing Service in the Advanced server settings of Onlyoffice. The value changed to http and should be https. Fill in your nextcloud https address and it should work again.

@Edzilla2000
Copy link

Hi, I had the same issue. Check your Server address for internal requests from the Document Editing Service in the Advanced server settings of Onlyoffice. The value changed to http and should be https. Fill in your nextcloud https address and it should work again.

Doesn't work for me unfortunately

@mwaeckerlin
Copy link

There are no «internal requests». OnlyOffice is configured to use the external HTTPS-URL.

@Edzilla2000
Copy link

I managed to get it working, by using the internal docker networking with HTTP (not HTTPS) in the advanced server settings.
I believe this is still secure as it uses the docker internal overlay network and so does not expose any http traffic to the outside world.
image

I have already tried that but it didn't work as I wrongly used the internal address of the nextcloud FPM container and not the nginx container.

@Cybermated
Copy link

Cybermated commented Jun 30, 2019

I am running OnlyOffice and Nextcloud in a Docker Swarm cluster and get the same error while trying to edit a document.

I tried what @Edzilla2000 shared but I still get the same problem.

image

image

I don't use any secret, and via the overlay network they can ping each other using container names I put in the advanced parameters. They listen on port 80 but we can access it via our Traefik with HTTPS.

I see that the previous screen is not quite the same, is the fix different for the current version ?

Let me know if you need some more information

@vetaldom
Copy link

Ubuntu 18.04
nextcloud 24.0.6
ONLYOFFICE 7.2.0.204
All installed via snap. Proxy apache
Very similar problem. Occurs only in files opened by reference. Only in External Storage(local folder)
However, if the user is registered and logged in, then there is no such problem. Help fix problems

@michaelortnersanube
Copy link

Hello, i have the same issue with the External Storage - we use SMB/CIFS, and the documents don't open. Anyone a idea how to fix this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants