500 error when creating a wiki page
Created by: halfelf
1 Summary:
After I fill the form and click Create Page
button, there is the 500 encoding error.
2 Steps to reproduce:
Wiki -> New Page -> Build with a title -> write sth in the Editing - title
page and Create Page
.
There's no non-ASCII characters in the title and content.
3 Expected behavior:
My project wiki page is successfully created.
4 Observed behavior
The partial view is nothing but:
500
Encoding Error
Page can't be loaded because of an encoding error.
5 Relevant logs and/or screenshots: Please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.
Started GET "/bestminr/bestminr-wiki/wikis/home" for 111.193.227.117 at 2014-04-25 21:13:29 +0800
Processing by Projects::WikisController#show as HTML
Parameters: {"project_id"=>"bestminr/bestminr-wiki", "id"=>"home"}
Completed 200 OK in 297ms (Views: 207.1ms | ActiveRecord: 15.2ms)
Started GET "/bestminr/bestminr-wiki/wikis/test" for 111.193.227.117 at 2014-04-25 21:13:47 +0800
Processing by Projects::WikisController#show as HTML
Parameters: {"project_id"=>"bestminr/bestminr-wiki", "id"=>"test"}
Completed 200 OK in 118ms (Views: 44.8ms | ActiveRecord: 11.1ms)
Started POST "/bestminr/bestminr-wiki/wikis" for 111.193.227.117 at 2014-04-25 21:15:58 +0800
Processing by Projects::WikisController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"KqtlWy8C/rOrmee/ekAES+JK/yQSeHo2m4Ci77w97V4=", "wiki"=>{"title"=>"test", "format"=>"markdown", "content"=>"", "message"=>""}, "project_id"=>"bestminr/bestminr-wiki"}
Completed 200 OK in 118ms (Views: 42.3ms | ActiveRecord: 10.2ms)
Started POST "/bestminr/bestminr-wiki/wikis" for 111.193.227.117 at 2014-04-25 21:16:02 +0800
Processing by Projects::WikisController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"KqtlWy8C/rOrmee/ekAES+JK/yQSeHo2m4Ci77w97V4=", "wiki"=>{"title"=>"test", "format"=>"markdown", "content"=>"d", "message"=>""}, "project_id"=>"bestminr/bestminr-wiki"}
Encoding::CompatibilityError (incompatible character encodings: UTF-8 and ASCII-8BIT):
app/models/project_wiki.rb:77:in `create_page'
app/models/wiki_page.rb:178:in `save'
app/models/wiki_page.rb:139:in `create'
app/controllers/projects/wikis_controller.rb:46:in `create'
app/controllers/application_controller.rb:59:in `set_current_user_for_thread'
Completed 500 Internal Server Error in 362ms (Views: 22.4ms | ActiveRecord: 50.5ms)
6 Output of checks
I am running GitLab 6.8.1, commit 319799073b502392fec9e45d617f566a90bef81e
.
Checking Environment ...
Git configured for git user? ... yes
Checking Environment ... Finished
Checking GitLab Shell ...
GitLab Shell version >= 1.9.3 ? ... OK (1.9.3)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
Satellites access is drwxr-x---? ... yes
update hook up-to-date? ... yes
update hooks in repos are links: ...
Bestminr / BestMinr Wiki ... ok
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/home/git/repositories: OK
/home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.8.8
Send ping to redis server: PONG
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned UsersGroups? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ...
Bestminr / BestMinr Wiki ... yes
Projects have satellites? ...
Bestminr / BestMinr Wiki ... yes
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.9.2)
Checking GitLab ... Finished
System information
System: Ubuntu 12.04
Current User: git
Using RVM: no
Ruby Version: 2.0.0p353
Gem Version: 2.0.14
Bundler Version:1.6.2
Rake Version: 10.1.1
Sidekiq Version:2.17.0
GitLab information
Version: 6.8.1
Revision: 3197990
Directory: /home/git/gitlab
DB Adapter: postgresql
URL: http://gitlab.bestminr.com
HTTP Clone URL: http://gitlab.bestminr.com/some-project.git
SSH Clone URL: [email protected]:some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 1.9.3
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/bin/git