Failed to start Redis Datastore Server

Am using redis-cli version 5.0.8 and ubuntu version 18.04

when i try to start redis using sudo systemctl status redis am getting the below error
● redis.service - Redis Datastore Server
Loaded: loaded (/lib/systemd/system/redis.service; enabled; vendor preset: en
Active: failed (Result: exit-code) since Mon 2023-06-19 13:29:59 UTC; 29min a
Process: 11796 ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf (co
Main PID: 11802 (code=exited, status=1/FAILURE)

Jun 19 13:29:58 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Main process exited,
Jun 19 13:29:58 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Failed with result ’
Jun 19 13:29:59 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Service hold-off tim
Jun 19 13:29:59 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Scheduled restart jo
Jun 19 13:29:59 ip-xxx-xx-xx-xxxsystemd[1]: Stopped Redis Datastore Server.
Jun 19 13:29:59 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Start request repeat
Jun 19 13:29:59 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Failed with result ’
Jun 19 13:29:59 ip-xxx-xx-xx-xxxsystemd[1]: Failed to start Redis Datastore Ser
lines 1-14/14 (END)…skipping…

cat opt/redis/redis-5.0.8/redis.log

4123:S 14 Jun 2023 11:40:56.687 # Server initialized
4123:S 14 Jun 2023 11:40:56.688 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
4123:S 14 Jun 2023 11:40:56.689 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never > /sys/kernel/mm/transparent_hugepage/enabled’ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
4123:S 14 Jun 2023 11:40:56.691 * Reading RDB preamble from AOF file…
4123:S 14 Jun 2023 11:40:56.796 * Reading the remaining AOF tail…
4123:S 14 Jun 2023 11:40:56.866 # Bad file format reading the append only file: make a backup of your AOF file, then use ./redis-check-aof --fix
4148:C 14 Jun 2023 11:40:57.188 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
4148:C 14 Jun 2023 11:40:57.189 # Redis version=5.0.8, bits=64, commit=00000000, modified=0, pid=4148, just started
4148:C 14 Jun 2023 11:40:57.190 # Configuration loaded
4148:C 14 Jun 2023 11:40:57.194 # systemd supervision requested, but NOTIFY_SOCKET not found
4160:S 14 Jun 2023 11:40:57.198 * Increased maximum number of open files to 4096 (it was originally set to 1024).

root@ip-172-30-16-112:/opt/redis/redis-5.0.8# journalctl -xe


#NAME?

#NAME?
Jun 19 13:29:58 ip-xxx-xx-xx-xxxaudit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=redis comm=“systemd” exe=“/lib/systemd/systemd”
Jun 19 13:29:58 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Main process exited, code=exited, status=1/FAILURE
Jun 19 13:29:58 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Failed with result ‘exit-code’.
Jun 19 13:29:59 ip-xxx-xx-xx-xxxaudit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=redis comm=“systemd” exe=“/lib/systemd/systemd”
Jun 19 13:29:59 ip-xxx-xx-xx-xxxaudit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=redis comm=“systemd” exe=“/lib/systemd/systemd”
Jun 19 13:29:59 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Service hold-off time over, scheduling restart.
Jun 19 13:29:59 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Scheduled restart job, restart counter is at 5.
#NAME?
#NAME?


#NAME?
#NAME?
Jun 19 13:29:59 ip-xxx-xx-xx-xxxsystemd[1]: Stopped Redis Datastore Server.
#NAME?
#NAME?


#NAME?
Jun 19 13:29:59 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Start request repeated too quickly.
Jun 19 13:29:59 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Failed with result ‘exit-code’.
Jun 19 13:29:59 ip-xxx-xx-xx-xxxsystemd[1]: Failed to start Redis Datastore Server.
#NAME?
#NAME?


#NAME?

#NAME?
Jun 19 13:30:18 ip-xxx-xx-xx-xxxauditbeat[1172]: 2023-06-19T13:30:18.165Z ERROR [publisher_pipeline_output] pipeline/output.go:155
Jun 19 13:30:18 ip-xxx-xx-xx-xxxauditbeat[1172]: 2023-06-19T13:30:18.165Z INFO [publisher_pipeline_output] pipeline/output.go:146
Jun 19 13:30:18 ip-xxx-xx-xx-xxxauditbeat[1172]: 2023-06-19T13:30:18.165Z INFO [publisher] pipeline/retry.go:215 retryer: send w
Jun 19 13:30:18 ip-xxx-xx-xx-xxxauditbeat[1172]: 2023-06-19T13:30:18.165Z INFO [publisher] pipeline/retry.go:219 done
Jun 19 13:30:19 ip-xxx-xx-xx-xxxauditbeat[1172]: 2023-06-19T13:30:19.641Z ERROR [publisher_pipeline_output] pipeline/output.go:155
Jun 19 13:30:19 ip-xxx-xx-xx-xxxauditbeat[1172]: 2023-06-19T13:30:19.641Z INFO [publisher_pipeline_output] pipeline/output.go:146
Jun 19 13:30:19 ip-xxx-xx-xx-xxxauditbeat[1172]: 2023-06-19T13:30:19.641Z INFO [publisher] pipeline/retry.go:215 retryer: send w
Jun 19 13:30:19 ip-xxx-xx-xx-xxxauditbeat[1172]: 2023-06-19T13:30:19.641Z INFO [publisher] pipeline/retry.go:219 done
Jun 19 13:30:23 ip-xxx-xx-xx-xxxauditbeat[1172]: 2023-06-19T13:30:23.208Z INFO [monitoring] log/log.go:145 Non-zero metrics in t
lines 1340-1382/1382 (END)

Mon Jun 19 2023
18:59:30 GMT+0530 (India Standard Time)

cat opt/redis/redis-5.0.8/redis.log

4123:S 14 Jun 2023 11:40:56.687 # Server initialized
4123:S 14 Jun 2023 11:40:56.688 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
4123:S 14 Jun 2023 11:40:56.689 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never > /sys/kernel/mm/transparent_hugepage/enabled’ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
4123:S 14 Jun 2023 11:40:56.691 * Reading RDB preamble from AOF file…
4123:S 14 Jun 2023 11:40:56.796 * Reading the remaining AOF tail…
4123:S 14 Jun 2023 11:40:56.866 # Bad file format reading the append only file: make a backup of your AOF file, then use ./redis-check-aof --fix
4148:C 14 Jun 2023 11:40:57.188 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
4148:C 14 Jun 2023 11:40:57.189 # Redis version=5.0.8, bits=64, commit=00000000, modified=0, pid=4148, just started
4148:C 14 Jun 2023 11:40:57.190 # Configuration loaded
4148:C 14 Jun 2023 11:40:57.194 # systemd supervision requested, but NOTIFY_SOCKET not found
4160:S 14 Jun 2023 11:40:57.198 * Increased maximum number of open files to 4096 (it was originally set to 1024).

Mon Jun 19 2023
18:54:28 GMT+0530 (India Standard Time)
journalctl -u redis

Jun 19 13:17:18 ip-xxx-xx-xx-xxxsystemd[1]: Starting Redis Datastore Server…
Jun 19 13:17:18 ip-xxx-xx-xx-xxxsystemd[1]: Started Redis Datastore Server.
Jun 19 13:17:18 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Main process exited, code=exited, status=1/FAILURE
Jun 19 13:17:18 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Failed with result ‘exit-code’.
Jun 19 13:17:18 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Service hold-off time over, scheduling restart.
Jun 19 13:17:18 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Scheduled restart job, restart counter is at 1.
Jun 19 13:17:18 ip-xxx-xx-xx-xxxsystemd[1]: Stopped Redis Datastore Server.
Jun 19 13:17:18 ip-xxx-xx-xx-xxxsystemd[1]: Starting Redis Datastore Server…
Jun 19 13:17:18 ip-xxx-xx-xx-xxxsystemd[1]: Started Redis Datastore Server.
Jun 19 13:17:18 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Main process exited, code=exited, status=1/FAILURE
Jun 19 13:17:18 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Failed with result ‘exit-code’.
Jun 19 13:17:18 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Service hold-off time over, scheduling restart.
Jun 19 13:17:18 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Scheduled restart job, restart counter is at 2.
Jun 19 13:17:18 ip-xxx-xx-xx-xxxsystemd[1]: Stopped Redis Datastore Server.
Jun 19 13:17:18 ip-xxx-xx-xx-xxxsystemd[1]: Starting Redis Datastore Server…
Jun 19 13:17:18 ip-xxx-xx-xx-xxxsystemd[1]: Started Redis Datastore Server.
Jun 19 13:17:19 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Main process exited, code=exited, status=1/FAILURE
Jun 19 13:17:19 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Failed with result ‘exit-code’.
Jun 19 13:17:19 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Service hold-off time over, scheduling restart.
Jun 19 13:17:19 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Scheduled restart job, restart counter is at 3.
Jun 19 13:17:19 ip-xxx-xx-xx-xxxsystemd[1]: Stopped Redis Datastore Server.
Jun 19 13:17:19 ip-xxx-xx-xx-xxxsystemd[1]: Starting Redis Datastore Server…
Jun 19 13:17:19 ip-xxx-xx-xx-xxxsystemd[1]: Started Redis Datastore Server.
Jun 19 13:17:19 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Main process exited, code=exited, status=1/FAILURE
Jun 19 13:17:19 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Failed with result ‘exit-code’.
Jun 19 13:17:19 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Service hold-off time over, scheduling restart.
Jun 19 13:17:19 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Scheduled restart job, restart counter is at 4.
Jun 19 13:17:19 ip-xxx-xx-xx-xxxsystemd[1]: Stopped Redis Datastore Server.
Jun 19 13:17:19 ip-xxx-xx-xx-xxxsystemd[1]: Starting Redis Datastore Server…
Jun 19 13:17:19 ip-xxx-xx-xx-xxxsystemd[1]: Started Redis Datastore Server.
Jun 19 13:17:20 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Main process exited, code=exited, status=1/FAILURE
Jun 19 13:17:20 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Failed with result ‘exit-code’.
Jun 19 13:17:20 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Service hold-off time over, scheduling restart.
Jun 19 13:17:20 ip-xxx-xx-xx-xxxsystemd[1]: redis.service: Scheduled restart job, restart counter is at 5.
Jun 19 13:17:20 ip-xxx-xx-xx-xxxsystemd[1]: Stopped Redis Datastore Server.
Jun 19 13:17:20 ip-xxx-xx-xx-xxx systemd[1]: redis.service: Start request repeated too quickly.
Jun 19 13:17:20 ip-xxx-xx-xx-xxx systemd[1]: redis.service: Failed with result ‘exit-code’.
Jun 19 13:17:20 ip-xxx-xx-xx-xxx systemd[1]: Failed to start Redis Datastore Server.

It seems that Redis can’t load the AOF - try fixing it and then retry.