rake aborted task: Deleting old backups

Summary

rake aborted task: Deleting old backups

Steps to reproduce

  1. uncomment gitlab_rails['backup_keep_time'] = 604800 in /etc/gitlab/gitlab.rb
  2. run gitlab-rake gitlab:backup:create

Expected behavior

remove old backups

Actual behavior

rake aborted the deleting old backups task

Relevant logs and/or screenshots

Deleting old backups ... rake aborted!
ArgumentError: comparison of NilClass with 1462334470 failed
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:87:in `sort'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:87:in `block in remove_old'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:84:in `chdir'
/opt/gitlab/embedded/service/gitlab-rails/lib/backup/manager.rb:84:in `remove_old'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:22:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:22:in `load'
/opt/gitlab/embedded/bin/bundle:22:in `<main>'
Tasks: TOP => gitlab:backup:create
(See full trace by running task with --trace)

Output of checks

Results of GitLab application Check

(For installations with omnibus-gitlab package run and paste the output of:

Checking GitLab Shell ...

GitLab Shell version >= 3.6.6 ? ... OK (3.6.6)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ... 
3/1 ... ok
3/4 ... ok
3/6 ... ok
3/7 ... ok
3/8 ... ok
3/9 ... ok
3/10 ... ok
3/13 ... ok
3/14 ... repository is empty
3/15 ... ok
3/17 ... ok
3/19 ... ok
2/20 ... ok
2/21 ... ok
3/22 ... ok
3/23 ... ok
3/25 ... ok
2/26 ... ok
3/27 ... ok
3/28 ... ok
2/29 ... ok
2/30 ... ok
2/31 ... ok
2/32 ... repository is empty
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Reply by email ...

Reply by email is disabled in config/gitlab.yml

Checking Reply by email ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... 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: ... 
3/1 ... yes
3/4 ... yes
3/6 ... yes
3/7 ... yes
3/8 ... yes
3/9 ... yes
3/10 ... yes
3/13 ... yes
3/14 ... yes
3/15 ... yes
3/17 ... yes
3/19 ... yes
2/20 ... yes
2/21 ... yes
3/22 ... yes
3/23 ... yes
3/25 ... yes
2/26 ... yes
3/27 ... yes
3/28 ... yes
2/29 ... yes
2/30 ... yes
2/31 ... yes
2/32 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.1)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.7.4)
Active users: 5

Checking GitLab ... Finished

Results of GitLab environment info

System information
System:		Debian 7.11
Current User:	git
Using RVM:	no
Ruby Version:	2.3.1p112
Gem Version:	2.6.6
Bundler Version:1.13.6
Rake Version:	10.5.0
Sidekiq Version:4.2.1

GitLab information
Version:	8.13.5
Revision:	09cedb5
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	postgresql
URL:		https://mygitlab.example.com
HTTP Clone URL:	https://mygitlab.example.com/some-group/some-project.git
SSH Clone URL:	git@mygitlab.example.com:some-group/some-project.git
Using LDAP:	no
Using Omniauth:	no

GitLab Shell
Version:	3.6.6
Repository storage paths:
- default: 	/home/git/repositories
Hooks:		/opt/gitlab/embedded/service/gitlab-shell/hooks/
Git:		/opt/gitlab/embedded/bin/git

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)