Gitlab CE to 13.9.2 | profiles/active_sessions shows Error 500

Hi folks

I’ve recently updated a gitlab instance to version 13.9.2 and one user now gets an error 500 when he tries to open $url/-/profile/active_sessions however i tested it with two users and do not get that error.

The Log file at /var/log/gitlab/gitlab-rails/production.log says:

Completed 500 Internal Server Error in 77ms (ActiveRecord: 2.3ms | Elasticsearch: 0.0ms | Allocations: 26544)
  
ActionView::Template::Error (No route matches {:action=>"destroy", :controller=>"profiles/active_sessions", :id=>nil}, possible unmatched constraints: [:id]):
    27: 
    28:   - unless is_current_session
    29:     .float-right
    30:       = link_to(revoke_session_path(active_session),
    31:                 { data: { confirm: _('Are you sure? The device will be signed out of GitLab and all remember me tokens revoked.') },
    32:                   method: :delete,
    33:                   class: "gl-button btn btn-danger gl-ml-3" }) do

Does anyone know how to fix it or what is causing this?

Hi,

We’re experimenting the same issue after upgrading Gitlab from 12.3.5 to 13.10.3.
This seems to happen only for existing account. New accounts can access without error to the page.

I think clearing the sessions for all the users could save the problem, but I didn’t figure out yet how to do this. Someone has an idea ?

I resoved this by removing the redis dump.rdb file, and then restart redis.r

1 Like

Hi,
I had the same issue, I tried to delete dump.rdb according to the method of @xworks , but the issue is not solved, Is there any other way to solve this issue?

i am experimenting the same issue after upgrading Gitlab from 12.10.10 to 15.4.2. There’s my solution:

In 15.4.2, anything else is work except active_sessions,I create a gitlab backup and backup those config files in /etc/gitlab/, then remove gitlab-ce, then install gitlab-ce 15.4.2, then restore the backup, by this way the redis has been clean up. then it works

# The command is not necessarily accurate, but only represents the process and ideas

sudo gitlab-backup create
mv /var/opt/gitlab/backups/your-backup.tar /home/backup/
yum remove gitlab-ce
rm -rf /var/opt/gitlab
rm -rf /var/log/gitlab
rm -rf /opt/gitlab

mv /etc/gitlab /home/backup/

yum install gitlab-15.4.2
sudo gitlab-ctl reconfigure
sudo gitlab-backup restore BACKUP=your-backup-url

我也遇到了同样的问题,删除了dump.rdb文件,重启redis服务无效,我全量备份了gitlab的应用数据和配置文件,唯独没有备份redis数据。
然后卸载重装该版本的gitlab,恢复配置文件,恢复数据,启动服务,目前一切正常没有报错,active_sessions里的数据也是新生成的
@lyuluke @linkt-alexandre

gitlab-ctl stop redis
rm -f /var/opt/gitlab/redis/dump.rdb
gitlab-ctl start redis