Opensearch holding back update to 3.0

While trying to update a DEB package installation of DocSpace from 2.6 to 3.0 the packages are held back because of opensearch. Any idea why this happens and how to solve it?

Logs below:

sudo apt upgrade 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  linux-image-5.15.0-125-generic linux-modules-5.15.0-125-generic openresty-openssl111 openresty-pcre
Use 'sudo apt autoremove' to remove them.
Get more security updates through Ubuntu Pro with 'esm-apps' enabled:
  libavdevice58 ffmpeg libpostproc55 libavcodec58 libavutil56 libswscale5
  libswresample3 libavformat58 libavfilter7
Learn more about Ubuntu Pro at https://ubuntu.com/pro
The following packages have been kept back:
  docspace docspace-api docspace-api-system docspace-backup docspace-backup-background docspace-clear-events docspace-common docspace-doceditor docspace-files docspace-files-services
  docspace-healthchecks docspace-login docspace-migration-runner docspace-notify docspace-people-server docspace-proxy docspace-socket docspace-ssoauth docspace-studio
  docspace-studio-notify
0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up opensearch (2.18.0) ...
Running OpenSearch Post-Installation Script
ERROR: Something went wrong during demo configuration installation. Please see the logs in /var/log/opensearch/install_demo_configuration.log
dpkg: error processing package opensearch (--configure):
 installed opensearch package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.35-0ubuntu3.8) ...
Errors were encountered while processing:
 opensearch
E: Sub-process /usr/bin/dpkg returned an error code (1)

Thanks!

I managed to update by adding exit 0 on top of the /var/lib/dpkg/info/opensearch.postinst script.

After that i ran

sudo apt install --only-upgrade docspace docspace-api docspace-api-system docspace-backup docspace-backup-background docspace-clear-events docspace-common docspace-doceditor docspace-files docspace-files-services docspace-healthchecks docspace-login docspace-migration-runner docspace-notify docspace-people-server docspace-proxy docspace-socket docspace-ssoauth docspace-studio docspace-studio-notify

The update seems to have been successful, but i still do not understand why this issue occurs and what issues might it cause on DocSpace.

Hello @irdi
It’s better to use installation script for the update process: Installing ONLYOFFICE DocSpace with additional script parameters - ONLYOFFICE
This is well-tested scenario.
Please clarify your OS and let us know if you’re facing any issues right now (with the search feature in particular).

I am using Ubuntu 22.04. I used the script for the installation using DEB packages. The update script does not update DocSpace though. Already tried it.

When using the script

Setting up opensearch (2.18.0) …
Running OpenSearch Post-Installation Script
ERROR: Something went wrong during demo configuration installation. Please see the logs in /var/log/opensearch/install_demo_configuration.log
dpkg: error processing package opensearch (–configure):
installed opensearch package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.35-0ubuntu3.8) …
Errors were encountered while processing:
opensearch
E: Sub-process /usr/bin/dpkg returned an error code (1)
2024-11-28 10:37:27 - Error: Failed to install packages (Exit Code: 0)

Logs:

tail -f /var/log/opensearch/install_demo_configuration.log

** Warning: Do not use on production or public reachable systems **

OpenSearch install type: rpm/deb on Linux 5.15.0-125-generic amd64
OpenSearch config dir: /etc/opensearch/
OpenSearch config file: /etc/opensearch/opensearch.yml
OpenSearch bin dir: /usr/share/opensearch/bin/
OpenSearch plugins dir: /usr/share/opensearch/plugins/
OpenSearch lib dir: /usr/share/opensearch/lib/
Detected OpenSearch Version: 2.18.0
Detected OpenSearch Security Version: 2.18.0.0
No custom admin password found. Please provide a password via the environment variable OPENSEARCH_INITIAL_ADMIN_PASSWORD.

Hi @Alexandre This is still an issue. My first test with the workaround was done on a test server. After that again i tried the update script both on a test server and in production and it did not work.

New error:

Configuring docspace… OK
Trying to establish MySQL connection… OK
Configuring docs… sed: -e expression #1, char 67: unterminated `s’ command
dpkg: error processing package docspace (–configure):
installed docspace package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
opensearch
docspace
E: Sub-process /usr/bin/dpkg returned an error code (1)

Solved it.

The issue was with the permissions. I found this error in the logs

Unhandled exception. System.UnauthorizedAccessException: Access to the path '/etc/onlyoffice/docspace/appsettings.enterprise.json' is denied.

And it seems that during the update all the files under /etc/onlyoffice/docspace/ change permission from ONLYOFFICE to root, and the scripts can read the config files. After switching the permissions, it finally worked.

Still had to stop this script from running /var/lib/dpkg/info/opensearch.postinst

By adding exit 0 on top of the script.

#!/bin/bash

exit 0

#Copyright OpenSearch Contributors

Thanks for the support!

1 Like