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

[chart/redis-ha] split-brain-fix.sh is executed on "sh" but uses "==" instead of "=" for comparison #229

Closed
ramanNarasimhan77 opened this issue Sep 13, 2022 · 2 comments · Fixed by #230

Comments

@ramanNarasimhan77
Copy link

ramanNarasimhan77 commented Sep 13, 2022

Hello,
I'm trying to install argocd helm chart and it has a dependency on redis-ha.

Observed that sometimes, the redis pods keep crashing and go into crash loop back off state; and on checking logs for errors I noticed the following error appearing repeatedly in the split-brain-fix container logs

+ [ 10.104.191.33 == 10.104.191.33 ]                                                                                                                      │
/readonly-config/fix-split-brain.sh: 276: [: 10.104.191.33: unexpected operator

Note: I edited the container command/args to run the script in debug mode by adding -x

Though I am not sure if the redis container crash loop is related to this error, while debugging I found that this error is caused because the script is invoked using "sh" which does not support comparison using "==" operator
Comparison using "==" is being done in fix-split-brain.sh:276

I think this issue is causing the flow-of-control to always go into the else block

Reference: https://www.shellcheck.net/wiki/SC3014

@ramanNarasimhan77 ramanNarasimhan77 changed the title [chart/redis-ha] split-brain-fix.sh runs on "sh" but uses "==" instead of "=" for comparison [chart/redis-ha] split-brain-fix.sh is executed on "sh" but uses "==" instead of "=" for comparison Sep 13, 2022
@DandyDeveloper
Copy link
Owner

@ramanNarasimhan77 This will specifically be the split-brain container failing on a specific part of the shell script that it uses to determine split brain state.

I'm going to take a quick look. Possible a simple mistake made by a recent commit.

@DandyDeveloper
Copy link
Owner

image

This would be valid if we were using bash, but pretty sure the alpine and script is called using POSIX/Shell. So it probably should be =.

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

Successfully merging a pull request may close this issue.

2 participants