Token creation with a dedicated user trows 500

I Just set up the Docker Registery and a user to pull and push images.
Created a dedicated user for this purpose.
The odd thing that happens now is that I’m not able to create tokens with this user. Gitlab gives me a 500 error page.
rails/production log tells me “First argument in form cannot contain nil or be empty”

==> /var/log/gitlab/gitlab-rails/production.log <==
Started POST "/kolla_known_good/docker_registry/-/settings/access_tokens" for 172.27.224.2 at 2020-10-19 19:00:57 +0200
Processing by Projects::Settings::AccessTokensController#create as HTML
  Parameters:
 {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "project_access_token"=>"[FILTERED]",
  "namespace_id"=>"kolla_known_good",
  "project_id"=>"docker_registry"}



Completed 500 Internal Server Error in 132ms (ActiveRecord: 63.3ms | Elasticsearch: 0.0ms | Allocations: 22757)

==> /var/log/gitlab/gitlab-rails/production_json.log <==
{
    "method": "POST",
    "path": "/kolla_known_good/docker_registry/-/settings/access_tokens",
    "format": "html",
    "controller": "Projects::Settings::AccessTokensController",
    "action": "create",
    "status": 500,
    "time": "2020-10-19T17:00:57.865Z",
    "params": [
        {
            "key": "utf8",
            "value": "✓"
        },
        {
            "key": "authenticity_token",
            "value": "[FILTERED]"
        },
        {
            "key": "project_access_token",
            "value": "[FILTERED]"
        },
        {
            "key": "namespace_id",
            "value": "kolla_known_good"
        },
        {
            "key": "project_id",
            "value": "docker_registry"
        }
    ],
    "remote_ip": "172.27.224.2",
    "user_id": 8,
    "username": "kolla_known_good",
    "ua": "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.99 Safari/537.36",
    "correlation_id": "JtZ5QVZM3O6",
    "meta.user": "kolla_known_good",
    "meta.project": "kolla_known_good/docker_registry",
    "meta.root_namespace": "kolla_known_good",
    "meta.caller_id": "Projects::Settings::AccessTokensController#create",
    "redis_calls": 7,
    "redis_duration_s": 0.002268,
    "redis_read_bytes": 1344,
    "redis_write_bytes": 1847,
    "redis_cache_calls": 6,
    "redis_cache_duration_s": 0.001655,
    "redis_cache_read_bytes": 1137,
    "redis_cache_write_bytes": 323,
    "redis_shared_state_calls": 1,
    "redis_shared_state_duration_s": 0.000613,
    "redis_shared_state_read_bytes": 207,
    "redis_shared_state_write_bytes": 1524,
    "cpu_s": 0.1,
    "exception.class": "ActionView::Template::Error",
    "exception.message": "First argument in form cannot contain nil or be empty",
    "exception.backtrace": [
        "app/views/shared/access_tokens/_form.html.haml:9",
        "app/views/projects/settings/access_tokens/index.html.haml:23",
        "app/controllers/application_controller.rb:134:in `render'",
        "app/controllers/projects/settings/access_tokens_controller.rb:24:in `create'",
        "app/controllers/application_controller.rb:491:in `set_current_admin'",
        "lib/gitlab/session.rb:11:in `with_session'",
        "app/controllers/application_controller.rb:482:in `set_session_storage'",
        "lib/gitlab/i18n.rb:73:in `with_locale'",
        "lib/gitlab/i18n.rb:79:in `with_user_locale'",
        "app/controllers/application_controller.rb:476:in `set_locale'",
        "lib/gitlab/error_tracking.rb:52:in `with_context'",
        "app/controllers/application_controller.rb:541:in `sentry_context'",
        "app/controllers/application_controller.rb:469:in `block in set_current_context'",
        "lib/gitlab/application_context.rb:52:in `block in use'",
        "lib/gitlab/application_context.rb:52:in `use'",
        "lib/gitlab/application_context.rb:20:in `with_context'",
        "app/controllers/application_controller.rb:462:in `set_current_context'",
        "lib/gitlab/request_profiler/middleware.rb:17:in `call'",
        "lib/gitlab/jira/middleware.rb:19:in `call'",
        "lib/gitlab/middleware/go.rb:20:in `call'",
        "lib/gitlab/etag_caching/middleware.rb:13:in `call'",
        "lib/gitlab/middleware/multipart.rb:217:in `call'",
        "lib/gitlab/middleware/read_only/controller.rb:51:in `call'",
        "lib/gitlab/middleware/read_only.rb:18:in `call'",
        "lib/gitlab/middleware/same_site_cookies.rb:27: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:23:in `call'",
        "config/initializers/fix_local_cache_middleware.rb:9:in `call'",
        "lib/gitlab/metrics/requests_rack_middleware.rb:60:in `call'",
        "lib/gitlab/middleware/release_env.rb:12:in `call'"
    ],
    "db_duration_s": 0.06329,
    "view_duration_s": 0,
    "duration_s": 0.13188,
    "db_count": 0,
    "db_write_count": 0,
    "db_cached_count": 0
}


==> /var/log/gitlab/gitlab-rails/production.log <==
  
ActionView::Template::Error (First argument in form cannot contain nil or be empty):
     6: %p.profile-settings-content
     7:   = _("Enter the name of your application, and we'll return a unique %{type}.") % { type: type }
     8: 
     9: = form_for token, as: prefix, url: path, method: :post, html: { class: 'js-requires-input' } do |f|
    10: 
    11:   = form_errors(token)
    12: 
  
app/views/shared/access_tokens/_form.html.haml:9
app/views/projects/settings/access_tokens/index.html.haml:23
app/controllers/application_controller.rb:134:in `render'
app/controllers/projects/settings/access_tokens_controller.rb:24:in `create'
app/controllers/application_controller.rb:491:in `set_current_admin'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:482:in `set_session_storage'
lib/gitlab/i18n.rb:73:in `with_locale'
lib/gitlab/i18n.rb:79:in `with_user_locale'
app/controllers/application_controller.rb:476:in `set_locale'
lib/gitlab/error_tracking.rb:52:in `with_context'
app/controllers/application_controller.rb:541:in `sentry_context'
app/controllers/application_controller.rb:469:in `block in set_current_context'
lib/gitlab/application_context.rb:52:in `block in use'
lib/gitlab/application_context.rb:52:in `use'
lib/gitlab/application_context.rb:20:in `with_context'
app/controllers/application_controller.rb:462:in `set_current_context'
lib/gitlab/request_profiler/middleware.rb:17:in `call'
lib/gitlab/jira/middleware.rb:19:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/multipart.rb:217:in `call'
lib/gitlab/middleware/read_only/controller.rb:51:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/same_site_cookies.rb:27: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:23:in `call'
config/initializers/fix_local_cache_middleware.rb:9:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:60:in `call'
lib/gitlab/middleware/release_env.rb:12:in `call'

==> /var/log/gitlab/nginx/gitlab_access.log <==
172.27.224.2 - - [19/Oct/2020:19:00:57 +0200] "POST /kolla_known_good/docker_registry/-/settings/access_tokens HTTP/2.0" 500 2926 "https://net3.git.lan/kolla_known_good/docker_registry/-/settings/access_tokens" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.99 Safari/537.36" -

==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET "/favicon.ico" for 172.27.224.2 at 2020-10-19 19:00:58 +0200

==> /var/log/gitlab/nginx/gitlab_access.log <==
172.27.224.2 - - [19/Oct/2020:19:00:58 +0200] "GET /favicon.ico HTTP/2.0" 301 136 "https://net3.git.lan/kolla_known_good/docker_registry/-/settings/access_tokens" "Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.99 Safari/537.36" -

after a lot of back and forward, I was able to create a token with my admin user.
But is there an idea of how to fix this issue?
I still test it but it would be very annoying outside of testing.
Cheers!

1 Like