Registry storage driver gcs seems to be missing
Summary
When trying to use gcs storage driver for registry (with omnibus dist), registry complains about gcs
storage driver being not registered
.
Steps to reproduce
add these lines to your /etc/gitlab/gitlab.rb
:
registry['storage'] = {
'gcs' => {
'bucket' => 'registry',
'keyfile' => '/etc/gitlab/google-access-registry.json'
}
}
(you can adapt registry
and /etc/gitlab/google-access-registry.json
with your values, but it might not affect the repro since it fails way before communicating with GCS)
then run gitlab-ctl reconfigure
then try to access your registry (uploading an image for example).
registry fails (as in crash) and complains in logs (see gitlab-ctl tail
or /var/log/gitlab/registry/current
)
Expected behavior
the registry to use the cloud storage and not to crash.
Relevant logs and/or screenshots
2016-06-27_13:00:48.82389 panic: StorageDriver not registered: gcs
2016-06-27_13:00:48.82396
2016-06-27_13:00:48.82397 goroutine 1 [running]:
2016-06-27_13:00:48.82402 github.com/docker/distribution/registry/handlers.NewApp(0x7efdb6a813e0, 0xc8202cb320, 0xc820079080, 0x7efdb6a813e0)
2016-06-27_13:00:48.82409 /var/cache/omnibus/src/github.com/docker/distribution/registry/handlers/app.go:121 +0x610
2016-06-27_13:00:48.82414 github.com/docker/distribution/registry.NewRegistry(0x7efdb6a81420, 0xc8202cb320, 0xc820079080, 0xc820079080, 0x0, 0x0)
2016-06-27_13:00:48.82424 /var/cache/omnibus/src/github.com/docker/distribution/registry/registry.go:84 +0x2b0
2016-06-27_13:00:48.82429 github.com/docker/distribution/registry.glob.func1(0x1105380, 0xc8202e6260, 0x1, 0x1)
2016-06-27_13:00:48.82436 /var/cache/omnibus/src/github.com/docker/distribution/registry/registry.go:53 +0x29d
2016-06-27_13:00:48.82441 github.com/spf13/cobra.(*Command).execute(0x1105380, 0xc8202e61f0, 0x1, 0x1, 0x0, 0x0)
2016-06-27_13:00:48.82451 /var/cache/omnibus/src/github.com/spf13/cobra/command.go:495 +0x6e3
2016-06-27_13:00:48.82456 github.com/spf13/cobra.(*Command).Execute(0x1105520, 0x0, 0x0)
2016-06-27_13:00:48.82461 /var/cache/omnibus/src/github.com/spf13/cobra/command.go:560 +0x180
2016-06-27_13:00:48.82466 main.main()
2016-06-27_13:00:48.82468 /var/cache/omnibus/src/github.com/docker/distribution/cmd/registry/main.go:23 +0x23
2016-06-27_13:00:48.82474
2016-06-27_13:00:48.82475 goroutine 17 [syscall, locked to thread]:
2016-06-27_13:00:48.82481 runtime.goexit()
2016-06-27_13:00:48.82484 /usr/local/go/src/runtime/asm_amd64.s:1721 +0x1
2016-06-27_13:00:48.82489
2016-06-27_13:00:48.82490 goroutine 6 [syscall]:
2016-06-27_13:00:48.82498 os/signal.loop()
2016-06-27_13:00:48.82501 /usr/local/go/src/os/signal/signal_unix.go:22 +0x18
2016-06-27_13:00:48.82506 created by os/signal.init.1
2016-06-27_13:00:48.82509 /usr/local/go/src/os/signal/signal_unix.go:28 +0x37
(the most important part is panic: StorageDriver not registered: gcs
)
root@tracker:/etc/gitlab# /opt/gitlab/embedded/bin/registry --version
/opt/gitlab/embedded/bin/registry github.com/docker/distribution v2.4.1
root@tracker:/etc/gitlab#
Output of checks
Results of GitLab Application Check
root@tracker:/etc/gitlab# gitlab-rake gitlab:check SANITIZE=true
Checking GitLab Shell ...
GitLab Shell version >= 3.0.0 ? ... OK (3.0.0)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
hooks directories in repos are links: ...
5/1 ... ok
5/2 ... ok
5/3 ... ok
5/4 ... ok
6/5 ... ok
5/7 ... ok
5/8 ... ok
5/9 ... ok
5/10 ... ok
6/11 ... ok
5/12 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/var/opt/gitlab/git-data/repositories: OK
/var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ...
5/1 ... yes
5/2 ... yes
5/3 ... yes
5/4 ... yes
6/5 ... yes
5/7 ... yes
5/8 ... yes
5/9 ... yes
5/10 ... yes
6/11 ... yes
5/12 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.1.8)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.7.4)
Active users: 10
Checking GitLab ... Finished
root@tracker:/etc/gitlab#
Results of GitLab Environment Info
(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:env:info)
(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production)
Possible fixes
If registry isn't baked with gcs
driver as of today (looks like it's the problem here), consider either to:
- not supporting gcs at all, and removing it from the docs
- compile docker registry with the
include_gcs
tag (not tested, but should work according to https://github.com/docker/distribution/blob/f4b6fc8d681c42137b7d2bb544b087462bc34d47/registry/storage/driver/gcs/doc.go#L1 )
Notes
- Although not tested, a bref reading of docker's registry code makes me thing that
oss
driver is not included by default in builds - Apparently, Docker thinks that gcs is stable enough to include it by default in the official registry docker image (see https://github.com/docker/distribution/blob/c1c230dee9623945981e08e39cd41e527df8e306/Dockerfile#L4 )
- The main components and commands of GCS driver are from google, so I assume as well that the driver should be pretty stable (see https://github.com/docker/distribution/blob/f4b6fc8d681c42137b7d2bb544b087462bc34d47/registry/storage/driver/gcs/gcs.go#L38 )