Inconsistent documentation of the container registry produces an untraceable error.
Hey, thanks for your work on GitLab. I use currently gitlab directly from source and I found a bug/inconsistency for container registry feature. This commit https://gitlab.com/gitlab-org/gitlab-ce/commit/669fc3b9b85836beb7f7dfd1d2cf1b9c7b571e77#0ef14ca7e447f477230136ca76fb4ab0bed43af4_186_184 changes the entry from
registry:
.....
key: <yourkey>
to
registry:
.....
key_path: <yourkey>
And this doesn't work if you used the key_path
item you get an 500 and this produces this error message below.
Started GET "/root/test/container_registry" for 127.0.0.1 at 2016-05-27 10:04:54 +0000
by Projects::ContainerRegistryController#index as HTML
Parameters: {"namespace_id"=>"root", "project_id"=>"test"}
Completed 500 Internal Server Error in 73ms (ActiveRecord: 6.7ms)
TypeError (no implicit conversion of nil into String):
lib/json_web_token/rsa_token.rb:20:in `read'
lib/json_web_token/rsa_token.rb:20:in `key_data'
lib/json_web_token/rsa_token.rb:24:in `key'
lib/json_web_token/rsa_token.rb:28:in `public_key'
lib/json_web_token/rsa_token.rb:33:in `kid'
lib/json_web_token/rsa_token.rb:12:in `encoded'
app/services/auth/container_registry_authentication_service.rb:25:in `full_access_token'
app/models/project.rb:316:in `container_registry_repository'
app/controllers/projects/container_registry_controller.rb:28:in `container_registry_repository'
controllers/projects/container_registry_controller.rb:8:in `index'
/gitlab/middleware/go.rb:16:in `call'
To find it out I checked the docker omnibus image and omibus uses key: <yourkey>
and if you use this it works.
My solution would be to correct the related documentation or change the related source to it.