500 error when adding a system hook
Summary
When trying to add a new system hook (via admin/hooks), a 500 error is returned.
Steps to reproduce
- Visit YOUR_URL/admin/hooks
- Enter the URL and secret for your hook.
- Select one or all of the options (error happens whenever a hook is submitted)
What is the current bug behavior?
- 500 error, and hook is not added.
What is the expected correct behavior?
- The hook is added correctly.
Relevant logs and/or screenshots
Error that was logged (redacted some private urls)
==> /var/log/gitlab/postgresql/current <==
2018-02-21_21:43:53.30563 ERROR: null value in column "issues_events" violates not-null constraint
2018-02-21_21:43:53.30565 DETAIL: Failing row contains (26,http://path_to_a_php_file, null, 2018-02-21 21:43:53.30381 6+00, 2018-02-21 21:43:53.303816+00, SystemHook, null, f, null, null, f, f, f, f, 542hhy555xc,, f, f, t, f).
2018-02-21_21:43:53.30565 STATEMENT: INSERT INTO "web_hooks" ("type", "enable_ssl_verification", "push_events", "tag_push_events", "repository_update_ events", "token", "url", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"
==> /var/log/gitlab/gitlab-rails/production_json.log <==
{"method":"POST","path":"/admin/hooks","format":"html","controller":"Admin::HooksController","action":"create","status":500,"error":"ActiveRecord::Stat ementInvalid: PG::NotNullViolation: ERROR: null value in column \"issues_events\" violates not-null constraint\nDETAIL: Failing row contains (26, http://path_to_a_php_file, null, 2018-02-21 21:43:53.303816+00, 2018-02-21 21:43:53.303816+00, SystemHook, null, f, null, null, f, f, f, f, 542hhy555xc,, f, f, t, f).\n: INSERT INTO \"web_hooks\" (\"type\", \"enable_ssl_verification\", \"push_events\", \"tag_push_events\", \"repository_update_events\", \"token\", \"url\", \"created_at\", \"updated_at\") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING \"id\"","durat ion":44.67,"view":0.0,"db":3.8,"time":"2018-02-21T21:43:53.263Z","params":{"utf8":"â","authenticity_token":"[FILTERED]","hook":"[FILTERED]"},"remote_ip ":"174.7.240.83","user_id":2,"username":"wes"}
==> /var/log/gitlab/gitlab-rails/production.log <==
Started POST "/admin/hooks" for 174.7.240.83 at 2018-02-21 14:43:53 -0700
Processing by Admin::HooksController#create as HTML
Parameters: {"utf8"=>"â", "authenticity_token"=>"[FILTERED]", "hook"=>"[FILTERED]"}
Completed 500 Internal Server Error in 44ms (ActiveRecord: 3.8ms)
ActiveRecord::StatementInvalid (PG::NotNullViolation: ERROR: null value in column "issues_events" violates not-null constraint
DETAIL: Failing row contains (26, http://path_to_a_php_file, null, 2018-02-21 21:43:53.303816+00, 2018-02-21 21:43:53. 303816+00, SystemHook, null, f, null, null, f, f, f, f, 542hhy555xc,, f, f, t, f).
: INSERT INTO "web_hooks" ("type", "enable_ssl_verification", "push_events", "tag_push_events", "repository_update_events", "token", "url", "created_at ", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) RETURNING "id"):
config/initializers/active_record_locking.rb:12:in `_create_record'
app/controllers/admin/hooks_controller.rb:14:in `create'
lib/gitlab/i18n.rb:47:in `with_locale'
lib/gitlab/i18n.rb:53:in `with_user_locale'
app/controllers/application_controller.rb:337:in `set_locale'
lib/gitlab/middleware/multipart.rb:93:in `call'
lib/gitlab/request_profiler/middleware.rb:14:in `call'
lib/gitlab/middleware/go.rb:17:in `call'
lib/gitlab/etag_caching/middleware.rb:11:in `call'
lib/gitlab/middleware/read_only.rb:30:in `call'
lib/gitlab/request_context.rb:18:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
Output of checks
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab Shell ...GitLab Shell version >= 5.9.3 ? ... OK (5.9.3) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 14/14 ... ok 14/18 ... ok 19/21 ... ok 19/23 ... ok 11/25 ... ok 14/29 ... ok 19/33 ... ok 13/35 ... ok 13/36 ... ok 14/37 ... ok 11/39 ... ok 14/43 ... ok 14/50 ... ok 11/61 ... ok 14/67 ... ok 16/68 ... ok 16/69 ... ok 26/72 ... ok 26/73 ... ok 16/78 ... ok 14/84 ... ok 14/92 ... ok 14/99 ... ok 12/100 ... ok 15/107 ... ok 18/108 ... ok 14/109 ... ok 15/113 ... ok 16/114 ... ok 12/115 ... ok 15/116 ... ok 1/118 ... ok 18/119 ... ok 1/120 ... ok 22/123 ... repository is empty 14/124 ... ok 36/132 ... ok 14/135 ... ok 18/136 ... ok 40/140 ... ok 14/141 ... ok 26/142 ... ok 44/143 ... ok 45/144 ... ok 15/145 ... ok 11/149 ... ok 15/150 ... ok 45/152 ... ok 16/154 ... ok 14/155 ... ok 14/156 ... ok 15/157 ... ok 14/159 ... ok 14/160 ... ok 14/161 ... ok 11/164 ... ok 14/166 ... ok 53/167 ... ok 14/170 ... ok 14/171 ... ok 14/172 ... ok 13/173 ... ok 13/174 ... ok 14/175 ... ok 40/176 ... ok 14/177 ... ok 12/178 ... repository is empty 15/179 ... ok 14/182 ... ok 37/183 ... ok 37/184 ... repository is empty 37/185 ... ok 12/186 ... ok 14/187 ... ok 12/188 ... ok 14/189 ... ok 16/190 ... ok 16/191 ... ok 11/192 ... ok 45/193 ... ok 14/194 ... ok 14/195 ... ok 14/196 ... ok 18/198 ... ok 18/199 ... ok 14/200 ... ok 11/201 ... ok 16/202 ... ok 14/204 ... ok 53/205 ... ok 45/207 ... ok 18/208 ... ok 14/209 ... ok 14/210 ... ok 57/211 ... ok 16/212 ... ok 58/213 ... ok 14/214 ... ok 53/215 ... ok 16/216 ... ok 58/217 ... ok 58/218 ... ok 25/219 ... ok 61/220 ... ok 53/221 ... ok 16/222 ... ok 16/223 ... ok 57/224 ... ok 14/227 ... ok 14/228 ... ok 11/229 ... ok 11/230 ... ok 14/231 ... ok 53/232 ... ok 11/233 ... ok 16/235 ... ok 16/237 ... ok 15/238 ... ok 58/239 ... ok 14/240 ... ok 14/241 ... ok 14/243 ... ok 65/244 ... ok 58/245 ... ok 14/246 ... ok 14/247 ... ok 45/248 ... ok 14/249 ... ok 14/250 ... ok 14/251 ... ok 16/252 ... ok 14/253 ... repository is empty 58/254 ... ok 14/255 ... ok 11/256 ... ok 11/257 ... ok 30/258 ... ok 15/259 ... ok 11/260 ... ok 11/261 ... ok 30/262 ... ok 14/263 ... ok 26/264 ... ok 26/265 ... ok 65/266 ... ok 11/267 ... ok 15/268 ... ok 27/269 ... ok 14/270 ... ok 22/271 ... ok 14/272 ... ok 11/273 ... ok 65/274 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Reply by email is disabled in config/gitlab.yml Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
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: ... 14/14 ... yes 14/18 ... yes 19/21 ... yes 19/23 ... yes 11/25 ... yes 14/29 ... yes 19/33 ... yes 13/35 ... yes 13/36 ... yes 14/37 ... yes 11/39 ... yes 14/43 ... yes 14/50 ... yes 11/61 ... yes 14/67 ... yes 16/68 ... yes 16/69 ... yes 26/72 ... yes 26/73 ... yes 16/78 ... yes 14/84 ... yes 14/92 ... yes 14/99 ... yes 12/100 ... yes 15/107 ... yes 18/108 ... yes 14/109 ... yes 15/113 ... yes 16/114 ... yes 12/115 ... yes 15/116 ... yes 1/118 ... yes 18/119 ... yes 1/120 ... yes 22/123 ... yes 14/124 ... yes 36/132 ... yes 14/135 ... yes 18/136 ... yes 40/140 ... yes 14/141 ... yes 26/142 ... yes 44/143 ... yes 45/144 ... yes 15/145 ... yes 11/149 ... yes 15/150 ... yes 45/152 ... yes 16/154 ... yes 14/155 ... yes 14/156 ... yes 15/157 ... yes 14/159 ... yes 14/160 ... yes 14/161 ... yes 11/164 ... yes 14/166 ... yes 53/167 ... yes 14/170 ... yes 14/171 ... yes 14/172 ... yes 13/173 ... yes 13/174 ... yes 14/175 ... yes 40/176 ... yes 14/177 ... yes 12/178 ... yes 15/179 ... yes 14/182 ... yes 37/183 ... yes 37/184 ... yes 37/185 ... yes 12/186 ... yes 14/187 ... yes 12/188 ... yes 14/189 ... yes 16/190 ... yes 16/191 ... yes 11/192 ... yes 45/193 ... yes 14/194 ... yes 14/195 ... yes 14/196 ... yes 18/198 ... yes 18/199 ... yes 14/200 ... yes 11/201 ... yes 16/202 ... yes 14/204 ... yes 53/205 ... yes 45/207 ... yes 18/208 ... yes 14/209 ... yes 14/210 ... yes 57/211 ... yes 16/212 ... yes 58/213 ... yes 14/214 ... yes 53/215 ... yes 16/216 ... yes 58/217 ... yes 58/218 ... yes 25/219 ... yes 61/220 ... yes 53/221 ... yes 16/222 ... yes 16/223 ... yes 57/224 ... yes 14/227 ... yes 14/228 ... yes 11/229 ... yes 11/230 ... yes 14/231 ... yes 53/232 ... yes 11/233 ... yes 16/235 ... yes 16/237 ... yes 15/238 ... yes 58/239 ... yes 14/240 ... yes 14/241 ... yes 14/243 ... yes 65/244 ... yes 58/245 ... yes 14/246 ... yes 14/247 ... yes 45/248 ... yes 14/249 ... yes 14/250 ... yes 14/251 ... yes 16/252 ... yes 14/253 ... yes 58/254 ... yes 14/255 ... yes 11/256 ... yes 11/257 ... yes 30/258 ... yes 15/259 ... yes 11/260 ... yes 11/261 ... yes 30/262 ... yes 14/263 ... yes 26/264 ... yes 26/265 ... yes 65/266 ... yes 11/267 ... yes 15/268 ... yes 27/269 ... yes 14/270 ... yes 22/271 ... yes 14/272 ... yes 11/273 ... yes 65/274 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.3 ? ... yes (2.3.5) Git version >= 2.7.3 ? ... yes (2.13.6) Git user has default SSH configuration? ... yes Active users: ... 35
Checking GitLab ... Finished
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 14.04 Current User: git Using RVM: no Ruby Version: 2.3.5p376 Gem Version: 2.6.13 Bundler Version:1.13.7 Rake Version: 12.1.0 Redis Version: 3.2.5 Git Version: 2.13.6 Sidekiq Version:5.0.4 Go Version: unknownGitLab information Version: 10.1.4 Revision: c887c03 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://SOME_URL.com HTTP Clone URL: https://SOME_URL.com/some-group/some-project.git SSH Clone URL: git@SOME_URL.com:some-group/some-project.git Using LDAP: no Using Omniauth: no
GitLab Shell Version: 5.9.3 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git