Unable to Login to Container Registry

I am not able to login to the container registry. I get this error after issuing docker login:

Error response from daemon: Get https://gitlab.example.com:4567/v2/: error parsing HTTP 403 response body: unexpected end of JSON input: ""

Here is the log from registry/current:

2016-07-19_00:41:55.31347 time="2016-07-18T17:41:55.313403147-07:00" level=warning msg="error authorizing context: authorization token required" environment=production go.version=go1.5.4 http.request.host="gitlab.example.com:4567" http.request.uri="/v2/" http.request.useragent="docker/1.12.0-rc4 go/go1.6.2 git-commit/e4a0dbc kernel/4.4.15-moby os/linux arch/amd64 UpstreamClient(Docker-Client/1.12.0-rc4 \\(darwin\\))" service=registry version=v2.4.1 
2016-07-19_00:41:55.31351 127.0.0.1 - - [18/Jul/2016:17:41:55 -0700] "GET /v2/ HTTP/1.0" 401 87 "" "docker/1.12.0-rc4 go/go1.6.2 git-commit/e4a0dbc kernel/4.4.15-moby os/linux arch/amd64 UpstreamClient(Docker-Client/1.12.0-rc4 \\(darwin\\))"

I am running Gitlab 8.9.6-ee. Any ideas?

I ran into this exact issue this weekend, and after 2 days, I finally figured out my issue which ended up having to do with a previous LDAP integration. Perhaps your issue is also related:

http://docs.nason.co/kb/gitlab_registry_failure/

Hi,

This will be fixed in the next release.

The current workaround is to add the following to your gitlab.rb configuration file.

registry_nginx['custom_gitlab_server_config'] = 'proxy_cache_convert_head off;'