[GH-ISSUE #132] Second registered nextcloud user can't open a document #75

Closed
opened 2026-02-26 09:36:00 +03:00 by kerem · 2 comments
Owner

Originally created by @mishka88ru on GitHub (Oct 25, 2018).
Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/132

Hi all :)

I have nextcloud and just install onlyoffice (on a single computer, CentOS 7).

Here is my problem:
Registered user shares a docx file. He can open and edit it.
Anonymous user (not logged into nextcloud) also can open and edit that docx.
But if another registered user tries to open that file, than he see a page with nextcloud header, but blank below it, i.e. no docx editor.

This is the error from nextcloud logs (it is also on the screenshot below):
{"reqId":"Zu5C_requestID_FWNjg","level":3,"time":"2018-10-25T13:20:32+03:00", "remoteAddr":"192.168.101.18","user":"root","app":"index","method":"GET","url":"\/apps\/onlyoffice\/ajax\/config\/3667?token=Y4_token_7Qc", "message":{"Exception":"TypeError","Message":"Argument 2 passed to OC\\URLGenerator::linkToRouteAbsolute() must be of the type array, null given, called in \/var\/www\/nextcloud\/apps\/onlyoffice\/controller\/editorcontroller.php on line 481", "Code":0,"Trace":[ {"file":"\/var\/www\/nextcloud\/apps\/onlyoffice\/controller\/editorcontroller.php","line":481,"function":"linkToRouteAbsolute","class":"OC\\URLGenerator","type":"->","args":["files.view.index",null]}, {"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":166,"function":"config","class":"OCA\\Onlyoffice\\Controller\\EditorController","type":"->","args":[3667,"Y4kCSB8NXts77Qc"]}, {"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Onlyoffice\\Controller\\EditorController"},"config"]}, {"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/App.php","line":118,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Onlyoffice\\Controller\\EditorController"},"config"]}, {"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Onlyoffice\\Controller\\EditorController","config", {"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"fileId":"3667","_route":"onlyoffice.editor.config"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->", "args":[{"fileId":"3667","_route":"onlyoffice.editor.config"}]}, {"file":"\/var\/www\/nextcloud\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"fileId":"3667","_route":"onlyoffice.editor.config"}]}, {"file":"\/var\/www\/nextcloud\/lib\/base.php","line":987,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/apps\/onlyoffice\/ajax\/config\/3667"]}, {"file":"\/var\/www\/nextcloud\/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}], "File":"\/var\/www\/nextcloud\/lib\/private\/URLGenerator.php","Line":90,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/68.0.3440.106 Safari\/537.36","version":"14.0.3.0"}

docker logs ID shows no errors.

I am starting it like this:
docker run -i -t -d -p 9981:80 -v /root/unsecure-onlyoffice-default.json:/etc/onlyoffice/documentserver/default.json --restart=always onlyoffice/documentserver
-v is here to replace "rejectUnauthorized": true -->> false

My nginx config:

# Use this example for proxy HTTPS traffic to the document server running at 'backendserver-address'.
# Replace {{SSL_CERTIFICATE_PATH}} with the path to the ssl certificate file
# Replace {{SSL_KEY_PATH}} with the path to the ssl private key file

upstream docservice {
  server 127.0.0.1:9981;
}

map $http_host $this_host {
    "" $host;
    default $http_host;
}

map $http_x_forwarded_proto $the_scheme {
     default $http_x_forwarded_proto;
     "" $scheme;
}

map $http_x_forwarded_host $the_host {
    default $http_x_forwarded_host;
    "" $this_host;
}

map $http_upgrade $proxy_connection {
  default upgrade;
  "" close;
}

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Forwarded-Host $the_host;
proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

## Normal HTTP host
server {
  listen 80;
  server_name office.domain.local;
  server_tokens off;

  ## Redirects all traffic to the HTTPS host
#  root /nowhere; ## root doesn't have to be a valid path since we are redirecting
  rewrite ^ https://$host$request_uri? permanent;
}

server {
  listen 443 ssl;
  server_name office.domain.local;
#  server_tokens off;
#  root /usr/share/nginx/html;

  access_log      /var/log/nginx/office_access.log;
  error_log       /var/log/nginx/office_error.log;

  ## Strong SSL Security
  ## https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
#  ssl on;
  ssl_certificate /path/office.domain.local.crt;
  ssl_certificate_key /path/office.domain.local.key;
#  ssl_verify_client off;

#  ssl_ciphers "ECDHE-RSA-AES128-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA128:DHE-RSA-AES128-GCM-SHA384:DHE-RSA-AES128-GCM-SHA128:ECDHE-RSA-AES128-SHA384:ECDHE-RSA-AES128-SHA128:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA384:AES128-GCM-SHA128:AES128-SHA128:AES128-SHA128:AES128-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";

#  ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
#  ssl_session_cache  builtin:1000  shared:SSL:10m;

  ssl_prefer_server_ciphers   on;

  # add_header Strict-Transport-Security max-age=31536000;
  # add_header X-Frame-Options SAMEORIGIN;
  add_header X-Content-Type-Options nosniff;

  ## [Optional] If your certficate has OCSP, enable OCSP stapling to reduce the overhead and latency of running SSL.
  ## Replace with your ssl_trusted_certificate. For more info see:
  ## - https://medium.com/devops-programming/4445f4862461
  ## - https://www.ruby-forum.com/topic/4419319
  ## - https://www.digitalocean.com/community/tutorials/how-to-configure-ocsp-stapling-on-apache-and-nginx
  # ssl_stapling on;
  # ssl_stapling_verify on;
  # ssl_trusted_certificate /etc/nginx/ssl/stapling.trusted.crt;
  # resolver 208.67.222.222 208.67.222.220 valid=300s; # Can change to your DNS resolver if desired
  # resolver_timeout 10s;

  ## [Optional] Generate a stronger DHE parameter:
  ##   cd /etc/ssl/certs
  ##   sudo openssl dhparam -out dhparam.pem 4096
  ##
  # ssl_dhparam /etc/ssl/certs/dhparam.pem;

  location / {
    proxy_pass http://docservice;
    proxy_http_version 1.1;
  }
}

Finally the screenshot from Chrome:
chrome-error

Originally created by @mishka88ru on GitHub (Oct 25, 2018). Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/132 Hi all :) I have nextcloud and just install onlyoffice (on a single computer, CentOS 7). Here is my problem: Registered user shares a docx file. He can open and edit it. Anonymous user (not logged into nextcloud) also can open and edit that docx. But if another registered user tries to open that file, than he see a page with nextcloud header, but blank below it, i.e. no docx editor. This is the error from nextcloud logs (it is also on the screenshot below): ` {"reqId":"Zu5C_requestID_FWNjg","level":3,"time":"2018-10-25T13:20:32+03:00", "remoteAddr":"192.168.101.18","user":"root","app":"index","method":"GET","url":"\/apps\/onlyoffice\/ajax\/config\/3667?token=Y4_token_7Qc", "message":{"Exception":"TypeError","Message":"Argument 2 passed to OC\\URLGenerator::linkToRouteAbsolute() must be of the type array, null given, called in \/var\/www\/nextcloud\/apps\/onlyoffice\/controller\/editorcontroller.php on line 481", "Code":0,"Trace":[ {"file":"\/var\/www\/nextcloud\/apps\/onlyoffice\/controller\/editorcontroller.php","line":481,"function":"linkToRouteAbsolute","class":"OC\\URLGenerator","type":"->","args":["files.view.index",null]}, {"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":166,"function":"config","class":"OCA\\Onlyoffice\\Controller\\EditorController","type":"->","args":[3667,"Y4kCSB8NXts77Qc"]}, {"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Onlyoffice\\Controller\\EditorController"},"config"]}, {"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/App.php","line":118,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Onlyoffice\\Controller\\EditorController"},"config"]}, {"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Onlyoffice\\Controller\\EditorController","config", {"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"fileId":"3667","_route":"onlyoffice.editor.config"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->", "args":[{"fileId":"3667","_route":"onlyoffice.editor.config"}]}, {"file":"\/var\/www\/nextcloud\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"fileId":"3667","_route":"onlyoffice.editor.config"}]}, {"file":"\/var\/www\/nextcloud\/lib\/base.php","line":987,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/apps\/onlyoffice\/ajax\/config\/3667"]}, {"file":"\/var\/www\/nextcloud\/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}], "File":"\/var\/www\/nextcloud\/lib\/private\/URLGenerator.php","Line":90,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/68.0.3440.106 Safari\/537.36","version":"14.0.3.0"} ` docker logs ID shows no errors. I am starting it like this: `docker run -i -t -d -p 9981:80 -v /root/unsecure-onlyoffice-default.json:/etc/onlyoffice/documentserver/default.json --restart=always onlyoffice/documentserver` -v is here to replace "rejectUnauthorized": true -->> false My nginx config: ``` # Use this example for proxy HTTPS traffic to the document server running at 'backendserver-address'. # Replace {{SSL_CERTIFICATE_PATH}} with the path to the ssl certificate file # Replace {{SSL_KEY_PATH}} with the path to the ssl private key file upstream docservice { server 127.0.0.1:9981; } map $http_host $this_host { "" $host; default $http_host; } map $http_x_forwarded_proto $the_scheme { default $http_x_forwarded_proto; "" $scheme; } map $http_x_forwarded_host $the_host { default $http_x_forwarded_host; "" $this_host; } map $http_upgrade $proxy_connection { default upgrade; "" close; } proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $proxy_connection; proxy_set_header X-Forwarded-Host $the_host; proxy_set_header X-Forwarded-Proto $the_scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; ## Normal HTTP host server { listen 80; server_name office.domain.local; server_tokens off; ## Redirects all traffic to the HTTPS host # root /nowhere; ## root doesn't have to be a valid path since we are redirecting rewrite ^ https://$host$request_uri? permanent; } server { listen 443 ssl; server_name office.domain.local; # server_tokens off; # root /usr/share/nginx/html; access_log /var/log/nginx/office_access.log; error_log /var/log/nginx/office_error.log; ## Strong SSL Security ## https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html # ssl on; ssl_certificate /path/office.domain.local.crt; ssl_certificate_key /path/office.domain.local.key; # ssl_verify_client off; # ssl_ciphers "ECDHE-RSA-AES128-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA128:DHE-RSA-AES128-GCM-SHA384:DHE-RSA-AES128-GCM-SHA128:ECDHE-RSA-AES128-SHA384:ECDHE-RSA-AES128-SHA128:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA384:AES128-GCM-SHA128:AES128-SHA128:AES128-SHA128:AES128-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4"; # ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # ssl_session_cache builtin:1000 shared:SSL:10m; ssl_prefer_server_ciphers on; # add_header Strict-Transport-Security max-age=31536000; # add_header X-Frame-Options SAMEORIGIN; add_header X-Content-Type-Options nosniff; ## [Optional] If your certficate has OCSP, enable OCSP stapling to reduce the overhead and latency of running SSL. ## Replace with your ssl_trusted_certificate. For more info see: ## - https://medium.com/devops-programming/4445f4862461 ## - https://www.ruby-forum.com/topic/4419319 ## - https://www.digitalocean.com/community/tutorials/how-to-configure-ocsp-stapling-on-apache-and-nginx # ssl_stapling on; # ssl_stapling_verify on; # ssl_trusted_certificate /etc/nginx/ssl/stapling.trusted.crt; # resolver 208.67.222.222 208.67.222.220 valid=300s; # Can change to your DNS resolver if desired # resolver_timeout 10s; ## [Optional] Generate a stronger DHE parameter: ## cd /etc/ssl/certs ## sudo openssl dhparam -out dhparam.pem 4096 ## # ssl_dhparam /etc/ssl/certs/dhparam.pem; location / { proxy_pass http://docservice; proxy_http_version 1.1; } } ``` Finally the screenshot from Chrome: ![chrome-error](https://user-images.githubusercontent.com/44462629/47498122-f85d6680-d864-11e8-8aee-7d6aab8aa6e2.png)
kerem closed this issue 2026-02-26 09:36:01 +03:00
Author
Owner

@mishka88ru commented on GitHub (Oct 25, 2018):

Update.
Previously I shared that file (folder with files to be precise) with everybody (i.e. sharing text box in nextcloud is clean).

But if I explicitly share it with the registered user, he will be able to open&edit that file.

share

I have 2 accounts on this server: one admin (via chrome), one normal (via firefox).
This screenshot is from my normal account which owns the file.

It is strange that anonymous user can open shared file, but registered user can not.

<!-- gh-comment-id:433037255 --> @mishka88ru commented on GitHub (Oct 25, 2018): Update. Previously I shared that file (folder with files to be precise) with everybody (i.e. sharing text box in nextcloud is clean). But if I explicitly share it with the registered user, he will be able to open&edit that file. ![share](https://user-images.githubusercontent.com/44462629/47500906-bb956d80-d86c-11e8-8bd5-c44da9d1b58b.png) I have 2 accounts on this server: one admin (via chrome), one normal (via firefox). This screenshot is from my normal account which owns the file. It is strange that anonymous user can open shared file, but registered user can not.
Author
Owner

@ShockwaveNN commented on GitHub (Oct 25, 2018):

@mishka88ru Hi, your problem is related with nextcloud, so please duplicate your isssue at https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues

<!-- gh-comment-id:433047040 --> @ShockwaveNN commented on GitHub (Oct 25, 2018): @mishka88ru Hi, your problem is related with nextcloud, so please duplicate your isssue at https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Docker-DocumentServer-ONLYOFFICE#75
No description provided.