Crash after server power lost

Good afternoon everyone.
Our team uses the gitlab community edition on own server.
Recently it happened unexpectedly, the power supply was lost and the server just turned off.
After the start, the gitlab no longer works, issuing a 500 error.
Help please resolve the situation.
In fact, I tried to start the reconfiguration of the gitlab, but it did not properly terminate as redis server could not work out correctly.
If you need to provide some data, I’m ready to do it. It is also possible to have some option to keep the existing users’ repositories, and to transfer them with the standard ones?
At the moment, the procedure for creating a backup using the instructions does not work, you just have to look at the non-working redis server.
Thank you in advance for those who respond to my request for help

First of all, you’re suppose to create a backup before somethings happens so you’ll be able to recover. Since you didn’t take any backup, it’ll be difficult to recover as you’ve already found.

Before doing anything, backup the database and the git repository directory.
Next, what is the exact error message in the gitlab log file?

Did you do a gitlab-rake commands to check if all configurations are OK?
https://docs.gitlab.com/ce/administration/raketasks/maintenance.html

Did you try clearing your redis cache?
sudo gitlab-rake cache:clear

Thanks for your reply. Here is some information:
sudo gitlab-ctl tail says ---->

Summary

2017-10-11_06:41:44.85372 .-__ ''-._ 2017-10-11_06:41:44.85372 _.- . . ‘’-._ Redis 3.2.5 (00000000/0) 64 bit
2017-10-11_06:41:44.85372 .- .-```. ```\/ _.,_ ''-._ 2017-10-11_06:41:44.85372 ( ' , .-` | `, ) Running in standalone mode 2017-10-11_06:41:44.85373 |`-._`-...-` __...-.-.|’_.-'| Port: 0 2017-10-11_06:41:44.85373 | -. ._ / _.-' | PID: 30656 2017-10-11_06:41:44.85373 -._ -._ -./ .-’ .-’
2017-10-11_06:41:44.85373 |-._-.
-.__.-' _.-'_.-'| 2017-10-11_06:41:44.85373 | -.
-._ _.-'_.-' | http://redis.io 2017-10-11_06:41:44.85373 -._ -._-..-’.-’ .-’
2017-10-11_06:41:44.85374 |-._-.
-.__.-' _.-'_.-'| 2017-10-11_06:41:44.85374 | -.
-._ _.-'_.-' | 2017-10-11_06:41:44.85374 -._ -._-.
.-’_.-’ _.-’
2017-10-11_06:41:44.85375 -._ -..-’ _.-’
2017-10-11_06:41:44.85375 -._ _.-' 2017-10-11_06:41:44.85376 -.
.-’
2017-10-11_06:41:44.85376
2017-10-11_06:41:44.85376 30656:M 11 Oct 09:41:44.849 # Server started, Redis version 3.2.5
2017-10-11_06:41:44.85376 30656:M 11 Oct 09:41:44.849 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
2017-10-11_06:41:44.85376 30656:M 11 Oct 09:41:44.849 # 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.
2017-10-11_06:41:44.85377 30656:M 11 Oct 09:41:44.851 # Wrong RDB checksum. Aborting now.
2017-10-11_06:41:44.85377 30656:M 11 Oct 09:41:44.851 # Internal error in RDB reading function at rdb.c:1418 -> RDB CRC error
2017-10-11_06:41:44.85377 [offset 0] Checking RDB file dump.rdb
2017-10-11_06:41:44.85378 [offset 26] AUX FIELD redis-ver = ‘3.2.5’
2017-10-11_06:41:44.85378 [offset 40] AUX FIELD redis-bits = ‘64’
2017-10-11_06:41:44.85378 [offset 52] AUX FIELD ctime = ‘1507204247’
2017-10-11_06:41:44.85378 [offset 67] AUX FIELD used-mem = ‘2174512’
2017-10-11_06:41:44.85378 [offset 69] Selecting DB ID 0
2017-10-11_06:41:44.85378 — RDB ERROR DETECTED —
2017-10-11_06:41:44.85379 [offset 173158] RDB CRC error
2017-10-11_06:41:44.85379 [additional info] While doing: check-sum
2017-10-11_06:41:44.85379 [info] 607 keys read
2017-10-11_06:41:44.85379 [info] 329 expires
2017-10-11_06:41:44.85379 [info] 147 already expired
2017-10-11_06:41:44.85379 [offset 173158] \o/ RDB looks OK! \o/
2017-10-11_06:41:44.85380 [info] 607 keys read
2017-10-11_06:41:44.85380 [info] 329 expires
2017-10-11_06:41:44.85380 [info] 147 already expired
^C/opt/gitlab/embedded/bin/omnibus-ctl: Interrupt

Did you do a gitlab-rake commands to check if all configurations are OK?

sudo gitlab-rake gitlab:check says–>>

Summary

Checking GitLab Shell …

GitLab Shell version >= 5.9.0 ? … OK (5.9.0)
Repo base directory exists?
default… yes
Repo storage directories are symlinks?
default… no
Repo paths owned by git:root, or git:git?
default… yes
Repo paths access is drwxrws—?
default… yes
hooks directories in repos are links: … can’t check, you have no projects
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Redis available via internal API: FAILED
gitlab-shell self-check failed
Try fixing it:
Make sure GitLab is running;
Check the gitlab-shell configuration file:
sudo -u git -H editor /opt/gitlab/embedded/service/gitlab-shell/config.yml
Please fix the error above and rerun the checks.

Checking GitLab Shell … Finished

Checking Sidekiq …

Running? … no
Try fixing it:
sudo -u git -H RAILS_ENV=production bin/background_jobs start
For more information see:
doc/install/installation.md in section “Install Init Script”
see log/sidekiq.log for possible errors
Please fix the error above and rerun the checks.

Checking Sidekiq … Finished

Reply by email is disabled in config/gitlab.yml
Checking LDAP …

LDAP is disabled in config/gitlab.yml

Checking LDAP … Finished

Checking GitLab …

Git configured correctly? … yes
Database config exists? … yes
All migrations up? … yes
Database contains orphaned GroupMembers? … no
GitLab config exists? … yes
GitLab config up to date? … yes
Log directory writable? … yes
Tmp directory writable? … yes
Uploads directory exists? … yes
Uploads directory has correct permissions? … yes
Uploads directory tmp has correct permissions? … yes
Init script exists? … skipped (omnibus-gitlab has no init script)
Init script up-to-date? … skipped (omnibus-gitlab has no init script)
Projects have namespace: … can’t check, you have no projects
Redis version >= 2.8.0? … yes
Ruby version >= 2.3.3 ? … yes (2.3.5)
Git version >= 2.7.3 ? … yes (2.13.5)
Git user has default SSH configuration? … yes
Active users: … 1

Checking GitLab … Finished

sudo gitlab-rake cache:clear says —>>>

Summary

rake aborted!
Redis::CannotConnectError: Error connecting to Redis on /var/opt/gitlab/redis/redis.socket (Errno::ECONNREFUSED)
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/cache.rake:11:in block (5 levels) in <top (required)>' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/cache.rake:10:in loop’
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/cache.rake:10:in block (4 levels) in <top (required)>' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/redis/wrapper.rb:17:in block in with’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/redis/wrapper.rb:17:in with' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/cache.rake:8:in block (3 levels) in <top (required)>’
/opt/gitlab/embedded/bin/bundle:23:in load' /opt/gitlab/embedded/bin/bundle:23:in
Errno::ECONNREFUSED: Connection refused - connect(2) for /var/opt/gitlab/redis/redis.socket
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/cache.rake:11:in block (5 levels) in <top (required)>' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/cache.rake:10:in loop’
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/cache.rake:10:in block (4 levels) in <top (required)>' /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/redis/wrapper.rb:17:in block in with’
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/redis/wrapper.rb:17:in with' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/cache.rake:8:in block (3 levels) in <top (required)>’
/opt/gitlab/embedded/bin/bundle:23:in load' /opt/gitlab/embedded/bin/bundle:23:in
Tasks: TOP => cache:clear => cache:clear:redis
(See full trace by running task with --trace)

It seems like you’re having connecting to redis. Can you check if redis is up and running.