got 500 error when saving wiki page with chinese character in a project with "Wiki Page events" webhook in gitlab 11.1.2
Summary
I got 500 error when saving wiki page with chinese character in a project with "Wiki Page events" webhook
Steps to reproduce
The bug can be reproduce in Gitlab 11.1.2. ( may be in any Gitlab 11.x)
- chose any project and goto the project integrations setting page.
- add a webhook and select trigger "Wiki Page events".
- any webhook URL even non-exists URL such as "http://example.com/test.json" can reproduce the bug.
- after added the webhook, goto wiki page.
- create a new page and input some Chinese character, such as "你好"
- save the page, and you will get a 500 ERROR
Example Project
https://gitlab.com/oylbin/test/
What is the current bug behavior?
I got a 500 error.
What is the expected correct behavior?
No error should be occurred.
Relevant logs and/or screenshots
part of production.log
Started PUT "/Owen/gitlab-analytics/wikis/home" for 172.16.146.114 at 2018-07-25 12:06:25 +0800
Processing by Projects::WikisController#update as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "wiki"=>{"last_commit_sha"=>"2fe422f4ac63ef8043c6d5f44cc058ea50b5cd4d", "title"=>"home", "format"=>"markdown", "content"=>"[FILTERED]", "message"=>"Update home"}, "namespace_id"=>"Owen", "project_id"=>"gitlab-analytics", "id"=>"home"}
Started POST "/api/v4/internal/allowed" for 127.0.0.1 at 2018-07-25 12:06:25 +0800
Started POST "/api/v4/internal/pre_receive" for 127.0.0.1 at 2018-07-25 12:06:25 +0800
Started POST "/api/v4/internal/post_receive" for 127.0.0.1 at 2018-07-25 12:06:25 +0800
Completed 500 Internal Server Error in 320ms (ActiveRecord: 3.4ms)
Encoding::UndefinedConversionError ("\xE6" from ASCII-8BIT to UTF-8):
config/initializers/forbid_sidekiq_in_transactions.rb:35:in `block (2 levels) in <module:NoEnqueueingFromTransactions>'
app/services/web_hook_service.rb:63:in `async_execute'
app/models/hooks/web_hook.rb:16:in `async_execute'
app/models/project.rb:1122:in `block (2 levels) in execute_hooks'
app/models/project.rb:1121:in `block in execute_hooks'
lib/after_commit_queue.rb:27:in `instance_eval'
lib/after_commit_queue.rb:27:in `run_after_commit_or_now'
app/models/project.rb:1120:in `execute_hooks'
app/services/wiki_pages/base_service.rb:7:in `execute_hooks'
app/services/wiki_pages/update_service.rb:5:in `execute'
app/controllers/projects/wikis_controller.rb:48:in `update'
lib/gitlab/i18n.rb:51:in `with_locale'
lib/gitlab/i18n.rb:57:in `with_user_locale'
app/controllers/application_controller.rb:362:in `set_locale'
lib/gitlab/middleware/multipart.rb:97: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/controller.rb:38:in `call'
lib/gitlab/middleware/read_only.rb:16:in `call'
lib/gitlab/request_context.rb:18:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
lib/gitlab/middleware/release_env.rb:10:in `call'
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Current User: git Using RVM: no Ruby Version: 2.4.4p296 Gem Version: 2.7.6 Bundler Version:1.16.2 Rake Version: 12.3.1 Redis Version: 3.2.11 Git Version: 2.17.1 Sidekiq Version:5.1.3 Go Version: unknown
GitLab information Version: 11.1.2 Revision: 35936b0 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://git.youle.game HTTP Clone URL: https://git.youle.game/some-group/some-project.git SSH Clone URL: git@git.youle.game:some-group/some-project.git Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 7.1.4 Repository storage paths:
- default: /data/gitlab/repositories
- storage1: /data/gitlab/storage1/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab Shell ...
GitLab Shell version >= 7.1.4 ? ... OK (7.1.4) Repo base directory exists? default... yes storage1... yes Repo storage directories are symlinks? default... no storage1... no Repo paths owned by git:root, or git:git? default... yes storage1... yes Repo paths access is drwxrws---? default... yes storage1... yes hooks directories in repos are links: ... 3/19 ... ok 22/22 ... ok 23/24 ... ok 23/28 ... ok 23/29 ... ok 23/30 ... ok 24/31 ... ok 25/32 ... ok 26/33 ... ok 28/34 ... ok 29/35 ... ok 21/45 ... ok 253/54 ... ok 253/55 ... ok 253/56 ... ok 51/62 ... ok 52/64 ... ok 51/65 ... ok 250/66 ... ok 52/67 ... ok 52/68 ... ok 254/70 ... ok 3/71 ... ok 50/72 ... repository is empty 41/73 ... ok 22/75 ... ok 253/76 ... ok 55/77 ... ok 55/78 ... ok 55/80 ... ok 55/81 ... ok 55/82 ... ok 41/83 ... ok 41/84 ... repository is empty 63/85 ... ok 7/86 ... ok 52/87 ... ok 52/88 ... ok 56/89 ... ok 19/90 ... ok 284/94 ... ok 253/96 ... ok 284/97 ... ok 284/98 ... ok 103/99 ... ok 284/100 ... ok 284/101 ... ok 284/103 ... ok 52/105 ... ok 63/107 ... repository is empty 284/108 ... ok 284/109 ... ok 284/110 ... ok 284/111 ... ok 284/112 ... ok 284/113 ... ok 284/114 ... ok 284/115 ... ok 284/116 ... ok 284/117 ... ok 103/118 ... ok 284/120 ... ok 284/121 ... ok 284/122 ... ok 51/123 ... ok 284/124 ... ok 117/127 ... ok 117/128 ... ok 284/131 ... ok 52/135 ... ok 102/136 ... ok 102/138 ... ok 102/139 ... ok 102/140 ... ok 52/141 ... ok 52/142 ... ok 52/143 ... ok 52/144 ... ok 284/145 ... ok 111/146 ... ok 284/149 ... ok 284/150 ... ok 253/151 ... ok 116/154 ... ok 102/157 ... ok 125/158 ... repository is empty 284/159 ... ok 8/161 ... ok 284/163 ... ok 8/164 ... ok 284/165 ... ok 117/167 ... ok 117/169 ... ok 284/170 ... ok 117/172 ... ok 117/173 ... ok 117/174 ... ok 117/175 ... repository is empty 287/177 ... ok 284/179 ... ok 52/181 ... ok 287/182 ... ok 284/183 ... ok 284/184 ... ok 143/185 ... repository is empty 56/186 ... ok 284/187 ... repository is empty 284/188 ... ok 284/189 ... ok 284/191 ... ok 284/192 ... ok 284/193 ... ok 284/194 ... ok 154/200 ... ok 284/201 ... ok 154/202 ... ok 284/210 ... ok 285/211 ... ok 285/212 ... ok 285/213 ... ok 285/217 ... ok 285/218 ... ok 285/219 ... ok 154/220 ... ok 154/221 ... ok 285/222 ... ok 180/224 ... repository is empty 186/227 ... ok 213/228 ... repository is empty 253/229 ... ok 253/230 ... ok 253/231 ... ok 287/232 ... ok 120/235 ... ok 213/238 ... ok 194/239 ... ok 120/241 ... ok 371/242 ... repository is empty 199/243 ... repository is empty 287/245 ... ok 287/246 ... ok 287/247 ... ok 199/248 ... repository is empty 275/249 ... repository is empty 267/250 ... ok 290/251 ... repository is empty 41/252 ... ok 210/255 ... ok 208/256 ... ok 210/257 ... repository is empty 208/258 ... ok 211/260 ... repository is empty 163/261 ... ok 163/262 ... ok 208/266 ... ok 216/267 ... ok 220/269 ... ok 227/273 ... ok 285/275 ... ok 285/276 ... ok 227/278 ... repository is empty 196/279 ... ok 216/282 ... ok 216/283 ... ok 217/284 ... repository is empty 237/285 ... repository is empty 241/286 ... repository is empty 253/288 ... ok 287/289 ... ok 251/297 ... ok 251/298 ... ok 254/299 ... ok 254/300 ... repository is empty 254/301 ... ok 252/303 ... ok 254/306 ... ok 199/307 ... ok 270/309 ... repository is empty 194/310 ... ok 255/314 ... ok 255/315 ... ok 255/316 ... ok 253/317 ... ok 186/318 ... repository is empty 274/319 ... repository is empty 267/320 ... ok 287/321 ... ok 253/323 ... ok 255/325 ... ok 284/326 ... repository is empty 143/327 ... repository is empty 287/328 ... ok 253/330 ... ok 247/331 ... ok 284/332 ... repository is empty 254/333 ... ok 287/343 ... ok 287/344 ... ok 287/345 ... ok 287/346 ... ok 287/347 ... ok 279/348 ... repository is empty 292/354 ... repository is empty 255/355 ... ok 120/356 ... ok 285/358 ... ok 286/359 ... ok 287/360 ... ok 284/361 ... ok 259/362 ... repository is empty 309/363 ... repository is empty 199/364 ... ok 292/365 ... repository is empty 292/366 ... repository is empty 293/368 ... repository is empty 294/369 ... repository is empty 295/370 ... repository is empty 296/371 ... repository is empty 297/372 ... repository is empty 298/373 ... repository is empty 21/374 ... ok 120/376 ... ok 279/377 ... repository is empty 210/378 ... ok 210/379 ... ok 268/380 ... ok 310/381 ... repository is empty 287/383 ... ok 284/384 ... ok 287/385 ... ok 287/386 ... ok 254/388 ... repository is empty 287/390 ... repository is empty 286/393 ... repository is empty 323/394 ... ok 255/395 ... ok 282/396 ... repository is empty 254/397 ... ok 285/398 ... repository is empty 285/399 ... repository is empty 285/400 ... repository is empty 151/401 ... ok 151/402 ... ok 194/403 ... repository is empty 189/404 ... ok 335/407 ... ok 253/408 ... ok 157/409 ... ok 164/410 ... ok 164/411 ... ok 164/412 ... ok 63/413 ... ok 213/416 ... ok 21/417 ... ok 51/419 ... ok 213/420 ... ok 164/421 ... ok 164/422 ... ok 164/423 ... ok 164/424 ... ok 3/425 ... repository is empty 284/428 ... ok 130/429 ... ok 352/431 ... repository is empty 353/432 ... repository is empty 164/433 ... ok 354/434 ... repository is empty 354/435 ... repository is empty 355/436 ... repository is empty 355/437 ... repository is empty 356/438 ... repository is empty 357/439 ... repository is empty 358/440 ... repository is empty 253/441 ... ok 284/442 ... ok 285/443 ... ok 285/444 ... repository is empty 7/445 ... ok 303/446 ... repository is empty 151/447 ... ok 360/448 ... repository is empty 117/449 ... repository is empty 365/450 ... repository is empty 366/451 ... repository is empty 367/452 ... repository is empty 368/453 ... repository is empty 372/454 ... repository is empty 272/455 ... ok 375/457 ... repository is empty 79/459 ... ok 16/460 ... ok 361/461 ... repository is empty 287/462 ... ok 209/463 ... ok 287/466 ... repository is empty 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 ...
Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results)
...HIDE...PRIVATE...LDAP...INFORMATION...
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: ... 3/19 ... yes 22/22 ... yes 23/24 ... yes 23/28 ... yes 23/29 ... yes 23/30 ... yes 24/31 ... yes 25/32 ... yes 26/33 ... yes 28/34 ... yes 29/35 ... yes 21/45 ... yes 253/54 ... yes 253/55 ... yes 253/56 ... yes 51/62 ... yes 52/64 ... yes 51/65 ... yes 250/66 ... yes 52/67 ... yes 52/68 ... yes 254/70 ... yes 3/71 ... yes 50/72 ... yes 41/73 ... yes 22/75 ... yes 253/76 ... yes 55/77 ... yes 55/78 ... yes 55/80 ... yes 55/81 ... yes 55/82 ... yes 41/83 ... yes 41/84 ... yes 63/85 ... yes 7/86 ... yes 52/87 ... yes 52/88 ... yes 56/89 ... yes 19/90 ... yes 284/94 ... yes 253/96 ... yes 284/97 ... yes 284/98 ... yes 103/99 ... yes 284/100 ... yes 284/101 ... yes 284/103 ... yes 52/105 ... yes 63/107 ... yes 284/108 ... yes 284/109 ... yes 284/110 ... yes 284/111 ... yes 284/112 ... yes 284/113 ... yes 284/114 ... yes 284/115 ... yes 284/116 ... yes 284/117 ... yes 103/118 ... yes 284/120 ... yes 284/121 ... yes 284/122 ... yes 51/123 ... yes 284/124 ... yes 117/127 ... yes 117/128 ... yes 284/131 ... yes 52/135 ... yes 102/136 ... yes 102/138 ... yes 102/139 ... yes 102/140 ... yes 52/141 ... yes 52/142 ... yes 52/143 ... yes 52/144 ... yes 284/145 ... yes 111/146 ... yes 284/149 ... yes 284/150 ... yes 253/151 ... yes 116/154 ... yes 102/157 ... yes 125/158 ... yes 284/159 ... yes 8/161 ... yes 284/163 ... yes 8/164 ... yes 284/165 ... yes 117/167 ... yes 117/169 ... yes 284/170 ... yes 117/172 ... yes 117/173 ... yes 117/174 ... yes 117/175 ... yes 287/177 ... yes 284/179 ... yes 52/181 ... yes 287/182 ... yes 284/183 ... yes 284/184 ... yes 143/185 ... yes 56/186 ... yes 284/187 ... yes 284/188 ... yes 284/189 ... yes 284/191 ... yes 284/192 ... yes 284/193 ... yes 284/194 ... yes 154/200 ... yes 284/201 ... yes 154/202 ... yes 284/210 ... yes 285/211 ... yes 285/212 ... yes 285/213 ... yes 285/217 ... yes 285/218 ... yes 285/219 ... yes 154/220 ... yes 154/221 ... yes 285/222 ... yes 180/224 ... yes 186/227 ... yes 213/228 ... yes 253/229 ... yes 253/230 ... yes 253/231 ... yes 287/232 ... yes 120/235 ... yes 213/238 ... yes 194/239 ... yes 120/241 ... yes 371/242 ... yes 199/243 ... yes 287/245 ... yes 287/246 ... yes 287/247 ... yes 199/248 ... yes 275/249 ... yes 267/250 ... yes 290/251 ... yes 41/252 ... yes 210/255 ... yes 208/256 ... yes 210/257 ... yes 208/258 ... yes 211/260 ... yes 163/261 ... yes 163/262 ... yes 208/266 ... yes 216/267 ... yes 220/269 ... yes 227/273 ... yes 285/275 ... yes 285/276 ... yes 227/278 ... yes 196/279 ... yes 216/282 ... yes 216/283 ... yes 217/284 ... yes 237/285 ... yes 241/286 ... yes 253/288 ... yes 287/289 ... yes 251/297 ... yes 251/298 ... yes 254/299 ... yes 254/300 ... yes 254/301 ... yes 252/303 ... yes 254/306 ... yes 199/307 ... yes 270/309 ... yes 194/310 ... yes 255/314 ... yes 255/315 ... yes 255/316 ... yes 253/317 ... yes 186/318 ... yes 274/319 ... yes 267/320 ... yes 287/321 ... yes 253/323 ... yes 255/325 ... yes 284/326 ... yes 143/327 ... yes 287/328 ... yes 253/330 ... yes 247/331 ... yes 284/332 ... yes 254/333 ... yes 287/343 ... yes 287/344 ... yes 287/345 ... yes 287/346 ... yes 287/347 ... yes 279/348 ... yes 292/354 ... yes 255/355 ... yes 120/356 ... yes 285/358 ... yes 286/359 ... yes 287/360 ... yes 284/361 ... yes 259/362 ... yes 309/363 ... yes 199/364 ... yes 292/365 ... yes 292/366 ... yes 293/368 ... yes 294/369 ... yes 295/370 ... yes 296/371 ... yes 297/372 ... yes 298/373 ... yes 21/374 ... yes 120/376 ... yes 279/377 ... yes 210/378 ... yes 210/379 ... yes 268/380 ... yes 310/381 ... yes 287/383 ... yes 284/384 ... yes 287/385 ... yes 287/386 ... yes 254/388 ... yes 287/390 ... yes 286/393 ... yes 323/394 ... yes 255/395 ... yes 282/396 ... yes 254/397 ... yes 285/398 ... yes 285/399 ... yes 285/400 ... yes 151/401 ... yes 151/402 ... yes 194/403 ... yes 189/404 ... yes 335/407 ... yes 253/408 ... yes 157/409 ... yes 164/410 ... yes 164/411 ... yes 164/412 ... yes 63/413 ... yes 213/416 ... yes 21/417 ... yes 51/419 ... yes 213/420 ... yes 164/421 ... yes 164/422 ... yes 164/423 ... yes 164/424 ... yes 3/425 ... yes 284/428 ... yes 130/429 ... yes 352/431 ... yes 353/432 ... yes 164/433 ... yes 354/434 ... yes 354/435 ... yes 355/436 ... yes 355/437 ... yes 356/438 ... yes 357/439 ... yes 358/440 ... yes 253/441 ... yes 284/442 ... yes 285/443 ... yes 285/444 ... yes 7/445 ... yes 303/446 ... yes 151/447 ... yes 360/448 ... yes 117/449 ... yes 365/450 ... yes 366/451 ... yes 367/452 ... yes 368/453 ... yes 372/454 ... yes 272/455 ... yes 375/457 ... yes 79/459 ... yes 16/460 ... yes 361/461 ... yes 287/462 ... yes 209/463 ... yes 287/466 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.4.4) Git version >= 2.9.5 ? ... yes (2.17.1) Git user has default SSH configuration? ... yes Active users: ... 255
Checking GitLab ... Finished