[go: up one dir, main page]

Skip to content

GitLab Rails Console Fails Due to YAML Formatting Error in secrets.yml

Summary

The GitLab Rails console fails to start due to a YAML syntax error in /srv/gitlab/config/secrets.yml. The error occurs specifically with the formatting of active_record_encryption_primary_key and active_record_encryption_deterministic_key fields.

Update - only happens for secrets formatted in Flow syntax for array #5880 (comment 2269288795)

Issue Details

When attempting to start the GitLab Rails console, the following error occurs:

git@gitlab-toolbox-549dc699b7-kx9zt:/$ gitlab-rails console
/usr/lib/ruby/3.2.0/psych/parser.rb:62:in `_native_parse': (/srv/gitlab/config/secrets.yml): could not find expected ':' while scanning a simple key at line 59 column 3 (Psych::SyntaxError)

Current configuration (Problematic) - /srv/gitlab/config/secrets.yml :

production:
  secret_key_base: 123
  otp_key_base: 123
  db_key_base: 123
  encrypted_settings_key_base: 123
  openid_connect_signing_key: |
    -----BEGIN RSA PRIVATE KEY-----
    123
    -----END RSA PRIVATE KEY-----
  active_record_encryption_primary_key:
  [123]
  active_record_encryption_deterministic_key:
  [123]
  active_record_encryption_key_derivation_salt: 123

Changing above to below resolves the issue:

production:
  secret_key_base: 123
  otp_key_base: 123
  db_key_base: 123
  encrypted_settings_key_base: 123
  openid_connect_signing_key: |
    -----BEGIN RSA PRIVATE KEY-----
    123
    -----END RSA PRIVATE KEY-----
  active_record_encryption_primary_key: [123]
  active_record_encryption_deterministic_key: [123]
  active_record_encryption_key_derivation_salt: 123

Steps to Reproduce

  1. Install latest GitLab with ActiveRecord::Encryption secrets using automated secrets creation
  2. Attempt to access GitLab Rails console

Environment

Upgraded from 17.6.2 to the nightly/development build

Expected Behavior

GitLab Rails console should start without any errors.

Current Behavior

Console fails to start with a YAML parsing error.

Edited by Nailia Iskhakova