合并请求组件加载不出来

求助各位大佬,昨天突然出现如题的问题。
gitlab版本:
15.5
后台任务报错日志如下:
9分钟前 default MergeRequestMergeabilityCheckWorker 10 GRPC::Internal: 13:could not open repository: config value ‘safe.directory’ was not found. debug_error_string:{“created”:"@1669343080.152020500",“description”:"Error received from peer unix:/var/opt/gi…

可以贴一下更详细的日志吗?从相关资料看,像是一个bug,需要更多的日志来判断。

好的。请看下面这个日志可以吗?
sidekiq/@40000000637f68ad0589ea54.u:{“severity”:“INFO”,“time”:“2022-11-24T12:49:26.406Z”,“retry”:3,“queue”:“default”,“version”:0,“args”:[“7”],“class”:“MergeRequestMergeabilityCheckWorker”,“jid”:“4a312ee789f58014beef1269”,“created_at”:“2022-11-24T12:48:28.611Z”,“correlation_id”:“a3bb83e1eff61c9c021b183dc1b304ef”,“meta.caller_id”:“NewMergeRequestWorker”,“meta.remote_ip”:“192.168.1.101”,“meta.feature_category”:“code_review”,“meta.user”:“zhouyuan”,“meta.project”:“components/afrcommon”,“meta.root_namespace”:“components”,“meta.client_id”:“user/2”,“meta.root_caller_id”:“Projects::MergeRequests::CreationsController#create”,“worker_data_consistency”:“always”,“idempotency_key”:“resque:gitlab:duplicate:default:091c954566a7c2b7414415ba14da0252947a2860efcd4e4a27b2486dd2567469”,“size_limiter”:“validated”,“enqueued_at”:“2022-11-24T12:49:26.403Z”,“error_message”:“13:could not open repository: config value ‘safe.directory’ was not found. debug_error_string:{“created”:”@1669294134.633885600",“description”:“Error received from peer unix:/var/opt/gitlab/gitaly/gitaly.socket”,“file”:“src/core/lib/surface/call.cc”,“file_line”:1063,“grpc_message”:“could not open repository: config value ‘safe.directory’ was not found”,“grpc_status”:13}",“error_class”:“GRPC::Internal”,“failed_at”:“2022-11-24T12:48:29.275Z”,“retry_count”:1,“retried_at”:“2022-11-24T12:48:54.641Z”,“job_size_bytes”:3,“pid”:397,“message”:“MergeRequestMergeabilityCheckWorker JID-4a312ee789f58014beef1269: start”,“job_status”:“start”,“scheduling_latency_s”:0.003016}
sidekiq/@40000000637f68ad0589ea54.u:{“severity”:“INFO”,“time”:“2022-11-24T12:49:26.686Z”,“retry”:3,“queue”:“default”,“version”:0,“args”:[“7”],“class”:“MergeRequestMergeabilityCheckWorker”,“jid”:“4a312ee789f58014beef1269”,“created_at”:“2022-11-24T12:48:28.611Z”,“correlation_id”:“a3bb83e1eff61c9c021b183dc1b304ef”,“meta.caller_id”:“NewMergeRequestWorker”,“meta.remote_ip”:“192.168.1.101”,“meta.feature_category”:“code_review”,“meta.user”:“zhouyuan”,“meta.project”:“components/afrcommon”,“meta.root_namespace”:“components”,“meta.client_id”:“user/2”,“meta.root_caller_id”:“Projects::MergeRequests::CreationsController#create”,“worker_data_consistency”:“always”,“idempotency_key”:“resque:gitlab:duplicate:default:091c954566a7c2b7414415ba14da0252947a2860efcd4e4a27b2486dd2567469”,“size_limiter”:“validated”,“enqueued_at”:“2022-11-24T12:49:26.403Z”,“error_message”:“13:could not open repository: config value ‘safe.directory’ was not found. debug_error_string:{“created”:”@1669294134.633885600",“description”:“Error received from peer unix:/var/opt/gitlab/gitaly/gitaly.socket”,“file”:“src/core/lib/surface/call.cc”,“file_line”:1063,“grpc_message”:“could not open repository: config value ‘safe.directory’ was not found”,“grpc_status”:13}",“error_class”:“GRPC::Internal”,“failed_at”:“2022-11-24T12:48:29.275Z”,“retry_count”:1,“retried_at”:“2022-11-24T12:48:54.641Z”,“job_size_bytes”:3,“pid”:397,“message”:“MergeRequestMergeabilityCheckWorker JID-4a312ee789f58014beef1269: done: 0.280584 sec”,“job_status”:“done”,“scheduling_latency_s”:0.003016,“gitaly_calls”:3,“gitaly_duration_s”:0.131698,“redis_calls”:16,“redis_duration_s”:0.006132,“redis_read_bytes”:153,“redis_write_bytes”:1004,“redis_cache_calls”:9,“redis_cache_duration_s”:0.001397,“redis_cache_read_bytes”:139,“redis_cache_write_bytes”:312,“redis_queues_calls”:4,“redis_queues_duration_s”:0.003848,“redis_queues_read_bytes”:10,“redis_queues_write_bytes”:312,“redis_shared_state_calls”:3,“redis_shared_state_duration_s”:0.000887,“redis_shared_state_read_bytes”:4,“redis_shared_state_write_bytes”:380,“db_count”:19,“db_write_count”:4,“db_cached_count”:2,“db_replica_count”:0,“db_primary_count”:19,“db_main_count”:19,“db_main_replica_count”:0,“db_replica_cached_count”:0,“db_primary_cached_count”:2,“db_main_cached_count”:2,“db_main_replica_cached_count”:0,“db_replica_wal_count”:0,“db_primary_wal_count”:0,“db_main_wal_count”:0,“db_main_replica_wal_count”:0,“db_replica_wal_cached_count”:0,“db_primary_wal_cached_count”:0,“db_main_wal_cached_count”:0,“db_main_replica_wal_cached_count”:0,“db_replica_duration_s”:0.0,“db_primary_duration_s”:0.087,“db_main_duration_s”:0.087,“db_main_replica_duration_s”:0.0,“cpu_s”:0.060568,“mem_objects”:15821,“mem_bytes”:872256,“mem_mallocs”:3320,“mem_total_bytes”:1505096,“worker_id”:“sidekiq_0”,“rate_limiting_gates”:[],“duration_s”:0.280584,“completed_at”:“2022-11-24T12:49:26.686Z”,“load_balancing_strategy”:“primary”,“db_duration_s”:0.086316}

根据目前查询到的信息,提示是gitaly目录的用户权限不对,您那里可以帮忙看一下/var/opt/gitlab/git-data/repositories目录的权限以及属主信息吗?

好的。我这边是用docker部署的,进入容器内看了下/var/opt/gitlab/git-data/repositories目录的权限:
drwxrws— git git

麻烦您再发下repositories目录下各个子目录的权限和属主信息

好的。
repositories 下各个子目录的权限和属主信息:
drwxrwxrwx 1000 1000 +gitaly
-rwxrwxrwx 1000 1000 .gitaly-metadata
drwxrwxrwx 1000 1000 ‘@hashed

默认的值应该是git git,而你这里显示的是1000 1000,说明权限配置错误,需要使用下面的命令来修改:
chown git.git -R /var/opt/gitlab/git-data/repositories,修改完成后应该就可以解决。

确实没问题了!非常感谢~ :+1:
不过为啥属主会变呢… 最开始搭建起来的时候都没问题

这个不太清楚,可能是升级或者reconfigure时修改了权限,也可能是错误的配置导致的。具体的没有实际环境,也不太好排查。

明白,问题解决了就好 :grinning: