ansible-redis icon indicating copy to clipboard operation
ansible-redis copied to clipboard

Redis start fails due to 'protected-mode yes'

Open johanneskastl opened this issue 2 years ago • 4 comments

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.

johanneskastl avatar Apr 21 '23 06:04 johanneskastl

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

yo-han avatar May 19 '23 15:05 yo-han

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?

johanneskastl avatar May 22 '23 05:05 johanneskastl

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)

c13 avatar Dec 03 '23 13:12 c13

Issue still persists, looks like the earliest version to support this is 4.0-rc1, the commit is https://github.com/redis/redis/commit/edd4d555df57dc84265fdfb4ef59a4678832f6da 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?

TheSupremeGod avatar Mar 01 '24 15:03 TheSupremeGod