Snippets Author can't be blank error
Summary
When Default snippet visibility is set to an option that is disabled in Restricted visibility levels, no radio button is selected by default on the /snippets/new
page when the user is not an admin.
gitlab-foss#39979 (closed) also detailed this, but is closed.
Reference internal ticket
Steps to reproduce
- Go to Admin -> Settings -> General.
- Click Expand for Visibility and access controls.
- Change Default snippet visibility to one of the available options.
- Change Restricted visibility levels to match the option set in Default snippet visibility in the previous step.
- Login or impersonate a non admin user.
- Go to
/snippets/new
. - Enter test data.
- Click Create snippet without checking the visibility level. Therefore leaving the radio buttons unchecked.
Example Project
Unable to replicate on GitLab.com. Seems limited to self-managed.
What is the current bug behavior?
When Visibility level radio button is unchecked and Create snippet is clicked while on the page /snippets/new
, an error is displayed in the UI.
The form contains the following error: Author can't be blank
What is the expected correct behavior?
Either the error message should indicate an appropriate error, such as Select a Visibility Level
, or a different radio button should default to checked in that case.
Relevant logs and/or screenshots
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)
Results of GitLab environment info
Expand for output related to GitLab environment info
Environment info from version 12.10.3-ee
.
System information
System: Ubuntu 18.04
Proxy: no
Current User: git
Using RVM: no
Ruby Version: 2.6.5p114
Gem Version: 2.7.10
Bundler Version:1.17.3
Rake Version: 12.3.3
Redis Version: 5.0.7
Git Version: 2.26.2
Sidekiq Version:5.2.7
Go Version: unknown
GitLab information
Version: 12.10.3-ee
Revision: 7c0ab260960
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 11.7
URL: http://x.x.x.x
HTTP Clone URL: http://x.x.x.x/some-group/some-project.git
SSH Clone URL: git@x.x.x.x:some-group/some-project.git
Elasticsearch: no
Geo: yes
Geo node: Primary
Using LDAP: no
Using Omniauth: yes
Omniauth Providers:
GitLab Shell
Version: 12.2.0
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell
Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 12.2.0 ? ... OK (12.2.0)
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Internal API available: OK
Redis available via internal API: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config up to date? ... yes
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory exists? ... yes
Uploads directory has correct permissions? ... yes
Uploads directory tmp has correct permissions? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
Projects have namespace: ...
1/1 ... yes
Redis version >= 4.0.0? ... yes
Ruby version >= 2.5.3 ? ... yes (2.6.5)
Git version >= 2.22.0 ? ... yes (2.26.2)
Git user has default SSH configuration? ... yes
Active users: ... 2
Is authorized keys file accessible? ... yes
Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking Geo ...
GitLab Geo is available ... yes
GitLab Geo is enabled ... yes
This machine's Geo node name matches a database record ... yes, found a primary node named "primary-node-1"
HTTP/HTTPS repository cloning is enabled ... yes
Machine clock is synchronized ... yes
Git user has default SSH configuration? ... yes
OpenSSH configured to use AuthorizedKeysCommand ... no
Reason:
OpenSSH configuration file does not contain a AuthorizedKeysCommand
Try fixing it:
Change your OpenSSH configuration file pointing to the correct command
For more information see:
doc/administration/operations/fast_ssh_key_lookup.md
GitLab configured to disable writing to authorized_keys file ... no
Try fixing it:
You need to disable `Write to authorized_keys file` in GitLab's Admin panel
For more information see:
doc/administration/operations/fast_ssh_key_lookup.md
GitLab configured to store new projects in hashed storage? ... yes
All projects are in hashed storage? ... yes
Checking Geo ... Finished
Checking GitLab subtasks ... Finished