Skip to content

User admin returns http 500 for instance level SCIM created users on Identities tab

Summary

In the Admin Panel, when Navigating to a user that was created via SCIM, the Identities tab shows a 500 error. This is happening on a self-hosted instance. This works for users not created via SCIM.

Steps to reproduce

  1. Enable instance level SCIM as described in docs
  2. Create a user via the SCIM API (eg like in docs
  3. Navigate to the Admin Panel to the page of the user, and click on the Identities tab
  4. get a 500 error page :(

Example Project

As this is on a self-hosted instance there is sadly no project to link.

What is the current bug behavior?

A http 500 error is shown

What is the expected correct behavior?

No error is shown, the usual identities list is shown.

Relevant logs and/or screenshots


  "method": "GET",
  "path": "/admin/users/andreas.sieferlinger/identities",
  "format": "html",
  "controller": "Admin::IdentitiesController",
  "action": "index",
  "status": 500,
  "time": "2023-02-13T15:26:22.161Z",
  "params": [
    {
      "key": "user_id",
      "value": "andreas.sieferlinger"
    }
  ],
  "correlation_id": "01GS5P4PBBP0VJ4NG746DAZ6YJ",
  "meta.caller_id": "Admin::IdentitiesController#index",
  "meta.remote_ip": "REDACTED",
  "meta.feature_category": "authentication_and_authorization",
  "meta.user": "root",
  "meta.user_id": 1,
  "meta.client_id": "user/1",
  "remote_ip": "REDACTED",
  "user_id": 1,
  "username": "root",
  "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
  "queue_duration_s": 0.006886,
  "request_urgency": "default",
  "target_duration_s": 1,
  "redis_calls": 5,
  "redis_allowed_cross_slot_calls": 1,
  "redis_duration_s": 0.0037930000000000004,
  "redis_read_bytes": 255,
  "redis_write_bytes": 1197,
  "redis_sessions_calls": 4,
  "redis_sessions_allowed_cross_slot_calls": 1,
  "redis_sessions_duration_s": 0.003164,
  "redis_sessions_read_bytes": 255,
  "redis_sessions_write_bytes": 1144,
  "redis_shared_state_calls": 1,
  "redis_shared_state_duration_s": 0.000629,
  "redis_shared_state_write_bytes": 53,
  "db_count": 11,
  "db_write_count": 0,
  "db_cached_count": 0,
  "db_replica_count": 0,
  "db_primary_count": 11,
  "db_main_count": 11,
  "db_main_replica_count": 0,
  "db_replica_cached_count": 0,
  "db_primary_cached_count": 0,
  "db_main_cached_count": 0,
  "db_main_replica_cached_count": 0,
  "db_replica_wal_count": 0,
  "db_primary_wal_count": 0,
  "db_main_wal_count": 0,
  "db_main_replica_wal_count": 0,
  "db_replica_wal_cached_count": 0,
  "db_primary_wal_cached_count": 0,
  "db_main_wal_cached_count": 0,
  "db_main_replica_wal_cached_count": 0,
  "db_replica_duration_s": 0,
  "db_primary_duration_s": 0.014,
  "db_main_duration_s": 0.014,
  "db_main_replica_duration_s": 0,
  "cpu_s": 0.08247,
  "mem_objects": 38963,
  "mem_bytes": 3164960,
  "mem_mallocs": 10477,
  "mem_total_bytes": 4723480,
  "pid": 3908,
  "worker_id": "puma_0",
  "rate_limiting_gates": [],
  "exception.class": "ActionView::Template::Error",
  "exception.message": "undefined method `path' for nil:NilClass",
  "exception.backtrace": [
    "ee/app/views/admin/identities/_scim_identity.html.haml:7",
    "app/helpers/application_helper.rb:14:in `render_if_exists'",
    "app/views/admin/identities/index.html.haml:15",
    "app/controllers/application_controller.rb:143:in `render'",
    "ee/lib/gitlab/ip_address_state.rb:10:in `with'",
    "ee/app/controllers/ee/application_controller.rb:46:in `set_current_ip_address'",
    "app/controllers/application_controller.rb:534:in `set_current_admin'",
    "lib/gitlab/session.rb:11:in `with_session'",
    "app/controllers/application_controller.rb:525:in `set_session_storage'",
    "lib/gitlab/i18n.rb:107:in `with_locale'",
    "lib/gitlab/i18n.rb:113:in `with_user_locale'",
    "app/controllers/application_controller.rb:513:in `set_locale'",
    "app/controllers/application_controller.rb:507:in `set_current_context'",
    "lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call'",
    "lib/gitlab/middleware/memory_report.rb:13:in `call'",
    "lib/gitlab/middleware/speedscope.rb:13:in `call'",
    "lib/gitlab/database/load_balancing/rack_middleware.rb:23:in `call'",
    "lib/gitlab/middleware/rails_queue_duration.rb:33:in `call'",
    "lib/gitlab/metrics/rack_middleware.rb:16:in `block in call'",
    "lib/gitlab/metrics/web_transaction.rb:46:in `run'",
    "lib/gitlab/metrics/rack_middleware.rb:16:in `call'",
    "lib/gitlab/jira/middleware.rb:19:in `call'",
    "lib/gitlab/middleware/go.rb:20:in `call'",
    "lib/gitlab/etag_caching/middleware.rb:21:in `call'",
    "lib/gitlab/middleware/query_analyzer.rb:11:in `block in call'",
    "lib/gitlab/database/query_analyzer.rb:37:in `within'",
    "lib/gitlab/middleware/query_analyzer.rb:11:in `call'",
    "lib/gitlab/middleware/multipart.rb:173:in `call'",
    "lib/gitlab/middleware/read_only/controller.rb:50:in `call'",
    "lib/gitlab/middleware/read_only.rb:18:in `call'",
    "lib/gitlab/middleware/same_site_cookies.rb:27:in `call'",
    "lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'",
    "lib/gitlab/middleware/basic_health_check.rb:25:in `call'",
    "lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'",
    "lib/gitlab/middleware/request_context.rb:21:in `call'",
    "lib/gitlab/middleware/webhook_recursion_detection.rb:15:in `call'",
    "config/initializers/fix_local_cache_middleware.rb:11:in `call'",
    "lib/gitlab/middleware/compressed_json.rb:37:in `call'",
    "lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:19:in `call'",
    "lib/gitlab/middleware/sidekiq_web_static.rb:20:in `call'",
    "lib/gitlab/metrics/requests_rack_middleware.rb:77:in `call'",
    "lib/gitlab/middleware/release_env.rb:13:in `call'"
  ],
  "db_duration_s": 0.01211,
  "view_duration_s": 0,
  "duration_s": 0.07776
}

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info
System information
System:         Ubuntu 20.04
Proxy:          no
Current User:   git
Using RVM:      no
Ruby Version:   2.7.7p221
Gem Version:    3.1.6
Bundler Version:2.3.15
Rake Version:   13.0.6
Redis Version:  6.2.8
Sidekiq Version:6.5.7
Go Version:     unknown

GitLab information
Version:        15.8.1-ee
Revision:       c49deff6e37
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     PostgreSQL
DB Version:     12.11
URL:            https://gitlab-dev.REDACTED.com
HTTP Clone URL: https://gitlab-dev.REDACTED.com/some-group/some-project.git
SSH Clone URL:  git@gitlab-dev.REDACTED.com:some-group/some-project.git
Elasticsearch:  yes
Geo:            no
Using LDAP:     no
Using Omniauth: yes
Omniauth Providers: google_oauth2, saml

GitLab Shell
Version:        14.15.0
Repository storages:
- default:      tcp://10.120.151.28:8075
- storage1:     tcp://10.120.151.28:8075
GitLab Shell path:              /opt/gitlab/embedded/service/gitlab-shell

Results of GitLab application Check

Expand for output related to the GitLab application check Please note that the sidekiq issue is expected as its running on a separate host.

checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 14.15.0 ? ... OK (14.15.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK storage1 ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

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

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Cable config exists? ... yes Resque config exists? ... 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? ... skipped (no tmp uploads folder yet) Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units) Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has neither init script nor systemd units) Projects have namespace: ... 1/24 ... yes 1/31 ... yes 2/46 ... yes 1/66 ... yes 1/95 ... yes 6/109 ... yes 1/178 ... yes 1/190 ... yes 1/193 ... yes 1/197 ... yes 2/199 ... yes 8/229 ... yes 1/243 ... yes 1/256 ... yes 2/261 ... yes 2/262 ... yes 2/263 ... yes 2/264 ... yes 2/265 ... yes 2/266 ... yes 2/267 ... yes 2/268 ... yes 2/269 ... yes 2/270 ... yes 2/278 ... yes 2/307 ... yes 2/327 ... yes 2/328 ... yes 2/339 ... yes 2/340 ... yes 2/341 ... yes 2/342 ... yes 2/343 ... yes 2/344 ... yes 2/345 ... yes 2/346 ... yes 2/347 ... yes 2/348 ... yes 2/349 ... yes 2/350 ... yes 2/351 ... yes 2/352 ... yes 2/353 ... yes 2/354 ... yes 2/355 ... yes 2/356 ... yes 1/364 ... yes 2/414 ... yes 1/443 ... yes 2/480 ... yes 2/502 ... yes 2/507 ... yes 2/508 ... yes 2/513 ... yes 2/517 ... yes 2/519 ... yes 23/537 ... yes 1/560 ... yes 2/593 ... yes 2/667 ... yes 8/698 ... yes 2/718 ... yes 5/728 ... yes 167/729 ... yes 179/734 ... yes 186/735 ... yes 5/741 ... yes 5/783 ... yes 242/788 ... yes 2/789 ... yes 2/790 ... yes 2/791 ... yes 2/792 ... yes 2/793 ... yes 2/794 ... yes 2/795 ... yes 2/796 ... yes 2/797 ... yes 2/798 ... yes 2/799 ... yes 2/800 ... yes 2/801 ... yes 2/802 ... yes 2/803 ... yes 2/814 ... yes 2/815 ... yes 2/816 ... yes 2/818 ... yes 2/819 ... yes 2/827 ... yes 2/829 ... yes 5/864 ... yes Redis version >= 6.0.0? ... yes Ruby version >= 2.7.2 ? ... yes (2.7.7) Git user has default SSH configuration? ... yes Active users: ... 9 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes Elasticsearch version 7.x-8.x or OpenSearch version 1.x ... yes (elasticsearch 7.10.2) All migrations must be finished before doing a major upgrade ... yes Checking GitLab App ... Finished Checking GitLab subtasks ... Finished

Possible fixes