Dears,
I’m running multiple instances of redis image in single container. The first 3 images are running as expected but 4th onwards getting failed with error as below.
Can anyone help me in resolving this issue ASAP.
Thanks in advance.
Poorna M
Share and learn in the Docker community.
Dears,
I’m running multiple instances of redis image in single container. The first 3 images are running as expected but 4th onwards getting failed with error as below.
Can anyone help me in resolving this issue ASAP.
Thanks in advance.
Poorna M
Please don’t post text as images. Also, please provide the commands you’re using.
@avbentem,
Thanks for your inputs.
Here i have attached my github repository link.
Note: For testing purpose I have split and used 2 different .yml files.
Let me know your views on this.
This is not an “image not found” error message. It is the “find” command which wants to search for files owned by the “redis” user. Try this to confirm it:
mkdir testfolder
cd testfolder
find -name idontexist
You will get:
find: ‘idontexist’ is not the name of a known user
How do you start the containers? Is the error message from the container or you have a script which runs “find” before starting images?
Hi @rimelek ,
I created docker-compose.yml file as attached in GitHub repo and i used docker-compose up command in my windows system.
I have no other script except the Redis command in .yml file. This error i get in Docker desktop application.
For reference I have attached screenshot below.
Thanks
This is the part of the entrypoint which causes the error message
All of your previous containers are using anonymous volumes, but you mounted folders to your sentinel container. It would not be a problem, but you also mounted a folder to /etc
which contains the passwd file with the users. So you basically deleted everything from the most important system folder so the container does not know anything about the redis user.
Mount the config files into a subfolder under /etc
and it will work.
volumes:
- ./Config/1/sentinel.conf:/etc/sentinel.conf
I tried the method you suggested above and it worked .
Still I’m not sure why it was not working even if mounted /etc
folder didn’t had any password protected file.
I’m facing another issue. The running containers don’t have permission to write/update files. Redis servers failing with permission denied
error.
Could you tell me the way to give write permission to mounted folders…?
FYI, I’m working in windows system
Thanks in advance
Simply because you broke a system folder so the user did not exist in the container. /etc/passwd
is not for paswords. That is /etc/shadow
but it doesn’t matter. The user did not exists and that folder contains other config files like dns configuration among many.
redis needs to write the data fodler so you need to set the owner of the files on your host to redis. Since redis as suername probably does not exist on your host, use the user id, which is 999.
chown -R 999 ./data
Thanks. redis can access the file. But writing to file is failing with error Could not rename tmp config file (Device or resource busy)
. Any idea on this error.?
If it wants to rename the mounted file, it will not be able to. You can’t rename a mount point. Is this the whole error message? Do you have anything in the log before the error? I don’t know why redis would rename a config file. Without knowing which file we are talking about, I could just guess that it is the mounted file. In that case you have two options:
/etc/redis
instead of /etc
and mount the folder again as you did before but now to the empty folder not /etc
so you don’t hide the content of /etc
.@rimelek ,
The first option the you suggested gave me error as find: 'redis' is not the name of a known user
.
In second option i need small clarification.
Is it like creating docker image for each redis node(3 in my scenario) with respective config file …? (Which I feel it is a repetitive task)
Or Is it like creating centralized config file repository and passing file location as parameter to redis images…?
Appreciate your help.
Thanks,
@poorna07
Then you you did not do it correctly. Make sure you don’t mount anything to /etc
nor any other system file. Can you share how you did it?
That is an option, yes.
That is an option too. If you create your own entrypoint (a little more advanced solution, I would avoid that at this point) you can chose the config based on an environment variable. Or an even more advanced but also a more standard solution is to generate the entire config dynamically inside the container using environment variables.
I would continue with the first solution for now which gave you an error again, because that could not give you the error if you do it right.
Yes there was error in folder structure. As of now i fixed it here.
I’m not facing any errors in normal scenario. But when master node goes down(failover scenario), sentinels give error as failed to resolve hostname
Any idea on this…?
Since all of your containers are referring to the master node’s hostname, I think it is not surprising, but this topic becomes less and less focused on the original question. Please, open a new topic for new questions.
update:
Since I don’t use Redis sentinel, I am not sure if that error message is normal or not, but I am sure, you should ask it in an other topic if you want someone to notice it who can help.
Sure I will do that.
Is there any way to mark your answer as solution and close this topic in forum…?
Thanks and really appreciate your help.
Closing it is not necessary, but you should see a “Solution” button under every answer. It is not available in every topic, but it should be in this one I think. Just make sure you mark the answer of the original question so other users will know which is what they came for when they read the title.
Since the title didn’t really refer to the actual problem, I renamed this topic.
If you can’t find the solution button, it’s fine. I don’t do it for the statistics.