FS#44067 - [redis] Failed at step RUNTIME_DIRECTORY...

Attached to Project: Community Packages
Opened by Oleg Nagornij (corner) - Friday, 06 March 2015, 10:22 GMT
Last edited by Sergej Pupykin (sergej) - Thursday, 30 April 2015, 13:51 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture x86_64
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description:
redis.service failed


Additional info:
* package version(s)
* config and/or log files etc.
community/redis 2.8.19-2
UNIT LOAD ACTIVE SUB DESCRIPTION
● redis.service loaded failed failed Advanced key-value store

Steps to reproduce:

Mar 06 12:01:58 lenovobook systemd[1]: redis.service: main process exited, code=exited, status=233/RUNTIME_DIRECTORY
Mar 06 12:01:58 lenovobook systemd[487]: Failed at step RUNTIME_DIRECTORY spawning /usr/bin/redis-cli: File exists
Mar 06 12:01:58 lenovobook systemd[1]: redis.service: control process exited, code=exited status=233
Mar 06 12:01:58 lenovobook systemd[1]: Unit redis.service entered failed state.
Mar 06 12:01:58 lenovobook systemd[1]: redis.service failed.


Manually started well

Mar 06 12:06:10 lenovobook redis-server[1194]: [1194] 06 Mar 12:06:10.074 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
Mar 06 12:06:10 lenovobook redis-server[1194]: [1194] 06 Mar 12:06:10.074 # Redis can't set maximum open files to 10032 because of OS error: Operation not perm
Mar 06 12:06:10 lenovobook redis-server[1194]: [1194] 06 Mar 12:06:10.074 # Current maximum open files is 1024. maxclients has been reduced to 4064 to compensa
Mar 06 12:06:10 lenovobook redis-server[1194]: _._
Mar 06 12:06:10 lenovobook redis-server[1194]: _.-``__ ''-._
Mar 06 12:06:10 lenovobook redis-server[1194]: _.-`` `. `_. ''-._ Redis 2.8.19 (00000000/0) 64 bit
Mar 06 12:06:10 lenovobook redis-server[1194]: .-`` .-```. ```\/ _.,_ ''-._
Mar 06 12:06:10 lenovobook redis-server[1194]: ( ' , .-` | `, ) Running in stand alone mode
Mar 06 12:06:10 lenovobook redis-server[1194]: |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
Mar 06 12:06:10 lenovobook redis-server[1194]: | `-._ `._ / _.-' | PID: 1194
Mar 06 12:06:10 lenovobook redis-server[1194]: `-._ `-._ `-./ _.-' _.-'
Mar 06 12:06:10 lenovobook redis-server[1194]: |`-._`-._ `-.__.-' _.-'_.-'|
Mar 06 12:06:10 lenovobook redis-server[1194]: | `-._`-._ _.-'_.-' | http://redis.io
Mar 06 12:06:10 lenovobook redis-server[1194]: `-._ `-._`-.__.-'_.-' _.-'
Mar 06 12:06:10 lenovobook redis-server[1194]: |`-._`-._ `-.__.-' _.-'_.-'|
Mar 06 12:06:10 lenovobook redis-server[1194]: | `-._`-._ _.-'_.-' |
Mar 06 12:06:10 lenovobook redis-server[1194]: `-._ `-._`-.__.-'_.-' _.-'
Mar 06 12:06:10 lenovobook redis-server[1194]: `-._ `-.__.-' _.-'
Mar 06 12:06:10 lenovobook redis-server[1194]: `-._ _.-'
Mar 06 12:06:10 lenovobook redis-server[1194]: `-.__.-'
Mar 06 12:06:10 lenovobook redis-server[1194]: [1194] 06 Mar 12:06:10.075 # Server started, Redis version 2.8.19
Mar 06 12:06:10 lenovobook redis-server[1194]: [1194] 06 Mar 12:06:10.075 # WARNING overcommit_memory is set to 0! Background save may fail under low memory co
Mar 06 12:06:10 lenovobook redis-server[1194]: [1194] 06 Mar 12:06:10.075 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This
Mar 06 12:06:10 lenovobook redis-server[1194]: [1194] 06 Mar 12:06:10.075 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/co
Mar 06 12:06:10 lenovobook redis-server[1194]: [1194] 06 Mar 12:06:10.135 * DB loaded from disk: 0.060 seconds
Mar 06 12:06:10 lenovobook redis-server[1194]: [1194] 06 Mar 12:06:10.135 * The server is now ready to accept connections on port 6379
This task depends upon

Closed by  Sergej Pupykin (sergej)
Thursday, 30 April 2015, 13:51 GMT
Reason for closing:  Fixed
Comment by Sergej Pupykin (sergej) - Friday, 06 March 2015, 12:49 GMT
You should execute
systemd-tmpfiles --create redis.conf
I think.

I've added it into post_install hook.
Comment by Oleg Nagornij (corner) - Friday, 06 March 2015, 14:46 GMT
This action doesn't solve a problem
Comment by Sergej Pupykin (sergej) - Friday, 06 March 2015, 20:50 GMT
Yes, some strange problem exists, may be some file is missing or permissions are incorrect. I was able to start it with systemctl after I run it manually as root user.
Comment by Oleg Nagornij (corner) - Friday, 06 March 2015, 21:26 GMT
It started well manually, but not in unit...
With redis 2.8.19-3 same trouble.
Comment by Gleb Tv (glebtv) - Saturday, 07 March 2015, 11:13 GMT Comment by Oleg Nagornij (corner) - Saturday, 07 March 2015, 12:39 GMT
I has this unit in 2.8.19-3 version.
Didn't help.
Service started manually only.
Comment by Dan (dsemi) - Sunday, 08 March 2015, 15:16 GMT
Version 2.8.19-3, same issue. It looks like the service only runs on the second try, the first gives this error. After uninstalling and reinstalling, it took 2 systemctl start calls to get it running.
Comment by Oleg Nagornij (corner) - Sunday, 08 March 2015, 15:20 GMT
Confirm.
Witout auto start redis.service started after second service call.
Comment by beta990 (beta990) - Sunday, 08 March 2015, 21:09 GMT
Confirm: redis 2.8.19-3

Downgrading to 2.18.19-1 fixes the problem.
Comment by Nico Schottelius (telmich) - Wednesday, 11 March 2015, 19:24 GMT
Is there any progress on this issue? All new arch linux installations we setup are failing now due to this bug (we are running a dynamic cluster of Arch Linux Systems)
Comment by Dan (dsemi) - Wednesday, 11 March 2015, 19:25 GMT
The problem seems to be that /run/redis is created on install, and systemd complains that the folder already exists when the service is started (RuntimeDirectory in /usr/lib/systemd/system/redis.service). After that first service run, the /run/redis folder is removed so subsequent runs work fine. For some reason it seems to be recreating on boot as well.
Comment by Dan (dsemi) - Wednesday, 11 March 2015, 19:35 GMT
Something to do with this (in PKGBUILD)
install -Dm644 ../redis.tmpfiles.d "$pkgdir"/usr/lib/tmpfiles.d/redis.conf
and redis.tmpfiles.d contains
d /run/redis 0755 redis redis -

Seems to be a systemd thing for creating temporary resources. Except when the service starts it tries to create the resource /run/redis that already exists.
Comment by Dan (dsemi) - Wednesday, 11 March 2015, 20:13 GMT
Adding this patch works for me.
EDIT: second one.
Comment by Nico Schottelius (telmich) - Thursday, 12 March 2015, 10:40 GMT
Second patch looks good to me
Comment by Sergej Pupykin (sergej) - Thursday, 12 March 2015, 11:16 GMT
I've removed tmpfiles from redis-2.8.19-4. But it was added after this bug created.
Comment by Nico Schottelius (telmich) - Thursday, 12 March 2015, 12:22 GMT
Upgrading to 2.8.19-4 works for me
Comment by Oleg Nagornij (corner) - Thursday, 12 March 2015, 20:53 GMT
2.8.19-4 works
Comment by Oleg Nagornij (corner) - Friday, 13 March 2015, 09:35 GMT
I think the problem is solved. All works in last update.
Many thanks for all
Comment by beta990 (beta990) - Tuesday, 17 March 2015, 05:06 GMT
  • Field changed: Percent Complete (100% → 0%)
Hi Sergej,

Unfortunately it isn't fixed 100%.
When using PHPredis to connect as socket, it crashes with a 'Connection Closed' error.

When downgrading to redis 2.8.19-1 all the problems are gone.

Hope you can take another look. :)

Thanks!
Comment by Thomas Dy (stoichyu) - Friday, 20 March 2015, 07:46 GMT
For us, changing RuntimeDirectoryMode to 755 fixed it. The socket itself has it's own permissions so we might as well make the dir permissive.
Comment by beta990 (beta990) - Friday, 20 March 2015, 15:56 GMT
Thanks Thomas,

Will take a look. :)

---

Edit: in case anyone else still has issues with phpredis and listen on socket;

$ cat /etc/redis.conf
..
port 0
..
unixsocket /var/run/redis/redis.sock
unixsocketperm 770

# chown redis:redis /var/run/redis

This should solved the issues. For some reason it doesn't load correctly when using the /tmp directory, using /var/run/redis as directory fixes this issue.
Tested with the latest redis + phpredis-git.

Loading...