Gibberish error when making an invalid deploy key
Summary
GitLab Outputs all the errors at once for a misconfigured deploy key
Steps to reproduce
- Navigate to the "Repository Settings" page for a project
- Expand "Deploy keys"
- Enter a completely invalid key. Title:
Foo
, Key:HERRING
. - Press "Add Key"
Example Project
(If possible, please create an example project here on GitLab.com that exhibits the problematic behavior, and link to it here in the bug report)
(If you are using an older version of GitLab, this will also determine whether the bug is fixed in a more recent version)
What is the current bug behavior?
Gitlab emits the following ridiculous error message:
Key is invalid, Key type is forbidden. Must be RSA, ECDSA, or ED25519, Fingerprint has already been taken, Fingerprint cannot be generated, Deploy keys projects deploy key key is invalid, Deploy keys projects deploy key key type is forbidden. Must be RSA, ECDSA, or ED25519, Deploy keys projects deploy key fingerprint has already been taken, Deploy keys projects deploy key fingerprint cannot be generated
What is the expected correct behavior?
Show errors in order:
Key value is invalid, must be a correctly formatted RSA, ECDSA, or ED25519 key.
After this has been resolved, we can show the next error if any.
Relevant logs and/or screenshots
Screenshot |
---|
![]() |
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)