Failed opening .rdb for saving: Permission denied

2,450 views
Skip to first unread message

David Montgomery

unread,
Jun 25, 2015, 4:42:37 AM6/25/15
to redi...@googlegroups.com
Hi,

Why?  Why cant rdb save?  My /dir/redis dir is owned by root and has rwx permissions.  Redis is run as root.

Thanks


[12482] 25 Jun 08:34:52.820 # SYNC failed. BGSAVE child returned an error
[12482] 25 Jun 08:34:53.807 * Slave asks for synchronization
[12482] 25 Jun 08:34:53.807 * Full resync requested by slave.
[12482] 25 Jun 08:34:53.808 * Starting BGSAVE for SYNC
[12482] 25 Jun 08:34:53.815 * Background saving started by pid 14438
[14438] 25 Jun 08:34:53.816 # Failed opening .rdb for saving: Permission denied
[12482] 25 Jun 08:34:53.823 # Background saving error
[12482] 25 Jun 08:34:53.823 # Connection with slave 10.33.159.141:6379 lost.
[12482] 25 Jun 08:34:53.824 # SYNC failed. BGSAVE child returned an error
[12482] 25 Jun 08:34:54.809 * Slave asks for synchronization
[12482] 25 Jun 08:34:54.810 * Full resync requested by slave.
[12482] 25 Jun 08:34:54.810 * Starting BGSAVE for SYNC
[12482] 25 Jun 08:34:54.817 * Background saving started by pid 14439
[14439] 25 Jun 08:34:54.818 # Failed opening .rdb for saving: Permission denied
[12482] 25 Jun 08:34:54.825 # Background saving error
[12482] 25 Jun 08:34:54.826 # Connection with slave 10.33.159.xxx:6379 lost.
[12482] 25 Jun 08:34:54.826 # SYNC failed. BGSAVE child returned an error

Jan-Erik Rediger

unread,
Jun 25, 2015, 4:54:47 AM6/25/15
to redi...@googlegroups.com
Under which user does Redis run?
What are the _exact_ permissions for that directory? It might be a good
idea to make the user Redis runs under the owner.
> --
> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
> To post to this group, send email to redi...@googlegroups.com.
> Visit this group at http://groups.google.com/group/redis-db.
> For more options, visit https://groups.google.com/d/optout.

David Montgomery

unread,
Jun 25, 2015, 5:03:18 AM6/25/15
to redi...@googlegroups.com
I tried changing owner to redis in /data/redis to no avail.  Is this a known issue with redis?

Jan-Erik Rediger

unread,
Jun 25, 2015, 5:12:10 AM6/25/15
to redi...@googlegroups.com
It's a known issue if the permissions are incorrect.
Again:
* Is Redis running under the correct user?
* Is it actually using the right config? So is it trying to save to the directory you modified?

Tampa312

unread,
Jun 25, 2015, 6:57:31 AM6/25/15
to redi...@googlegroups.com, jan...@fnordig.de

What do the permissions have to be running as root?

Below is the config

# The filename where to dump the DB
dbfilename dump.rdb

# The working directory.
#
# The DB will be written inside this directory, with the filename specified
# above using the 'dbfilename' configuration directive.
#
# The Append Only File will also be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir /data/redis

CharSyam

unread,
Jun 25, 2015, 7:11:51 AM6/25/15
to redi...@googlegroups.com, jan...@fnordig.de
change directory permission for writing :)

Greg Andrews

unread,
Jun 25, 2015, 11:34:44 AM6/25/15
to redi...@googlegroups.com

David Montgomery:

Redis is run as root.

Have you confirmed this with a ps command?

Is /data/redis on a shared filesystem like NFS or Samba/CIFS?  NFS servers in particular will often behave in confusing ways when an NFS client machine tries to use the root account to write.

  -Greg
Reply all
Reply to author
Forward
0 new messages