-
由 Stan Hu 创作于
In GitLab 16.0, we migrated away from `Settingslogic` in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/113040 and started using `ActiveSupport::ConfigurationFile.parse`. However, if GitLab Omnibus were configured with non-ASCII characters, such as German Umlauts, Sidekiq would fail to start up due to: ``` incompatible character encodings: US-ASCII and UTF-8 ``` This happened because: 1. Ruby sets the default encoding based on the `LANG` environment. 2. When Omnibus GitLab starts Sidekiq, `LANG` is blank. As a result, Ruby's `Encoding.default_external` returns `US-ASCII`. 3. When `ActiveSupport::ConfigurationFile.parse` runs, it attempts to scan for certain UTF-8 characters, but this fails in GitLab 16.0 since the file is read as `US-ASCII`. 4. Just by calling `require 'rails'`, Rails sets the encoding to UTF-8. 5. However, `sidekiq-cluster` doesn't attempt to `require 'rails'` before it attempts to load the settings, and so it will crash if non-ASCII characters are present. To fix this, set the encodings inside the `GitlabSettings::Settings` class to ensure configuration files are parsed as UTF-8. Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/412767 Changelog: fixed
由 Stan Hu 创作于In GitLab 16.0, we migrated away from `Settingslogic` in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/113040 and started using `ActiveSupport::ConfigurationFile.parse`. However, if GitLab Omnibus were configured with non-ASCII characters, such as German Umlauts, Sidekiq would fail to start up due to: ``` incompatible character encodings: US-ASCII and UTF-8 ``` This happened because: 1. Ruby sets the default encoding based on the `LANG` environment. 2. When Omnibus GitLab starts Sidekiq, `LANG` is blank. As a result, Ruby's `Encoding.default_external` returns `US-ASCII`. 3. When `ActiveSupport::ConfigurationFile.parse` runs, it attempts to scan for certain UTF-8 characters, but this fails in GitLab 16.0 since the file is read as `US-ASCII`. 4. Just by calling `require 'rails'`, Rails sets the encoding to UTF-8. 5. However, `sidekiq-cluster` doesn't attempt to `require 'rails'` before it attempts to load the settings, and so it will crash if non-ASCII characters are present. To fix this, set the encodings inside the `GitlabSettings::Settings` class to ensure configuration files are parsed as UTF-8. Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/412767 Changelog: fixed
代码所有者
将用户和群组指定为特定文件更改的核准人。 了解更多。