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

RDB file set to save in wrong folder #128

Closed
bitkill opened this issue Mar 1, 2018 · 9 comments
Closed

RDB file set to save in wrong folder #128

bitkill opened this issue Mar 1, 2018 · 9 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@bitkill
Copy link

bitkill commented Mar 1, 2018

Hi. I have a strange problem with redis. After starting the container, it works ok, but after awhile, it gives me an save error, and blocks my queue service from writing data.
I'm using the redis:latest image. Composing via docker-compose

redis:
    image: redis:latest
    volumes:
      - "./redis_data:/data"
    ports:
      - "6379:6379"
    # expose: [ "6379" ]
    networks:
      - redisnw
    restart: always

It gives me this error:

redis_1           | 1:M 01 Mar 18:45:14.098 * 1 changes in 3600 seconds. Saving...
redis_1           | 1:M 01 Mar 18:45:14.098 * Background saving started by pid 1084
redis_1           | 1084:C 01 Mar 18:45:14.099 # Failed opening the RDB file root (in server root dir /run) for saving: Permission denied
redis_1           | 1:M 01 Mar 18:45:14.199 # Background saving error

The strange part is that it tries to save in /run.
There is no configuration provided to save in this folder. Is this a redis default setting?

@ruby232
Copy link

ruby232 commented Mar 1, 2018

Similar dump.rdb getting set to read-only

@bitkill
Copy link
Author

bitkill commented Mar 2, 2018

Yes. similar but weirder.

root@a3f138a722ef:/data# redis-cli config get dir
1) "dir"
2) "/run"
root@a3f138a722ef:/data# redis-cli config get dbfilename
1) "dbfilename"
2) "backup.db"

shouldn't this be set to /data?

Anyway, after removing and creating a new container, it appears to be solved. At least for now.

root@ac78f7b794a8:/data# redis-cli config get dir
1) "dir"
2) "/data"
root@ac78f7b794a8:/data# redis-cli config get dbfilename
1) "dbfilename"
2) "dump.rdb"

I had a port open for redis. Is there any way to set dir and filename via redis connection?

@wglambert wglambert added the question Usability question, not directly related to an error with the image label Apr 25, 2018
@wglambert
Copy link

I don't see anything in the Dockerfile that would change the directory from the created /data

redis:6379> config get dir
1) "dir"
2) "/data"

Since it doesn't seem to be an image issue I'm going to close
If you believe this to be in error then let me know and I'll re-open it

@yosifkit
Copy link
Contributor

Just a quick note that I highly doubt your redis instance just happened to change its own config dir to /run. Redis by default just uses the current working directory, which is why it starts in /data.

Most likely this was the work of a nefarious party seeing if they could exploit your system. Possibly similar to #44 (comment).

@aibeb
Copy link

aibeb commented Sep 15, 2018

The same problem!!

I think the official Redis image is an unqualified image.

@itamarhaber
Copy link
Member

@eqfox please see @yosifkit's comment - most likely your Dockerized Redis has been breached by some botnet.

@iackov
Copy link

iackov commented Jan 8, 2019

YEP! TRUE!
SAME PROBLEM WHEN CONFIGURATE SYSTEM!
NEVER OPEN ANY SERVER'S PORTS OUTSIDE TO OPEN WEB, EATHER WHEN YOU JUST CONFIGURATE YOUR SYSTEM!

@blind3dd

This comment has been minimized.

@b12f

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

9 participants