Group repository storage moves API Not Working on 13.12.8
Summary
Customer on 13.12.8 tried to migrate groups from Gitaly backed by NFS to Gitaly Cluster using the Group repository storage moves API .The moves have a state of finished but the repositories remain in the original storage.
Steps to reproduce
- Perform a group storage repository move from classic Gitaly to Gitaly Cluster:
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" \ --data '{"destination_storage_name":"storage2"}' "https://gitlab.example.com/api/v4/groups/:group_id/repository_storage_moves"
- Retrieve group move for project using:
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:group_id/repository_storage_moves"
- State is marked as finished but the repos are not present on the target Gitaly Cluster nodes and UI indicates the projects are still on the source storage
Example Project
- GitLab server with two repository storage paths default(classic Gitaly backed by NFS) and cluster (Gitaly Cluster).
- Gitaly cluster has 1 praefect node and 3 Gitaly nodes (
gitaly-1
,gitaly-2
andgitaly-3
)
What is the current bug behavior?
- The projects for the group remain on the original
default
storage. The repositories are not present on the Gitaly Cluster nodes
What is the expected correct behavior?
- The projects should migrate to the Gitaly Cluster nodes and be updated on the UI
Relevant logs and/or screenshots
Sidekiq logs:
{
"severity": "INFO",
"time": "2021-11-12T12:36:06.717Z",
"class": "Groups::UpdateRepositoryStorageWorker",
"args": [
"10",
"[FILTERED]",
"34"
],
"retry": 3,
"queue": "groups_update_repository_storage",
"version": 0,
"jid": "cd6f8ed477d8f9e144a31a54",
"created_at": "2021-11-12T12:36:06.681Z",
"meta.user": "root",
"meta.root_namespace": "test_move",
"meta.caller_id": "POST /api/:version/groups/:id/repository_storage_moves",
"meta.remote_ip": "105.163.165.23",
"meta.feature_category": "gitaly",
"meta.client_id": "user/1",
"correlation_id": "01FMA2BR3M464P5CYDPPRWZWDX",
"enqueued_at": "2021-11-12T12:36:06.716Z",
"pid": 2128,
"message": "Groups::UpdateRepositoryStorageWorker JID-cd6f8ed477d8f9e144a31a54: start",
"job_status": "start",
"scheduling_latency_s": 0.001705,
"job_size_bytes": 502
}
{
"severity": "INFO",
"time": "2021-11-12T12:36:06.811Z",
"class": "Groups::UpdateRepositoryStorageWorker",
"args": [
"10",
"[FILTERED]",
"34"
],
"retry": 3,
"queue": "groups_update_repository_storage",
"version": 0,
"jid": "cd6f8ed477d8f9e144a31a54",
"created_at": "2021-11-12T12:36:06.681Z",
"meta.user": "root",
"meta.root_namespace": "test_move",
"meta.caller_id": "POST /api/:version/groups/:id/repository_storage_moves",
"meta.remote_ip": "105.163.165.23",
"meta.feature_category": "gitaly",
"meta.client_id": "user/1",
"correlation_id": "01FMA2BR3M464P5CYDPPRWZWDX",
"enqueued_at": "2021-11-12T12:36:06.716Z",
"pid": 2128,
"message": "Groups::UpdateRepositoryStorageWorker JID-cd6f8ed477d8f9e144a31a54: done: 0.094145 sec",
"job_status": "done",
"scheduling_latency_s": 0.001705,
"job_size_bytes": 502,
"cpu_s": 0.051356,
"gitaly_calls": 3,
"gitaly_duration_s": 0.02997,
"mem_objects": 14220,
"mem_bytes": 2115007,
"mem_mallocs": 3948,
"redis_calls": 6,
"redis_duration_s": 0.002038,
"redis_read_bytes": 530,
"redis_write_bytes": 429,
"redis_cache_calls": 4,
"redis_cache_duration_s": 0.001535,
"redis_cache_read_bytes": 528,
"redis_cache_write_bytes": 228,
"redis_queues_calls": 2,
"redis_queues_duration_s": 0.000503,
"redis_queues_read_bytes": 2,
"redis_queues_write_bytes": 201,
"db_count": 21,
"db_write_count": 13,
"db_cached_count": 1,
"duration_s": 0.094145,
"completed_at": "2021-11-12T12:36:06.811Z",
"db_duration_s": 0.015282
}
gitlab-rails/api_json.log:
{
"time": "2021-11-12T12:36:06.738Z",
"severity": "INFO",
"duration_s": 0.28081,
"db_duration_s": 0.11058,
"view_duration_s": 0.17023,
"status": 201,
"method": "POST",
"path": "/api/v4/groups/10/repository_storage_moves",
"params": [
{
"key": "destination_storage_name",
"value": "cluster"
}
],
"host": "GL_URL",
"remote_ip": "105.163.165.23, 105.163.165.23",
"ua": "curl/7.64.1",
"route": "/api/:version/groups/:id/repository_storage_moves",
"user_id": 1,
"username": "root",
"queue_duration_s": 0.067004,
"redis_calls": 6,
"redis_duration_s": 0.003606,
"redis_read_bytes": 705,
"redis_write_bytes": 1265,
"redis_cache_calls": 4,
"redis_cache_duration_s": 0.002904,
"redis_cache_read_bytes": 645,
"redis_cache_write_bytes": 217,
"redis_queues_calls": 2,
"redis_queues_duration_s": 0.000702,
"redis_queues_read_bytes": 60,
"redis_queues_write_bytes": 1048,
"db_count": 21,
"db_write_count": 5,
"db_cached_count": 3,
"cpu_s": 0.20739,
"mem_objects": 58005,
"mem_bytes": 13292231,
"mem_mallocs": 44171,
"mem_total_bytes": 15612431,
"correlation_id": "01FMA2BR3M464P5CYDPPRWZWDX",
"meta.user": "root",
"meta.root_namespace": "test_move",
"meta.caller_id": "POST /api/:version/groups/:id/repository_storage_moves",
"meta.remote_ip": "105.163.165.23",
"meta.feature_category": "gitaly",
"meta.client_id": "user/1",
"content_length": "38"
}
Source gitaly logs
{
"command.count": 1,
"command.inblock": 0,
"command.majflt": 0,
"command.maxrss": 45952,
"command.minflt": 135,
"command.oublock": 0,
"command.real_time_ms": 2,
"command.system_time_ms": 0,
"command.user_time_ms": 2,
"correlation_id": "01FMA2BR3M464P5CYDPPRWZWDX",
"grpc.code": "OK",
"grpc.meta.auth_version": "v2",
"grpc.meta.client_name": "gitlab-sidekiq",
"grpc.meta.deadline_type": "unknown",
"grpc.method": "ServerInfo",
"grpc.request.deadline": "2021-11-12T12:36:16.009Z",
"grpc.request.fullMethod": "/gitaly.ServerService/ServerInfo",
"grpc.service": "gitaly.ServerService",
"grpc.start_time": "2021-11-12T12:36:06.749Z",
"grpc.time_ms": 17.362,
"level": "info",
"msg": "finished unary call with code OK",
"peer.address": "10.132.0.81:43364",
"pid": 22797,
"remote_ip": "105.163.165.23",
"span.kind": "server",
"system": "grpc",
"time": "2021-11-12T12:36:06.766Z",
"username": "root"
}
{
"correlation_id": "01FMA2BR3M464P5CYDPPRWZWDX",
"grpc.code": "OK",
"grpc.meta.auth_version": "v2",
"grpc.meta.client_name": "gitlab-sidekiq",
"grpc.meta.deadline_type": "unknown",
"grpc.method": "RepositoryExists",
"grpc.request.deadline": "2021-11-12T12:36:16.002Z",
"grpc.request.fullMethod": "/gitaly.RepositoryService/RepositoryExists",
"grpc.request.glProjectPath": "test_move.wiki",
"grpc.request.glRepository": "group-10-wiki",
"grpc.request.repoPath": "@groups/4a/44/4a44dc15364204a80fe80e9039455cc1608281820fe2b24f1e5233ade6af1dd5.wiki.git",
"grpc.request.repoStorage": "default",
"grpc.request.topLevelGroup": "@groups",
"grpc.service": "gitaly.RepositoryService",
"grpc.start_time": "2021-11-12T12:36:06.792Z",
"grpc.time_ms": 0.646,
"level": "info",
"msg": "finished unary call with code OK",
"peer.address": "10.132.0.81:43364",
"pid": 22797,
"remote_ip": "105.163.165.23",
"span.kind": "server",
"system": "grpc",
"time": "2021-11-12T12:36:06.793Z",
"username": "root"
}
Destination praefect logs:
{
"correlation_id": "01FMA2BR3M464P5CYDPPRWZWDX",
"grpc.code": "OK",
"grpc.meta.auth_version": "v2",
"grpc.meta.client_name": "gitlab-sidekiq",
"grpc.meta.deadline_type": "unknown",
"grpc.method": "ServerInfo",
"grpc.request.deadline": "2021-11-12T12:36:16.009Z",
"grpc.request.fullMethod": "/gitaly.ServerService/ServerInfo",
"grpc.service": "gitaly.ServerService",
"grpc.start_time": "2021-11-12T12:36:06.770Z",
"grpc.time_ms": 4.998,
"level": "info",
"msg": "finished unary call with code OK",
"peer.address": "10.132.0.81:52654",
"pid": 1704,
"remote_ip": "105.163.165.23",
"span.kind": "server",
"system": "grpc",
"time": "2021-11-12T12:36:06.775Z",
"username": "root"
}
Destination gitaly cluster node logs:
{
"command.count": 1,
"command.inblock": 0,
"command.majflt": 0,
"command.maxrss": 35740,
"command.minflt": 137,
"command.oublock": 0,
"command.real_time_ms": 2,
"command.system_time_ms": 1,
"command.user_time_ms": 0,
"correlation_id": "01FMA2BR3M464P5CYDPPRWZWDX",
"grpc.code": "OK",
"grpc.meta.auth_version": "v2",
"grpc.meta.deadline_type": "unknown",
"grpc.method": "ServerInfo",
"grpc.request.deadline": "2021-11-12T12:36:16.010Z",
"grpc.request.fullMethod": "/gitaly.ServerService/ServerInfo",
"grpc.service": "gitaly.ServerService",
"grpc.start_time": "2021-11-12T12:36:06.771Z",
"grpc.time_ms": 2.928,
"level": "info",
"msg": "finished unary call with code OK",
"peer.address": "10.132.0.82:32870",
"pid": 1685,
"span.kind": "server",
"system": "grpc",
"time": "2021-11-12T12:36:06.774Z"
}
Retrieving group move with: Retrieve group move for project using: curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:group_id/repository_storage_moves"
shows state as finished
{
"id": 34,
"created_at": "2021-11-12T12:36:06.669Z",
"state": "finished",
"source_storage_name": "default",
"destination_storage_name": "cluster",
"group": {
"id": 10,
"web_url": "https://GL_URL/groups/test_move",
"name": "test_move"
}
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.2p137 Gem Version: 3.1.4 Bundler Version:2.1.4 Rake Version: 13.0.3 Redis Version: 6.0.14 Git Version: 2.31.1 Sidekiq Version:5.2.9 Go Version: unknown GitLab information Version: 13.12.8-ee Revision: 6ab58f00404 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 12.6 URL: https://GL_URL HTTP Clone URL: https://GL_URL/some-group/some-project.git SSH Clone URL: git@GL_URL:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers: GitLab Shell Version: 13.18.0 Repository storage paths: - default: /mnt/gitlab/repositories - cluster: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 13.18.0 ? ... OK (13.18.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 cluster ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes (cluster/worker) ... 1/1
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 ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... 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? ... 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: ... 2/1 ... yes 3/2 ... yes 3/3 ... yes 4/4 ... yes 5/5 ... yes 6/6 ... yes 7/7 ... yes 8/10 ... yes 8/11 ... yes 9/12 ... yes 9/13 ... yes 10/14 ... yes 10/15 ... yes Redis version >= 5.0.0? ... yes Ruby version >= 2.7.2 ? ... yes (2.7.2) Git version >= 2.31.0 ? ... yes (2.31.1) Git user has default SSH configuration? ... yes Active users: ... 1 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 (6.4 - 6.x deprecated to be removed in 13.8)? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished