ONLYOFFICE / DocumentServer

ONLYOFFICE Docs is a free collaborative online office suite comprising viewers and editors for texts, spreadsheets and presentations, forms and PDF, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
https://www.onlyoffice.com
GNU Affero General Public License v3.0
4.9k stars 1.1k forks source link

Not working after update DocumentServer 8.2.0 with connector app 9.4.0 #2933

Open mudza09 opened 1 month ago

mudza09 commented 1 month ago

Currently my connector app is version 9.4.0, and I updated OnlyOffice DocumentServer to version 8.2.0 on Ubuntu server 24.04 machine using apt

The installation process went well, but after the update I can't open spreadsheet, doc, pdf, and presentation files

This error message appears: Cannot GET /8.2.0-88d72bc60b1e714a35888b9a72c76d20/web-apps/apps/spreadsheeteditor/main/index_loader.html

Please help me to fix this problem

AzureInformatique commented 1 month ago

Same error Nextcloud Server version 29.0.7

fvb-sb commented 1 month ago

Same here after updating OnlyOffice Documentserver to version 8.2.0.143 running on Ubuntu Server 20.04.6 LTS. Nextcloud Server versions are 29.0.8 and 30.0.1 running on Ubuntu 22.04.5 LTS

/var/log/onlyoffice/documentserver/nginx.access.log: IP.AD.DR.ESS - - [19/Oct/2024:08:32:12 +0200] "GET /8.2.0-ec38a93cedf5268e4aeb1145a16e1c67/web-apps/apps/documenteditor/main/index_loader.html?_dc=8.2.0-143&lang=de-DE&customer=ONLYOFFICE&type=desktop&frameEditorId=iframeEditor&isForm=false&compact=true&parentOrigin=https://host.domain.tld&uitheme=theme-classic-light&fileType=docx&indexPostfix=_loader HTTP/1.1" 404 207 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0"

AzureInformatique commented 1 month ago

Best solution is rollback onlyoffice server to 8.1.3 using docker Waiting for patch

marco-calautti commented 1 month ago

The problem is with the cache of your browser. Clear the cache and everything should work fine again.

AzureInformatique commented 1 month ago

The problem is with the cache of your browser. Clear the cache and everything should work fine again.

Go to hell cache ! Work for me ! Thanks

marco-calautti commented 1 month ago

Just to clarify, you need to clear the cache so that the downgrade to 8.1.3 takes effect, but 8.2.0 still has the bug. Whenever I try to update onlyoffice server to 8.2.0 I get the error.

mudza09 commented 1 month ago

The problem is with the cache of your browser. Clear the cache and everything should work fine again.

Go to hell cache ! Work for me ! Thanks

which version worked? 8.1.3 or 8.2.0? I am using 8.2.0 and connector app 9.5.0 tried clearing browser cache but still not working

AzureInformatique commented 1 month ago

Just to clarify, you need to clear the cache so that the downgrade to 8.1.3 takes effect, but 8.2.0 still has the bug. Whenever I try to update onlyoffice server to 8.2.0 I get the error.

In fact I pushed back the 8.2 update and reset the cache on Chrome and strangely I no longer have any errors!

AzureInformatique commented 1 month ago

The problem is with the cache of your browser. Clear the cache and everything should work fine again.

Go to hell cache ! Work for me ! Thanks

which version worked? 8.1.3 or 8.2.0? I am using 8.2.0 and connector app 9.5.0 tried clearing browser cache but still not working

Same as you for the versions, with Chrome and cache clearing it's working

mudza09 commented 1 month ago

strange, I also use chrome and have cleared the cache but it doesn't work here

fvb-sb commented 1 month ago

After reading your comments about a browser cache clearance I gave it another try and updated OnlyOffice Documentserver once again from 8.1.3 to 8.2.0 this morning. Strangely OnlyOffice Documentserver now works as expected. Even without clearing the browser cache. Tested with Firefox 131.0.3 and Edge 129.0.2792.89.

marco-calautti commented 1 month ago

For me, updating to 8.2.0 reintroduces the bug, with and without browser cache clearance. I am using Firefox and Chromium.

Downgrading to 8.1.3 instead fixes the issue only if I also clear the cache.

verymilan commented 1 month ago

@itgi interesting... I've tried to just redirect using nginx, but it still complaints: Cannot GET /d0566cc58d22570b92963328877b890a/web-apps/apps/documenteditor/main/index_loader.html

Is it not enough to push the request there?

Edit: also not sufficient to change the const in the api.js, i've downgraded as well now

T-Herrmann-WI commented 4 weeks ago

Same problem with OnlyOffice 8.2 and Confluence (with Plugin 5.0.2, 5.1). Error >>> Cannot GET /8.2.0-e31866d0af16534860501da39b4c49c3/web-apps/apps/documenteditor/main/index_loader.html

clearing the browser cache don't work.

m4tze commented 3 weeks ago

I am using the docker version of ds-ee V 8.2.0. I have no ds dev experience so I have absolutely no idea of what has changed from 8.1.3 and 8.2.0. The docker version indeed has the same error.

I found out, that the URL /8.2.0-88d72bc60b1e714a35888b9a72c76d20/web-apps/apps/spreadsheeteditor/main/index_loader.html gives a 404. When removing the first directory (8.2.0-88d72bc60b1e714a35888b9a72c76d20/) I was able to access the html file. Thus, I tried to find the part of code where this directory is added to the string (grep for that string in the apps directory - unfortunately, I cannot do it right now as I am travelling and have no access to the server). I replaced it with just / and after restarting the container, deleting the browser cache and reloading the page, everything works well.

marco-calautti commented 3 weeks ago

I believe this is the line causing the bug

In particular, the function extendAppPath is not present in 8.1.3, and in 8.2.0 it prepends the server version and the hash to the URL.

At the higher level, it seems in 8.2.0, now the path is generated by prepending the version + hash if certain conditions are satisfied: here

The first commit introducing the change is this by maxkadushkin

m4tze commented 3 weeks ago

I believe this is the line causing the bug

It was exactly that line . Change it to const ver = '/'; and the problem will disappear.

igwyd commented 3 weeks ago

Hello @mudza09, I guess this happened because you didn't update the nginx config ds-docservice.conf, like this: nginx_conf

This file has received an important changes in version 8.2 https://github.com/ONLYOFFICE/document-server-package/commit/18c0e2b6e212b4bf5bec33e6546748f7a3266e5a#diff-30777bc66669cf4e659467a42511b2eef0aabf279ed1f7e26fd8c8bb64be8762

Agree to overwrite the config file during the update.

marco-calautti commented 3 weeks ago

@igwyd does this also apply to the docker version? Because I get the error also when updating the container image. I don't see any such message in the logs when starting the container.

igwyd commented 3 weeks ago

@marco-calautti docker is a delivery with installation inside, if you do not modify it, then there should be no errors. Please tell me how you install and update docker so that I can check.

marco-calautti commented 3 weeks ago

I just leave the tag to "latest" and start my docker compose with docker compose up -d

The image gets updated, the document server starts normally, but I get the bug.

igwyd commented 3 weeks ago

Thank you, i will check it.

marco-calautti commented 3 weeks ago

The rewrite change seems to be present in the ngix configuration of the 8.2.0 container: rewrite ^(?<cache>\/web-apps\/apps\/(?!api\/).*)$ $the_scheme://$the_host$the_prefix/8.2.0-$cache_tag$cache redirect;

however it does not seem to work. I still the get error.

igwyd commented 3 weeks ago

I checked, but there is no error and I didn't clear the cache. Can you show your docker-compose.yml without private info? Do you also use the NextCloud as a document storage?

marco-calautti commented 3 weeks ago

Yes, the documents are stored in my Nextcloud instance (no external storage). This the excerpt of my docker-compose file. I am only reporting how I configure Nextcloud and Onlyoffice:

nextcloud:
    container_name: ${NC_CONTAINER_NAME}
    restart: unless-stopped
    image: nextcloud:stable-apache
    cap_add:
      - PERFMON
    devices:
      - "/dev/dri"
    networks:
      - nextcloud-net
    volumes:
      - '${BASE_STORAGE_DIR}/${NC_DATA_DIR}/${NC_CONFIG_DIR}:/var/www/html'
      - type: tmpfs
        target: /tmp
    depends_on:
      nextclouddb:
        condition: service_healthy
      nextcloud-redis:
        condition: service_healthy
      onlyoffice-document-server:
        condition: service_started
    environment:
      - PHP_UPLOAD_LIMIT=500G
      - PHP_MEMORY_LIMIT=4G
      - POST_MAX_SIZE=500G
      - APACHE_BODY_LIMIT=0
      - MYSQL_DATABASE=${NCDB_DATABASE}
      - MYSQL_USER=${NCDB_USER}
      - MYSQL_PASSWORD=${NCDB_PASSWORD}
      - MYSQL_HOST=nextcloud-maria-db
      - REDIS_HOST=nextcloud-redis
      - REDIS_HOST_PASSWORD=${NCREDIS_PASSWORD}
      - NEXTCLOUD_ADMIN_USER=${NC_ADMIN_USER}
      - NEXTCLOUD_ADMIN_PASSWORD=${NC_ADMIN_PASSWORD}
      - NEXTCLOUD_TRUSTED_DOMAINS="${NC_DOMAIN_FREEDNS}"
      - TRUSTED_PROXIES=${NC_SUBNET}
      - OVERWRITECLIURL=https://${NC_DOMAIN_FREEDNS}
      - OVERWRITEPROTOCOL=https
      - OVERWRITEHOST=${NC_DOMAIN_FREEDNS}
      - SMTP_HOST=${NC_SMTP_HOST}
      - SMTP_SECURE=${NC_SMTP_SECURE}
      - SMTP_PORT=${NC_SMTP_PORT}
      - SMTP_NAME=${NC_SMTP_USERNAME}
      - SMTP_PASSWORD=${NC_SMTP_PASSWORD}
      - MAIL_FROM_ADDRESS=${NC_MAIL_FROM_ADDRESS}
      - MAIL_DOMAIN=${NC_MAIL_DOMAIN}
      - NEXTCLOUD_ENABLE_DRI_DEVICE=true
    labels:
        traefik.enable: true
        traefik.http.routers.nextcloud.entrypoints: websecure

        traefik.http.routers.nextcloud.rule: Host(`${NC_DOMAIN_FREEDNS}`)
        traefik.http.services.nextcloud.loadbalancer.server.port: 80
        traefik.http.routers.nextcloud.tls: true
        traefik.http.routers.nextcloud.tls.certresolver: letsencrypt
        traefik.http.routers.nextcloud.middlewares: nextcloud-dav, nextcloud-sts

        traefik.http.middlewares.nextcloud-dav.redirectregex.permanent: true
        traefik.http.middlewares.nextcloud-dav.redirectregex.regex: "^/.well-known/ca(l|rd)dav"
        traefik.http.middlewares.nextcloud-dav.redirectregex.replacement: "/remote.php/dav/"

        traefik.http.middlewares.nextcloud-sts.headers.stspreload: true
        traefik.http.middlewares.nextcloud-sts.headers.stsseconds: 31536000
        traefik.http.middlewares.nextcloud-sts.headers.isdevelopment: false

        traefik.docker.network: nextcloud-net

onlyoffice-document-server:
    container_name: onlyoffice-document-server
    image: onlyoffice/documentserver
    networks:
      - nextcloud-net
      - onlyoffice-net
    stdin_open: true
    tty: true
    restart: unless-stopped
    environment:
      - DB_TYPE=postgres
      - DB_HOST=onlyoffice-postgresql
      - DB_PORT=5432
      - DB_NAME=onlyoffice
      - DB_USER=onlyoffice
      - AMQP_URI=amqp://guest:...@onlyoffice-rabbitmq
      - JWT_ENABLED=true
      - JWT_SECRET=${NC_DOC_SERVER_SECRET}
    depends_on:
      onlyoffice-postgresql:
        condition: service_healthy
      onlyoffice-rabbitmq:
        condition: service_healthy

    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.onlyoffice.rule=Host(`${NC_DOC_SERVER_DOMAIN_FREEDNS}`)"
      - "traefik.http.routers.onlyoffice.entrypoints=websecure"
      - "traefik.http.routers.onlyoffice.tls.certresolver=letsencrypt"
      - "traefik.http.routers.onlyoffice.tls=true"
      - "traefik.http.routers.onlyoffice.middlewares=onlyoffice-headers"
      - "traefik.http.services.onlyoffice.loadbalancer.server.port=8000"
      - "traefik.http.middlewares.onlyoffice-headers.headers.customrequestheaders.X-Forwarded-Proto=https"
      - "traefik.http.middlewares.onlyoffice-headers.headers.accesscontrolalloworiginlist=*"

      - "traefik.docker.network=onlyoffice-net"
    volumes:
      - ${BASE_STORAGE_DIR}/${NC_DATA_DIR}/${NC_DOC_SERVER_DATA_DIR}/data:/var/www/onlyoffice/Data
      - ${BASE_STORAGE_DIR}/${NC_DATA_DIR}/${NC_DOC_SERVER_DATA_DIR}/log:/var/log/onlyoffice
marco-calautti commented 3 weeks ago

Has this maybe anything to do with the fact that nextcloud uses the internal docker host name of the onlyoffice server for internal requests, rather than the public host name via my reverse proxy?

igwyd commented 3 weeks ago

If I understand your traefik configuration correctly, then you are using the docservice port insteed internal nginx port inside onlyoffice/documentserver container, this is mistake, you must use nginx port 80.

- "traefik.http.services.onlyoffice.loadbalancer.server.port=8000"
marco-calautti commented 3 weeks ago

If I understand your traefik configuration correctly, then you are using the docservice port insteed internal nginx port inside onlyoffice/documentserver container, this is mistake, you must use nginx port 80.

- "traefik.http.services.onlyoffice.loadbalancer.server.port=8000"

That was indeed the issue! Here is how I fixed everything:

Everything is working fine as expected now, thanks!

A suggestion to avoid these kind of errors in the future (since some tutorials online still use the direct port) is to simply prevent the Docker image to expose the Onlyoffice server port 8000, but only expose the nginx one.