Skip to content

Incorrectly logging git-linguist errors

Our GitLab 14.4.2 instance is logging lots of these errors:

Dec 14 17:14:09 gitlab-gitaly-0 gitaly error {"args":["env","PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/srv/gitaly-ruby/bin","/usr/bin/bundle","exec","bin/ruby-cd","/home/git/repositories/@hashed/83/91/83919e69fdb33a91fdc571f557ce4e2a47b7a9abfcb6593917848417e3e0f7c9.git","git-linguist","--commit=60bd7c7210a7ec991db67a89f08bffcf1809750c","stats"],"command.cpu_time_ms":2544.141,"command.exitCode":0,"command.inblock":0,"command.maxrss":166900,"command.oublock":0,"command.real_time_ms":2553.3438950000004,"command.system_time_ms":213.709,"command.user_time_ms":2330.4320000000002,"correlation_id":"01FPXG4MDCDKPY07WZQYW02YT4","grpc.meta.auth_version":"v2","grpc.meta.client_name":"gitlab-sidekiq","grpc.meta.deadline_type":"unknown","grpc.meta.method_type":"unary","grpc.method":"CommitLanguages","grpc.request.deadline":"2021-12-15T04:14:07.385","grpc.request.fullMethod":"/gitaly.CommitService/CommitLanguages","grpc.request.glProjectPath":"REMOVED","grpc.request.glRepository":"project-16581","grpc.request.repoPath":"@hashed/83/91/83919e69fdb33a91fdc571f557ce4e2a47b7a9abfcb6593917848417e3e0f7c9.git","grpc.request.repoStorage":"default","grpc.service":"gitaly.CommitService","grpc.start_time":"2021-12-14T22:14:07.386","level":"error","msg":"PID 33555 BUNDLE_GEMFILE=/srv/gitaly-ruby/Gemfile\n","path":"/usr/bin/env","peer.address":"172.30.181.82:45916","pid":33555,"remote_ip":"127.0.0.6","span.kind":"server","system":"grpc","time":"2021-12-14T22:14:09.942Z","username":"REMOVED"}

Since the log message indicates "command.exitCode":0, I suspect the command is actually succeeding and is only logging the error because of this output to stderr: PID 33555 BUNDLE_GEMFILE=/srv/gitaly-ruby/Gemfile\n.

A potential fix I tried was to comment out this line in my ruby-cd file, and it did clean up the logs.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information