gitlab部分操作报错500。通过Rails日志发现以下报错:
报错:
RedisClient::CommandError
ERR unknown command 'HELLO'
- {
- "severity": "ERROR",
- "time": "2024-04-22T02:50:16.906Z",
- "correlation_id": "01HW1VC67EJEGKQ1A1CW9TMVPV",
- "meta.caller_id": "UserSettings::PersonalAccessTokensController#create",
- "meta.remote_ip": "10.1.11.11",
- "meta.feature_category": "system_access",
- "meta.user": "root",
- "meta.user_id": 1,
- "meta.client_id": "user/1",
- "exception.class": "RedisClient::CommandError",
- "exception.message": "ERR unknown command 'HELLO'",
- "exception.backtrace": [
- "lib/gitlab/instrumentation/redis_client_middleware.rb:26:in `block in call_pipelined'",
- "lib/gitlab/instrumentation/redis_helper.rb:17:in `instrument_call'",
- "lib/gitlab/instrumentation/redis_client_middleware.rb:25:in `call_pipelined'",
- "lib/gitlab/patch/redis_client.rb:12:in `ensure_connected'",
- "config/initializers/forbid_sidekiq_in_transactions.rb:82:in `block (2 levels) in \u003cmodule:NoEnqueueingFromTransactions\u003e'",
- "app/services/notification_service.rb:95:in `access_token_created'",
- "app/services/personal_access_tokens/create_service.rb:20:in `execute'",
- "app/controllers/user_settings/personal_access_tokens_controller.rb:33:in `create'",
- "app/controllers/application_controller.rb:468:in `set_current_admin'",
- "lib/gitlab/session.rb:11:in `with_session'",
- "app/controllers/application_controller.rb:459:in `set_session_storage'",
- "lib/gitlab/i18n.rb:114:in `with_locale'",
- "lib/gitlab/i18n.rb:120:in `with_user_locale'",
- "app/controllers/application_controller.rb:450:in `set_locale'",
- "app/controllers/application_controller.rb:443:in `set_current_context'",
- "lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call'",
- "lib/gitlab/middleware/memory_report.rb:13:in `call'",
- "lib/gitlab/middleware/speedscope.rb:13:in `call'",
- "lib/gitlab/database/load_balancing/rack_middleware.rb:23:in `call'",
- "lib/gitlab/middleware/rails_queue_duration.rb:33:in `call'",
- "lib/gitlab/etag_caching/middleware.rb:21:in `call'",
- "lib/gitlab/metrics/rack_middleware.rb:16:in `block in call'",
- "lib/gitlab/metrics/web_transaction.rb:46:in `run'",
- "lib/gitlab/metrics/rack_middleware.rb:16:in `call'",
- "lib/gitlab/middleware/go.rb:20:in `call'",
- "lib/gitlab/middleware/query_analyzer.rb:11:in `block in call'",
- "lib/gitlab/database/query_analyzer.rb:40:in `within'",
- "lib/gitlab/middleware/query_analyzer.rb:11:in `call'",
- "lib/gitlab/middleware/multipart.rb:173:in `call'",
- "lib/gitlab/middleware/read_only/controller.rb:50:in `call'",
- "lib/gitlab/middleware/read_only.rb:18:in `call'",
- "lib/gitlab/middleware/unauthenticated_session_expiry.rb:18:in `call'",
- "lib/gitlab/middleware/same_site_cookies.rb:27:in `call'",
- "lib/gitlab/middleware/path_traversal_check.rb:35:in `call'",
- "lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'",
- "lib/gitlab/middleware/basic_health_check.rb:25:in `call'",
- "lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'",
- "lib/gitlab/middleware/request_context.rb:15:in `call'",
- "lib/gitlab/middleware/webhook_recursion_detection.rb:15:in `call'",
- "config/initializers/fix_local_cache_middleware.rb:11:in `call'",
- "lib/gitlab/middleware/compressed_json.rb:44:in `call'",
- "lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:19:in `call'",
- "lib/gitlab/middleware/sidekiq_web_static.rb:20:in `call'",
- "lib/gitlab/metrics/requests_rack_middleware.rb:79:in `call'",
- "lib/gitlab/middleware/release_env.rb:13:in `call'"
- ],
- "user.username": "root",
- "tags.program": "web",
- "tags.locale": "en",
- "tags.feature_category": "system_access",
- "tags.correlation_id": "01HW1VC67EJEGKQ1A1CW9TMVPV",
- "extra.storage": "queues"
- }
日志报错是Redis执行HELLO命令报错,这个命令适用于指定RESP版本。
结合以上3点,怀疑Gitlab 16.x版本之前使用RESP2,之后使用RESP3。
进入Redis,执行monitor,复现问题查看操作:
再次看到与HELLO 3命令相关。
结论(踩坑)
后续处理