Botched system update on Debian 12 led to a broken OnlyOffice - how can I reinstall without losing the data?

Hi! Yesterday, in the middle of the frenzy to keep servers up-to-date and patched against the Dirty Frag and other CVS, I update mine (a VPS hosted with Namecheap).

The upgrade failed, though, when it attempted to upgrade some onlyoffice packages. It breaks when attempting to configure docserver, with a sed error.

Thing is, I cannot access my OnlyOffice anymore. Tried a lot of things last night, everything short of completely reinstalling everything, which I don’t want to do in fear of losing access to my documents.

What can I do? If I try to reinstall docserver from the APT repos, it breaks with the bug described above. The best I accomplished so far is a broken login page.

Edit: this is the error I get when attempting to install from the Debian repos:

Stopping services… OK
Configuring docspace… OK
Trying to establish MySQL connection… OK
Configuring redis… OK
Configuring rabbitmq… OK
Configuring opensearch… OK
Configuring docs… sed: -e expression #1, char 65: unterminated `s’ command

Hello,

Thank you for the details.

Before trying any further repair steps, please create a full VPS snapshot/backup first. This is very important before any recovery or reinstall attempt.

To investigate this properly, please describe step by step how exactly you performed the update:

  • which commands you ran;
  • whether this was a regular system upgrade or a manual reinstall attempt;
  • which ONLYOFFICE DocSpace version you are updating from;
  • a bit more information about your environment: exact Debian version, VPS/provider details, and your installation type.
  • please also let us know whether you changed any ONLYOFFICE configuration files manually.

If possible, please send us:

  • the result of dpkg -l | grep -i onlyoffice;
  • any logs related to the failed package upgrade.

Once we have this information, we will be able to check the safest way forward without risking your data.

Sorry for the delay.

I performed a apt full-upgrade, in response of the latest CVEs, and to protect the server.

It upgraded the kernel as always, but also upgraded my OnlyOffice to the latest version (9.3.1-10). During the update process it asked whether to keep or replace some configuration files, which I choose to keep mines. As I was worried about the vulnerabilities, didn’t thought of those maintainer config files too much; TBH, I never thought or was alerted of breaking changes, and the need to replace them. Also, my reasoning was: I have secrets stored there, and some other customizations that will likely break my setup if replaced with default ones.

The kernel upgrades were succesful, but the script broke during the onlyoffice update, especifically during docserver package upgrade. It throw this output:

Configuring docspace… OK
Trying to establish MySQL connection… OK
Configuring redis… OK
Configuring rabbitmq… OK
Configuring opensearch… OK
Configuring docs… sed: -e expression #1, char 65: unterminated `s’ command

Tried to open my OnlyOffice page, but no luck. It showed a HTTP 500 error. Since a reboot was required on the VPS, I hoped it would go away. Had no luck: the problem persisted.

Next, I tried a manual reinstall. No luck either. The installation script always breaks at the same point.

So, at this point, I assume either a bug on the installation script, or an incompatibility of some sort on my Debian, that throws that exception.

I don’t remember the latest version before this update, but assume it was the immediately prior to the latest.

DPKG result:

iF onlyoffice-documentserver 9.3.1-10 amd64 Online editors for text docs, spreadsheets, presentations, PDFs, and PDF forms.

lsb_release -a:

Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm

uname -a:

Linux server1.***.*** 6.1.0-47-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.170-3 (2026-05-08) x86_64 GNU/Linux

I already did a backup of both PostgreSQL database and /Data folder.

Hello,

Thank you for your patience.

At this point, the issue may be related to custom changes in the proxy/OpenResty configuration that were kept during the upgrade.

Please clarify how you originally installed DocSpace. The recommended installation and update flow is based on the official installation script. If possible, please send us the guide or exact installation steps you originally followed.

If you did modify the proxy configuration, please back up the current configuration and then try reinstalling the proxy package with the default maintainer configuration:

sudo cp -r /etc/openresty /etc/openresty.bak
sudo apt-get install --reinstall -o Dpkg::Options::="--force-confnew" docspace-proxy
sudo dpkg --configure docspace

After that, please let us know the result and share the full console output.

If you modified the proxy configuration manually, please also send us the changed files from /etc/openresty/ so we can check which custom setting may be breaking the upgrade.

Hi again and thanks for the swift reply.

I followed the official instructions given here. I do not use Docker, so I issued this command:

bash docspace-install.sh package

I didn’t modify the proxy config. Should I try that reconfiguration nonetheless? At this point I don’t know what else to do.

Thank you for the clarification.

Since you originally installed DocSpace using the official package-based installation script, and you did not modify the proxy configuration manually, it still makes sense to try the targeted reconfiguration step suggested above before considering anything more disruptive.

Please run the commands from the previous message and send us the full console output. Let us know whether the DocSpace web interface becomes accessible again after that.

If this does not resolve the issue, please also send us an archive of the current /etc/openresty/ directory so we can check the configuration in detail.

OK. Tried that. No luck.

So I went ahead and uninstalled everything except Postgre.

Rebooted the vps, launched the script. Failed with OpenSearch.

Here’s the log, attached, if of any help. At this point I don’t know what else to do, short of doing a fresh Debian install, which I would rather not.

OneClickinstall-Debian_20260528_171912.log (126.8 KB)

Hello, thank you for the log. From the part you attached, I do not see an actual OpenSearch installation failure: the package opensearch 2.18.0 is unpacked and configured successfully, and the log explicitly shows the standard post-installation messages.

What I do see is that the system is not fully clean before the new installation attempt. The installer reports docspace is already installed, which means some previous DocSpace state is still detected, and it also warns that an old MySQL data directory /var/lib/mysql is present from a previous installation.

So at the moment it looks more like a re-installation on a server where previous DocSpace components and data were not removed completely.

Please remove the previous installation once again, follow the official removal guide step by step:

Please pay special attention to the note in the guide: this command removes the DocSpace binaries and configuration files, but the dependencies installed with DocSpace remain on the server and can be uninstalled separately.

Please also note that ONLYOFFICE Docs is removed separately, because it remains installed after DocSpace removal.

If you get warnings that some directories are not empty, please remove them manually as described in the guide, then repeat the installation on a clean system state.

If the removal and reinstallation still fail, please save the complete installation log, and send it to us so that we can analyze the full output and see at which step it fails.

Did everything as intended. Replaced the original ds.conf with ds-ssl.conf, adjusting the certificates.

It now loads, but I get the default OnlyOffice Docs screen (“ONLYOFFICE Docs Community Edition installed”). All I can do is start the test example. It should show the login screen of DocSpace.

Can it be because Docs is still installed somehow?

Also, while I attempted to uninstall everything:

root@server1:~# apt purge onlyoffice*
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Unable to locate package onlyoffice.tar
E: Couldn’t find any package by glob ‘onlyoffice.tar’

Seems like some dependencies, or some apt sources, are broken.

Hello, and thank you for the details.

The page “ONLYOFFICE Docs Community Edition installed” is the default welcome page of the Document Server itself. This means your HTTPS configuration for Docs (ds-ssl.conf) now works correctly, but the browser is currently reaching the Document Server URL, not the DocSpace application URL.

DocSpace has its own web entry point (host/port/virtual host) that was configured during its installation and should be opened directly in the browser.

  • Could you please confirm which exact URL you are using when you expect to see the DocSpace login screen?

  • Also, please run and send the output of:
    sudo apt list --installed | egrep 'docspace|onlyoffice-documentserver'
    so we can check the current installation state and advise further.

Could you please also send us the relevant configuration files so we can see how the requests are routed?

  • The DocSpace proxy / vhost config (by default):
    /etc/openresty/conf.d/onlyoffice-proxy.conf
    (or the custom vhost file you use for DocSpace, if it was changed).

You can either attach the files directly (masking any sensitive data, such as real domain names or internal IP addresses, if necessary) or send them to me via private message.


Regarding the command:
apt purge onlyoffice*

The errors

E: Unable to locate package onlyoffice.tar
E: Couldn’t find any package by glob ‘onlyoffice.tar’

appear because the shell expands onlyoffice* to a local file name (for example onlyoffice.tar in the current directory), and then apt tries to treat this as a package name. This does not indicate broken dependencies, it is just an effect of glob expansion.

To avoid this, please use quotes around the pattern, as in the official guides:

  • To remove DocSpace packages on Ubuntu:
    sudo apt purge 'docspace*'
  • To remove ONLYOFFICE Docs (Document Server) separately, if needed:
    sudo apt purge 'onlyoffice-documentserver*'

I’m trying to open mydomain.tld/login. All I get is a Cannot GET /login error. If I open just the domain, I get the default Docs screen.

OK, this is the output of thew egrep:

docspace-ai-service/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-ai/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-api-system/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-api/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-backup-background/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-backup/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-clear-events/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-common/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-doceditor/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-files-services/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-files/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-healthchecks/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-identity-api/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-identity-authorization/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-login/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-management/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-mcp/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-migration-runner/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-notify/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-people-server/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-plugins/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-proxy/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-sdk/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-socket/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-ssoauth/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-studio-notify/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-studio/squeeze,now 3.6.1.560 all [installed,automatic]
docspace-telegram/squeeze,now 3.6.1.560 all [installed,automatic]
docspace/squeeze,now 3.6.1.560 all [installed]
onlyoffice-documentserver/squeeze,now 9.4.0-129 amd64 [installed]

the DocSpace proxy config:

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_hide_header ‘Server’;
proxy_hide_header ‘X-Powered-By’;
proxy_buffering off;
proxy_http_version 1.1;

proxy_buffer_size 128k;
proxy_buffers 8 128k;
proxy_busy_buffers_size 256k;

access_log /var/log/nginx/access-proxy.log;
error_log /var/log/nginx/error-proxy.log;

server {
listen 0.0.0.0:80;
listen [::]:80 default_server;

client_max_body_size 4G;

location / {
    proxy_pass http://127.0.0.1:8092;
}

include /etc/openresty/includes/letsencrypt.conf;

}

And now that I’m looking at it, shouldn’t it point to port 443 instead of 80? This is the default config file, as I didn’t edit it. Should I?

Thank you for the details. From your description, this looks more like a proxy/routing issue.

Please do not switch proxy_pass to port 443 for now; the important part is to verify which backend actually answers your domain requests.

To continue the investigation, please send us the following:

  • The full active NGINX/OpenResty configuration, preferably the output of nginx -T, with at least all server {} blocks for ports 80 and 443 including server_name, listen, location, and proxy_pass.
  • The command output:
    • ss -ltnp | egrep ':80|:443|:8092'
    • curl -I http://127.0.0.1:8092/
    • curl -I http://127.0.0.1:8092/login
    • curl -vk https://mydomain.tld/
    • curl -vk https://mydomain.tld/login
  • Service information:
    • systemctl --type=service | grep -E 'docspace|openresty|nginx'
    • systemctl status openresty nginx --no-pager
  • Recent logs captured right after reproducing the issue:
    • journalctl -u openresty -u nginx -u 'docspace*' -n 200 --no-pager
  • Browser DevTools screenshots from the Console and Network tabs while opening /login.
  • Confirmation of how HTTPS was configured: with the official docspace-ssl-setup script or by manually replacing/copying config files.

Please also note that for package-based DocSpace installation, the recommended HTTPS configuration flow is different from standalone ONLYOFFICE Docs. For DocSpace, please check this guide: Switching your ONLYOFFICE DocSpace Community to HTTPS when installing from RPM/DEB packages

Once we have the outputs above, we will be able to see whether the requests are being handled by the correct virtual host and upstream, and then suggest the exact fix.

OK, I’m not sure if the SSL guide was wrong or pointed to a Docs install, but I managed to get this server up and running again by following those instructions.

The only caveat is that now I have an empty room (i. e. none of the older files are showing), yet my profile is still, somehow, present.

My conjecture here is that I need to change the secrets on local.json for those I saved on a backup. Is that correct? Everything else is working fine now, except for the missing files.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.