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

redis-stack-server.service removed but not replaced during update on Ubuntu 22.04 #441

Open
TimothyBramlett opened this issue Jul 29, 2023 · 8 comments

Comments

@TimothyBramlett
Copy link

redis-stack-server.service removed but not replaced during update on Ubuntu 22.04

Issue

I recently updated the redis-stack-server package from version 6.2.6-v7 to version 6.2.6-v9 on Ubuntu 22.04. After the update, I noticed that the redis-stack-server.service file was removed from the /etc/systemd/system directory and was not replaced.

Steps to Reproduce

  1. Install redis-stack-server version 6.2.6-v7 on Ubuntu 22.04.
  2. Update the package to version 6.2.6-v9.
  3. After the update, check the /etc/systemd/system directory for redis-stack-server.service.

Expected Result

The redis-stack-server.service file is updated and remains in the /etc/systemd/system directory.

Actual Result

The redis-stack-server.service file is removed from the /etc/systemd/system directory and is not replaced.

Additional Information

I'm not sure why this is happening. As far as I know, the redis-stack-server.service file was originally installed automatically when I installed the redis-stack-server package.

I'd appreciate any insights or help in resolving this issue. For now I will just copy it over manually and enable it.

@mika
Copy link

mika commented Aug 16, 2023

Yeah, same here also with the upgrade to 7.2.0-v0 on Debian/bullseye.

The problem is within the postrm maintainer script:

% cat /var/lib/dpkg/info/redis-stack-server.postrm 
#!/bin/sh

if [ -f /etc/systemd/system/redis-stack-server.service ]; then
    rm -f /etc/systemd/system/redis-stack-server.service
fi

if [ -f /etc/systemd/system/redis-stack.service ]; then
    rm -f /etc/systemd/system/redis-stack.service
fi

if [ -f /etc/systemd/system/redis-stack-redis.service ]; then
    rm -f /etc/systemd/system/redis-stack-redis.service
fi

if [ -f /etc/systemd/system/redisinsight.service ]; then
    rm -f /etc/systemd/system/redisinsight.service
fi

This postrm maintenance file is missing proper upgrade/removal handling, the common solution to get rid of configuration files on package removals (actually: purges!) is to check for it via:

case $1 in
  purge)
    $do_whatever_is_needed_on_package_removals
    ;;
esac

And if files need to be removed only for certain versions, then go through dpkg-maintscript-helper rm_conffile ..., see https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html and https://wiki.debian.org/DpkgConffileHandling for details.

@homberger
Copy link

Same here with Ubuntu 20.04.6 LTS.
Unit file was deleted during update to redis-stack-server 7.2.0-v0.

@homberger
Copy link

homberger commented Aug 16, 2023

Even after reinstalling the package the service file is still missing.
If I copy the service file located at /home/runner/work/redis-stack/redis-stack/build/Linux-ubuntu20.04-x86_64.redis-stack-server/etc/systemd/system/redis-stack-server.service the service will still not start but complain about missing shared object file:

# systemctl status redis-stack-server.service
● redis-stack-server.service - Redis stack server
     Loaded: loaded (/etc/systemd/system/redis-stack-server.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2023-08-16 15:41:11 CEST; 5s ago
       Docs: https://redis.io/
    Process: 182924 ExecStart=/opt/redis-stack/bin/redis-server /etc/redis-stack.conf (code=exited, status=1/FAILURE)
   Main PID: 182924 (code=exited, status=1/FAILURE)

Aug 16 15:41:11 example.com redis-server[182924]: 182924:M 16 Aug 2023 15:41:11.529 * <search> RediSearch version 2.8.4 (Git=HEAD-7797d39d)
Aug 16 15:41:11 example.com redis-server[182924]: 182924:M 16 Aug 2023 15:41:11.529 * <search> Low level api version 1 initialized successfully
Aug 16 15:41:11 example.com redis-server[182924]: 182924:M 16 Aug 2023 15:41:11.531 * <search> concurrent writes: OFF, gc: ON, prefix min length: 2, prefix max expansions: 200, query timeout (ms): 500, timeout policy: return, cursor read size: 1000, cursor max idle>
Aug 16 15:41:11 example.com redis-server[182924]: 182924:M 16 Aug 2023 15:41:11.533 * <search> Initialized thread pools!
Aug 16 15:41:11 example.com redis-server[182924]: 182924:M 16 Aug 2023 15:41:11.535 * <search> Enabled role change notification
Aug 16 15:41:11 example.com redis-server[182924]: 182924:M 16 Aug 2023 15:41:11.535 * Module 'search' loaded from /opt/redis-stack/lib/redisearch.so
Aug 16 15:41:11 example.com redis-server[182924]: 182924:M 16 Aug 2023 15:41:11.535 # Module /opt/redis-stack/lib/redisgraph.so failed to load: /opt/redis-stack/lib/redisgraph.so: cannot open shared object file: No such file or directory
Aug 16 15:41:11 example.com redis-server[182924]: 182924:M 16 Aug 2023 15:41:11.535 # Can't load module from /opt/redis-stack/lib/redisgraph.so: server aborting
Aug 16 15:41:11 example.com systemd[1]: redis-stack-server.service: Main process exited, code=exited, status=1/FAILURE
Aug 16 15:41:11 example.com systemd[1]: redis-stack-server.service: Failed with result 'exit-code'.

@mika
Copy link

mika commented Oct 19, 2023

Yeah, same here also with the upgrade to 7.2.0-v0 on Debian/bullseye.

The problem is within the postrm maintainer script:

[...]

This bug is still present with 7.2.0-v4, though the fix should be quite easy.
Would you be willing to accept an PR if I'd provide one, @chayim?

@kissifrot
Copy link

Bumping this since it's still in 7.2.0-v9 😅

@martindale
Copy link

Experiencing this on Ubuntu 22.04

@TimothyBramlett
Copy link
Author

@martindale Yeah who knows maybe it will be fixed in 2025

@wayne530
Copy link

Still happening in 7.2.0_v10-1. Additionally, /etc/redis-stack.conf is silently overwritten on update instead of the standard rpmnew/rpmsave-type behavior.

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

No branches or pull requests

6 participants