Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/redis] Can't open the append-only file: Permission denied #5041

Closed
guytish opened this issue Apr 15, 2018 · 20 comments
Closed

[stable/redis] Can't open the append-only file: Permission denied #5041

guytish opened this issue Apr 15, 2018 · 20 comments

Comments

@guytish
Copy link

guytish commented Apr 15, 2018

Is this a request for help?:
Yes

Is this a BUG REPORT or FEATURE REQUEST? (choose one):
BUG REPORT

Version of Helm and Kubernetes:
Helm:
Client: &version.Version{SemVer:"v2.8.2", GitCommit:"a80231648a1473929271764b920a8e346f6de844", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.8.2", GitCommit:"a80231648a1473929271764b920a8e346f6de844", GitTreeState:"clean"}

Kubernetes:
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.4", GitCommit:"9befc2b8928a9426501d3bf62f72849d5cbcd5a3", GitTreeState:"clean", BuildDate:"2017-11-20T05:28:34Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.0", GitCommit:"0b9efaeb34a2fc51ff8e4d34ad9bc6375459c4a4", GitTreeState:"clean", BuildDate:"2017-11-29T22:43:34Z", GoVersion:"go1.9.1", Compiler:"gc", Platform:"linux/amd64"}

Minikube:
minikube version: v0.24.1

Which chart:
stable/redis

What happened:
Redis is not running.
dev-redis-master-0 0/1 CrashLoopBackOff
dev-redis-slave-85b676ddc7-64j9d 0/1 CrashLoopBackOff

Master logs:
WARN ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
nami INFO Initializing redis
redis INFO ==> Validating inputs...
redis WARN Allowing the "password" input to be empty
redis INFO ==> Disabling commands...
redis INFO ==> Disabled commands: FLUSHDB, FLUSHALL
redis INFO ==> Configuring replication settings...
redis INFO ==> Setting up Redis master...
redis INFO
redis INFO ########################################################################
redis INFO Installation parameters for redis:
redis INFO Password: Not set during installation
redis INFO Replication Mode: master
redis INFO (Passwords are not shown for security reasons)
redis INFO ########################################################################
redis INFO
nami INFO redis successfully initialized
INFO ==> Starting redis...
28:C 15 Apr 11:31:21.240 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
28:C 15 Apr 11:31:21.240 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=28, just started
28:C 15 Apr 11:31:21.240 # Configuration loaded
28:M 15 Apr 11:31:21.241 # Can't open the append-only file: Permission denied

Slave logs:
WARN ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
nami INFO Initializing redis
redis INFO ==> Validating inputs...
redis WARN Allowing the "password" input to be empty
redis WARN Allowing the "masterPassword" input to be empty
redis INFO ==> Disabling commands...
redis INFO ==> Disabled commands: FLUSHDB, FLUSHALL
redis INFO ==> Configuring replication settings...
redis INFO ==> Checking if master is ready to accept connection...
Error executing 'postInstallation': Failed to connect to dev-redis-master:6379 after 36 tries

How to reproduce it (as minimally and precisely as possible):
helm --kube-context test install --tiller-namespace dev --namespace dev --name dev --set usePassword=false stable/redis

@guytish
Copy link
Author

guytish commented Apr 30, 2018

Anything new here?

@FuzzOli87
Copy link

@guytish It doesn't look like you're changing the securityContext.enabled property. But when I run it with it as false, i get the error you describe. When I run it with the default, it works.

However, running it with them enabled prevents istio from working with it...

@guytish
Copy link
Author

guytish commented May 14, 2018

@FuzzOli87 - Thanks! so looks like the default is wrong. When I'm passing --set master.securityContext.enabled=true it works for me too.

@guytish guytish closed this as completed May 14, 2018
@ahmadalli
Copy link
Contributor

ahmadalli commented Aug 21, 2018

I have the same issue with sentry chart. but setting master.securityContext.enabled value didn't help

@memwey
Copy link

memwey commented Sep 14, 2018

Same problem with @ahmadalli

@ahmadalli
Copy link
Contributor

@Eloahman I've resolved the issue by adding these values:

redis.master.securityContext.enabled=true
redis.master.securityContext.runAsUser=0
redis.master.securityContext.fsGroup=2000

@raitucarp
Copy link

raitucarp commented Aug 5, 2019

Why I still have this issue lately?

�[0m�[38;5;2mINFO �[0m ==> ** Starting Redis **
1:C 05 Aug 2019 04:15:23.187 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 05 Aug 2019 04:15:23.187 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 05 Aug 2019 04:15:23.187 # Configuration loaded
1:M 05 Aug 2019 04:15:23.187 # Can't open the append-only file: Permission denied

@jaskiratr
Copy link

In case you are running this on local machine, like me, make sure docker has access to the drives under Resources > File sharing.

image

My issue was resolved after enabling the access.

@afsalcodehack
Copy link

Why I still have this issue lately?

�[0m�[38;5;2mINFO �[0m ==> ** Starting Redis **
1:C 05 Aug 2019 04:15:23.187 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 05 Aug 2019 04:15:23.187 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 05 Aug 2019 04:15:23.187 # Configuration loaded
1:M 05 Aug 2019 04:15:23.187 # Can't open the append-only file: Permission denied

Did you solve this issues ?

@LiviuCornel
Copy link

I have the same issue like you @afsalcodehack .

@afsalcodehack
Copy link

try to install redis with release name
helm install --name my-release stable/redis

@LiviuCornel
Copy link

Thanks for the advice @afsalcodehack . I've already used that command, the problem is another. I've tried to install redis on a Kubernetes cluster with three nodes remotly. The first time when you install redis not start like a root service. I've resolved launching the followiing command on the nodes sudo chown -R 1001:1001 /redisPvFolder. I don't understand why but worked for me. This is the source https://stackoverflow.com/questions/55201167/redis-service-fails-with-permission-denied-on-append-file.

@afsalcodehack
Copy link

@LiviuCornel where i execute this command in windows sudo chown -R 1001:1001 /redisPvFolder

@LiviuCornel
Copy link

@afsalcodehack I ran the command for each folder corresponding to the persistence volumes present on the physical nodes. Later I simply restarted redis. For example if we create a persistent volume for a master node in the definition of the kind we specify the entry hostPath:
path: "/ mnt / data / redis-master-0"
, then just access the machine or machines that make up the cluster and run the command sudo chown -R 1001: 1001 / mnt / data / redis-master-0

@LiviuCornel
Copy link

You have a virtual machine like minikube with docker tool box ?

@afsalcodehack
Copy link

yes im using minikube

@LiviuCornel
Copy link

@afsalcodehack
You can try launching a shell inside the redis pod, accessing the desired path and launching the command there

@afsalcodehack
Copy link

@LiviuCornel Thank you

@raitucarp
Copy link

raitucarp commented May 14, 2020

Why I still have this issue lately?

�[0m�[38;5;2mINFO �[0m ==> ** Starting Redis **
1:C 05 Aug 2019 04:15:23.187 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 05 Aug 2019 04:15:23.187 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 05 Aug 2019 04:15:23.187 # Configuration loaded
1:M 05 Aug 2019 04:15:23.187 # Can't open the append-only file: Permission denied

Did you solve this issues ?

I switched from minikube to docker-desktop kubernetes.

@LiviuCornel
Copy link

The fundamental problem is that when redis starts, for the containerization, by default it starts with the user 1001 that does not have access to the file system. Therefore with the chown command you can assign a folder of the file system to a user. By executing the command sudo chown -R 1001: 1001 / path, access to that foder is enabled.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants