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 start fails due to 'protected-mode yes' #287

Open
johanneskastl opened this issue Apr 21, 2023 · 4 comments
Open

Redis start fails due to 'protected-mode yes' #287

johanneskastl opened this issue Apr 21, 2023 · 4 comments

Comments

@johanneskastl
Copy link

Apr 21 06:27:15 netbox systemd[1]: Starting redis_6379.service - Advanced key-value store...
Apr 21 06:27:15 netbox redis-server[10661]: *** FATAL CONFIG FILE ERROR ***
Apr 21 06:27:15 netbox redis-server[10661]: Reading the configuration file, at line 7
Apr 21 06:27:15 netbox redis-server[10661]: >>> 'protected-mode yes'
Apr 21 06:27:15 netbox redis-server[10661]: Bad directive or wrong number of arguments
Apr 21 06:27:15 netbox systemd[1]: redis_6379.service: Control process exited, code=exited, status=1/FAILURE
Apr 21 06:27:15 netbox systemd[1]: redis_6379.service: Failed with result 'exit-code'.
Apr 21 06:27:15 netbox systemd[1]: Failed to start redis_6379.service - Advanced key-value store.

Tested using 1.2.11 on Fedora37.

Removing the options allows the service to start.

@yo-han
Copy link

yo-han commented May 19, 2023

Did you change the redis_version variable? The default is a very old version not supporting this param.

@johanneskastl
Copy link
Author

Did you change the redis_version variable? The default is a very old version not supporting this param.

I do no longer have the playbooks around, but AFAIR I did change the version. I just took the defaults at first, but then tried a newer version and also got that error.

Anyway, updating the default version to something current would be a good idea, wouldn't it?

@c13
Copy link

c13 commented Dec 3, 2023

Ubuntu 22.04.3 LTS

Variables

redis_version: 7.2.3
redis_install_from_source: false
redis_protected_mode: "no"

Ansible play

TASK [ansible-redis-master : ensure redis is running] **********************************************************************************************************************
fatal: [develop]: FAILED! => {"changed": false, "msg": "Unable to start service redis_6379: Job for redis_6379.service failed because the control process exited with error code.\nSee "systemctl status redis_6379.service" and "journalctl -xeu redis_6379.service" for details.\n"}

Journal

Dec 03 13:37:44 test1 systemd[1]: redis_6379.service: Start request repeated too quickly.
Dec 03 13:37:44 test1 systemd[1]: redis_6379.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit redis_6379.service has entered the 'failed' state with result 'exit-code'.
Dec 03 13:37:44 test1 systemd[1]: Failed to start Advanced key-value store.
░░ Subject: A start job for unit redis_6379.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit redis_6379.service has finished with a failure.
░░
░░ The job identifier is 4342 and the job result is failed.

Solution

redis_install_from_source: true

because it install incorrect version of redis-server
dpkg -l | grep redis
ii redis 5:6.0.16-1ubuntu1 all Persistent key-value database with network interface (metapackage)
ii redis-server 5:6.0.16-1ubuntu1 amd64 Persistent key-value database with network interface
ii redis-tools 5:6.0.16-1ubuntu1 amd64 Persistent key-value database with network interface (client)

@TheSupremeGod
Copy link

Issue still persists, looks like the earliest version to support this is 4.0-rc1, the commit is redis/redis@edd4d55
I'll test if 4.0-rc1 still works with this repo.
I would suggest simply updating the default redis version to 4.0-rc1, would this be a viable fix?

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

4 participants