gitlab-ctl reconfigure fail on registering Mattermost
### Summary gitlab-ctl reconfigure fails in regenerating the app_id/app_secret for two reasons: 1) the Application name it's different from "GitLab Mattermost" which is hard-encoded into cookbooks 2) the "\r\n" it's not enough backslash quoted in building the redirect_uri for mattermost ### Steps to reproduce We set up Mattermost before September 2022 and it worked fine creating in gitlab an application named "Mattermost". Since Sep 2022, all the gitlab-ctl reconfigure fails (with a "silent" error that do not break chef...) ### What is the current *bug* behavior? Having a different name for the application in gitlab (eg. "My Mattermost") - configured in the past (looking at logs, I believe that these errors arise since 2022 September...) - the cookbook now search for an application "GitLab Mattermost" and fails twice, first searching for the entry with that name (hard-encoded into cookbooks) and fails also because the redirect_uri does not match the saved redirect_uri by gitlab, as there is a missing backslash quote of "\r\n" which should be "\\r\\n" For the first problem, there's no mention in the documentation about a "specific name" to be used when managing mattermost with gitlab-ctl, but I agree, could be a wrong change, but as it's permitted, probably this could be considered. For the second problem, fixing the backquoting, we got registering gitlab-secrets successfully run. It seems to me that there is a mutual incomprension between omnibus cookbooks and gitlab web interface. The other side-effect is that the gitlab-ctl reconfigure waits for many seconds stuck on "Connecting to GitLab to generate new app_id and app_secret for GitLab Mattermost." also because in the Doorkeeper record there was a null value for register_as_oauth_app and now the updated value is "false". We checked this also in other three gitlab instances (at same gitlab omnibus version, either dockerized or not) and in all of them the reconfigure fail arise. ### What is the expected *correct* behavior? It should register the app and update the gitlab-secrets ### Relevant logs <details> <summary> Relevant logs </summary> <pre> [2024-07-31T12:55:49+02:00] WARN: Connecting to GitLab to generate new app_id and app_secret for GitLab Mattermost. [2024-07-31T12:56:35+02:00] WARN: Something went wrong while trying to update gitlab-secrets.json. Check the file permissions and try reconfiguring again. [2024-07-31T12:56:35+02:00] INFO: ruby_block[authorize mattermost with gitlab] called </pre> </details> ### Details of package version <details> <summary>Provide the package version installation details</summary> <pre> gitlab-ce-17.2.1-ce.0.el9.x86_64 </pre> </details> ### Environment details * Operating System: `Rocky 9.4` * Installation Target, remove incorrect values: * * VM: Other `Openstack self-managed` * Installation Type, remove incorrect values: * Upgrade from version `the one preceding the latest one...` * Is this a single installation? * Resources * CPU: `8` * Memory total: `16GB` ### Configuration details <details> <summary> Provide the relevant sections of `/etc/gitlab/gitlab.rb` </summary> <pre> none involved </pre> </details>
issue