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

[bitnami/redis] Diagnostic mode not working as needed #9926

Closed
jonathon2nd opened this issue Apr 25, 2022 · 3 comments
Closed

[bitnami/redis] Diagnostic mode not working as needed #9926

jonathon2nd opened this issue Apr 25, 2022 · 3 comments
Labels
stale 15 days without activity

Comments

@jonathon2nd
Copy link
Contributor

jonathon2nd commented Apr 25, 2022

Name and Version

bitnami/redis 16.8.7

What steps will reproduce the bug?

In k8s, deploy bitnami/redis in diagnostic mode diagnosticMode.enabled: true
Then go to start each redis and sentinel.
For redis, instructions are incomplete.
For sentinel, instructions fail.

Are you using any custom parameters or values?

---
image:
  debug: true
auth:
  password: "password"
replica:
  replicaCount: 1
  persistence:
    enabled: false
sentinel:
  enabled: true
  image:
    debug: true
  quorum: 1
diagnosticMode:
  enabled: true

What is the expected behavior?

Expected behavior is for both redis and sentinel to start with provided commands.

$ helm install -n redis1 redis  bitnami/redis -f redis-simple.yml 
NAME: redis
LAST DEPLOYED: Mon Apr 25 15:13:22 2022
NAMESPACE: redis1
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: redis
CHART VERSION: 16.8.7
APP VERSION: 6.2.6

** Please be patient while the chart is being deployed **
The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with:

  command:
    - sleep
  args:
    - infinity

Get the list of pods by executing:

  kubectl get pods --namespace redis1 -l app.kubernetes.io/instance=redis

Access the pod you want to debug by executing

  kubectl exec --namespace redis1 -ti <NAME OF THE POD> -- bash

In order to replicate the container startup scripts execute this command:

For Redis:

    /opt/bitnami/scripts/redis/entrypoint.sh /opt/bitnami/scripts/redis/run.sh

For Redis Sentinel:

    /opt/bitnami/scripts/redis-sentinel/entrypoint.sh /opt/bitnami/scripts/redis-sentinel/run.sh

What do you see instead?

For redis:

I have no name!@redis-node-0:/$ /opt/bitnami/scripts/redis/entrypoint.sh /opt/bitnami/scripts/redis/run.sh
redis 21:32:25.97 
redis 21:32:25.98 Welcome to the Bitnami redis container
redis 21:32:25.98 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-redis
redis 21:32:25.98 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-redis/issues
redis 21:32:25.98 
redis 21:32:25.99 INFO  ==> ** Starting Redis setup **
redis 21:32:26.02 DEBUG ==> Validating settings in REDIS_* env vars..
redis 21:32:26.02 INFO  ==> Initializing Redis
redis 21:32:26.03 DEBUG ==> Ensuring expected directories/files exist
redis 21:32:26.05 INFO  ==> ** Redis setup finished! **

redis 21:32:26.08 INFO  ==> ** Starting Redis **
28:C 25 Apr 2022 21:32:26.093 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
28:C 25 Apr 2022 21:32:26.093 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=28, just started
28:C 25 Apr 2022 21:32:26.093 # Configuration loaded
28:M 25 Apr 2022 21:32:26.094 * monotonic clock: POSIX clock_gettime
28:M 25 Apr 2022 21:32:26.095 # Can't open the append-only file: Permission denied

Solution: https://github.com/bitnami/bitnami-docker-redis/issues/231#issuecomment-1036099863
cd to /bitnami/redis/data, then redo command

I have no name!@redis-node-0:/$ cd /bitnami/redis/data 
I have no name!@redis-node-0:/bitnami/redis/data$ /opt/bitnami/scripts/redis/entrypoint.sh /opt/bitnami/scripts/redis/run.sh
redis 21:33:34.17 
redis 21:33:34.18 Welcome to the Bitnami redis container
redis 21:33:34.18 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-redis
redis 21:33:34.18 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-redis/issues
redis 21:33:34.18 
redis 21:33:34.19 INFO  ==> ** Starting Redis setup **
redis 21:33:34.21 DEBUG ==> Validating settings in REDIS_* env vars..
redis 21:33:34.21 INFO  ==> Initializing Redis
redis 21:33:34.22 DEBUG ==> Ensuring expected directories/files exist
redis 21:33:34.24 INFO  ==> ** Redis setup finished! **

redis 21:33:34.27 INFO  ==> ** Starting Redis **
54:C 25 Apr 2022 21:33:34.286 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
54:C 25 Apr 2022 21:33:34.286 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=54, just started
54:C 25 Apr 2022 21:33:34.286 # Configuration loaded
54:M 25 Apr 2022 21:33:34.287 * monotonic clock: POSIX clock_gettime
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 6.2.6 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                  
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 54
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           https://redis.io       
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

54:M 25 Apr 2022 21:33:34.288 # Server initialized
54:M 25 Apr 2022 21:33:34.289 * Ready to accept connections

Sentinel completely fails

I have no name!@redis-node-0:/$ /opt/bitnami/scripts/redis-sentinel/entrypoint.sh /opt/bitnami/scripts/redis-sentinel/run.sh
redis-sentinel 21:34:26.13 
redis-sentinel 21:34:26.13 Welcome to the Bitnami redis-sentinel container
redis-sentinel 21:34:26.13 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-redis-sentinel
redis-sentinel 21:34:26.13 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-redis-sentinel/issues
redis-sentinel 21:34:26.13 
redis-sentinel 21:34:26.14 INFO  ==> ** Starting Redis sentinel setup **
redis-sentinel 21:34:26.17 DEBUG ==> Validating settings in REDIS_* env vars..
redis-sentinel 21:34:26.17 ERROR ==> The configuration file /opt/bitnami/redis-sentinel/etc/sentinel.conf is not writable
I have no name!@redis-node-0:/$ ls /opt/bitnami/redis-sentinel/etc/sentinel.conf
ls: cannot access '/opt/bitnami/redis-sentinel/etc/sentinel.conf': No such file or directory
I have no name!@redis-node-0:/$ ls /opt/bitnami/redis-sentinel/etc/             
I have no name!@redis-node-0:/$ touch /opt/bitnami/redis-sentinel/etc/sentinel.conf
I have no name!@redis-node-0:/$ /opt/bitnami/scripts/redis-sentinel/entrypoint.sh /opt/bitnami/scripts/redis-sentinel/run.sh
redis-sentinel 21:34:48.59 
redis-sentinel 21:34:48.60 Welcome to the Bitnami redis-sentinel container
redis-sentinel 21:34:48.60 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-redis-sentinel
redis-sentinel 21:34:48.60 Submit issues and feature requests at https://github.com/bitnami/bitnami-docker-redis-sentinel/issues
redis-sentinel 21:34:48.60 
redis-sentinel 21:34:48.61 INFO  ==> ** Starting Redis sentinel setup **
redis-sentinel 21:34:48.63 DEBUG ==> Validating settings in REDIS_* env vars..
redis-sentinel 21:34:48.65 INFO  ==> Initializing Redis Sentinel...
redis-sentinel 21:34:48.66 INFO  ==> Persisted files detected, restoring...
rm: cannot remove '/opt/bitnami/redis-sentinel/etc': Device or resource busy
I have no name!@redis-node-0:/$ 

Additional information

Hoping to use https://github.com/bitnami/charts/blob/master/bitnami/redis/values.yaml#L53 to make some progress on #9689

@javsalgar
Copy link
Contributor

Hi,

Thank you so much for reporting. Indeed, the command is incorrect. In the case of Redis primary, it should be:

/opt/bitnami/scripts/start-scripts/start-master.sh

In the case of replica:

/opt/bitnami/scripts/start-scripts/start-replica.sh

In the case of sentinel:

/opt/bitnami/scripts/start-scripts/start-sentinel.sh

Would you like to submit a PR fixing the NOTES.txt file?

@github-actions
Copy link

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

@github-actions github-actions bot added the stale 15 days without activity label May 12, 2022
@github-actions
Copy link

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

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

No branches or pull requests

2 participants