Redis database corruption

I think I have figured out the problem that I had posted previously in this thread

After looking at a number of logs, it seems the internal server error is caused by redis not reading the DB file. I ran:

redis-check-dump dump.rdb and I get a “wrong signature in header”.

When I do a hexdump of the dump.rdb file, it gives me a bunch of zeros. I would say that the dump.rdb file has somehow been corrupted. I have traced the log where you can see something corrupts it.

Any ideas on what I can do to recover the dump.rdb file? Anyway to fix the header information? What would have caused this?

Any help would be greatly appreciated since I have a number of users (family mostly) who may have lost their synced photos.

Redis log below where you can see the fatal error trying to read the DB file after it had unsuccessfully tried to save it:

    DB saved on disk
31978:C 15 Jun 14:34:28.095 * RDB: 0 MB of memory used by copy-on-write
1157:M 15 Jun 14:34:28.187 * Background saving terminated with success
1157:M 15 Jun 14:39:29.004 * 10 changes in 300 seconds. Saving...
1157:M 15 Jun 14:39:29.004 * Background saving started by pid 32099
32099:C 15 Jun 14:39:29.016 * DB saved on disk
32099:C 15 Jun 14:39:29.017 * RDB: 0 MB of memory used by copy-on-write
1157:M 15 Jun 14:39:29.113 * Background saving terminated with success
1131:M 15 Jun 16:27:04.635 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
1131:M 15 Jun 16:27:04.735 # Redis can't set maximum open files to 10032 because of OS error: Operation not permitted.
1131:M 15 Jun 16:27:04.735 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
                _._                                                  
           _.-``__ ''-._                                             
      _.-``    `.  `_.  ''-._           Redis 3.0.6 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._                                   
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 0
 |    `-._   `._    /     _.-'    |     PID: 1131
  `-._    `-._  `-./  _.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |           http://redis.io        
  `-._    `-._`-.__.-'_.-'    _.-'                                   
 |`-._`-._    `-.__.-'    _.-'_.-'|                                  
 |    `-._`-._        _.-'_.-'    |                                  
  `-._    `-._`-.__.-'_.-'    _.-'                                   
      `-._    `-.__.-'    _.-'                                       
          `-._        _.-'                                           
              `-.__.-'                                               

1131:M 15 Jun 16:27:04.799 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1131:M 15 Jun 16:27:04.799 # Server started, Redis version 3.0.6
1131:M 15 Jun 16:27:04.799 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
1131:M 15 Jun 16:27:04.872 # Wrong signature trying to load DB from file
1131:M 15 Jun 16:27:04.872 # Fatal error loading the DB: Invalid argument. Exiting.
1459:M 15 Jun 16:27:05.580 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
1459:M 15 Jun 16:27:05.580 # Redis can't set maximum open files to 10032 because of OS error: Operation not permitted.
1459:M 15 Jun 16:27:05.580 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.

I guess Nextcloud works if you “unconfigure” redis? Redis is not mandatory. After running without redis you can take care of the redis db. Maybe just deleting it.

1 Like

Thank you for the help @himbeere.

When I stop the redis server, I still get the same Internal Server Error. In fact, because redis terminates on startup it is never running in the first place.

Are there extra steps I would have to take in order to remove it from the equation? Is it possible or worthwhile to regenerate the dump.rdp file? What functionality would be lost if I don’t use redis?

@himbeere’s suggestion to just delete the redis db worked!

Just had to restart redis and the server was back up. Although somewhat of an obscure issue, it has a fairly simple solution in case anyone else runs into this.

After deleting the dump.rdb file, nothing seems to be lost (so far).

Thank you for the help!