No. We use UTF-8 with russian lang. This is a gitlab installation from 4.0 version + updates every month to current stable (and this is at first I try 7.4RC instead of 7.3).
I don't know what is the commit it was, but in 7.2.1 all works fine. I'll open DB and look at events table and don't see any problems with commints. There is no any broken symbols or something another problems (I use phpmyadmin with UTF-8 encoding).
Another branches and projects works fine =/ how to find this bad commit? May be you can provide me a debug "echo" string and tell what file I need to edit ?
I can see a dashboard and activity pages with a big number of commits and it's messages. And It works fine, without 500. But when I click Commits - Error 500.
Started GET "/BaBL/intra-portal/commit/d146bd54097eaebf606eb3336e01b3804208144c" for 127.0.0.1 at 2014-10-19 16:34:27 +0400Processing by Projects::CommitController#show as HTMLParameters: {"project_id"=>"BaBL/intra-portal", "id"=>"d146bd54097eaebf606eb3336e01b3804208144c"}Completed 500 Internal Server Error in 281msActionView::Template::Error (invalid byte sequence in UTF-8):52:53: .commit-box54: %h3.commit-title55: = gfm escape_once(@commit.title)56: - if @commit.description.present?57: %pre.commit-description58: = preserve(gfm(escape_once(@commit.description)))app/models/commit.rb:76:in `title'app/views/projects/commit/_commit_box.html.haml:55:in `_app_views_projects_commit__commit_box_html_haml___368493080__575747558'app/views/projects/commit/show.html.haml:1:in `_app_views_projects_commit_show_html_haml___754526429__575695658'app/controllers/projects/commit_controller.rb:27:in `show'Started GET "/admin/logs" for 127.0.0.1 at 2014-10-19 16:34:43 +0400Processing by Admin::LogsController#show as HTML
That's interesting. This commit message shows normal in dashboard activity. With the description and other fields. But not in "Files" view (ajax request with last commits list return 500) and "Commits".
Of cause it would be easier... With a time machine :)
We have many repositories in cp-1251, and I can't find a solution to reencode them without losing history.
This solution
http://stackoverflow.com/questions/11052199/convert-git-repository-file-encoding
didn't work for me - 200mb repo was being processed for two days and did not complete...
We have similar issues at our GitLab after upgrading to version 7.4.3. (previous version was 7.3.2, worked without any problem)
production.log details:
merge request in (utf-8 PHP codebase)
Processing by Projects::MergeRequestsController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"/ovXISAFlGYrPJ7xzcm3K3aLFwjx29INs5Nk804wrTU=", "merge_request"=>{"title"=>"Issue 30047", "description"=>"", "assignee_id"=>"5", "milestone_id"=>"", "label_ids"=>[""], "source_project_id"=>"149", "target_project_id"=>"149", "target_branch"=>"testing", "source_branch"=>"issue-30047"}, "project_id"=>"hungarocontrol/portal"}Completed 500 Internal Server Error in 408msArgumentError (invalid byte sequence in UTF-8): app/models/merge_request_diff.rb:106:in `reload_commits' app/models/merge_request_diff.rb:41:in `reload_content' app/services/merge_requests/create_service.rb:10:in `execute' app/controllers/projects/merge_requests_controller.rb:87:in `create'
graph (same project as above)
Started GET "/hungarocontrol/portal/graphs/develop" for 127.0.0.1 at 2014-11-12 14:22:43 +0100Processing by Projects::GraphsController#show as JSON Parameters: {"project_id"=>"hungarocontrol/portal", "id"=>"develop"}Completed 500 Internal Server Error in 249msJSON::GeneratorError (source sequence is illegal/malformed utf-8): app/controllers/projects/graphs_controller.rb:38:in `fetch_graph' app/controllers/projects/graphs_controller.rb:11:in `block (2 levels) in show' app/controllers/projects/graphs_controller.rb:8:in `show'
file list (same project as above)
Started GET "/hungarocontrol/portal" for 127.0.0.1 at 2014-11-12 14:29:48 +0100Processing by ProjectsController#show as HTML Parameters: {"id"=>"hungarocontrol/portal"}Completed 500 Internal Server Error in 1787msActionView::Template::Error (source sequence is illegal/malformed utf-8): app/views/projects/network/show.json.erb:22:in `_app_views_projects_network_show_json_erb__2276122755674063837_70264692870160'
GitLab CI hook (antoher project with utf-8 PHP codebase)
Started GET "/oh/bmo-portal/services/gitlab_ci/test" for 127.0.0.1 at 2014-11-12 15:30:31 +0100Processing by Projects::ServicesController#test as HTML Parameters: {"project_id"=>"oh/bmo-portal", "id"=>"gitlab_ci"}Completed 500 Internal Server Error in 87msJSON::GeneratorError (source sequence is illegal/malformed utf-8): app/models/hooks/web_hook.rb:35:in `execute' app/models/project_services/gitlab_ci_service.rb:20:in `execute' app/controllers/projects/services_controller.rb:29:in `test'
I wonder if this is related not just to problem that raised this discussion, but to workaround proposed there. We have to use DyadyaMisha's workaround to be able to work with numerous legacy repositories. May be it is this workaround that produces double-encoding somewhere?
Fix given by Aki Tuomi works perfectly except when creating a new merge request :
Started POST "/eddy/overlease/merge_requests" for 84.14.112.108 at 2014-11-28 17:54:48 +0100Processing by Projects::MergeRequestsController#create as HTMLParameters: {"utf8"=>"✓", "authenticity_token"=>"bSKXfwz3PAChJKXwU0y04ojE2z3d4W5wcaZfrOWB1js=", "merge_request"=>{"title"=>"Dev", "description"=>"", "assignee_id"=>"", "milestone_id"=>"", "label_ids"=>[""], "source_project_id"=>"4", "target_project_id"=>"4", "target_branch"=>"recette", "source_branch"=>"dev"}, "project_id"=>"eddy/overlease"}Completed 500 Internal Server Error in 189msArgumentError (invalid byte sequence in UTF-8):app/models/merge_request_diff.rb:105:in `reload_commits'app/models/merge_request_diff.rb:41:in `reload_content'app/services/merge_requests/create_service.rb:10:in `execute'app/controllers/projects/merge_requests_controller.rb:87:in `create'
Started POST "/libri/webshop/merge_requests" for 127.0.0.1 at 2014-11-28 23:01:52 +0100Processing by Projects::MergeRequestsController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"cezypb/76Jui+FdAselYHHJKs8a2T5W6T6ZV8NJHSaQ=", "merge_request"=>{"title"=>"Test merge request", "description"=>"Test merge request", "assignee_id"=>"1", "milestone_id"=>"", "label_ids"=>[""], "source_project_id"=>"50", "target_project_id"=>"50", "target_branch"=>"master", "source_branch"=>"testing"}, "project_id"=>"libri/webshop"}Completed 500 Internal Server Error in 1249msArgumentError (invalid byte sequence in UTF-8): app/models/merge_request_diff.rb:106:in `reload_commits' app/models/merge_request_diff.rb:41:in `reload_content' app/services/merge_requests/create_service.rb:10:in `execute' app/controllers/projects/merge_requests_controller.rb:87:in `create'
Started GET "/some_group/some_project/commits/master" for 189.202.43.223 at 2014-12-17 12:11:01 -0500Processing by Projects::CommitsController#show as HTMLParameters: {"project_id"=>"some_group/some_project", "id"=>"master"}Completed 500 Internal Server Error in 205msActionView::Template::Error (invalid byte sequence in UTF-8):26: = preserve(gfm(escape_once(commit.description)))27:28: .commit-row-info29: = commit_author_link(commit, avatar: true, size: 16)30: .committed_ago31: #{time_ago_with_tooltip(commit.committed_date)} app/helpers/commits_helper.rb:129:in `clean'app/helpers/commits_helper.rb:90:in `commit_person_link'app/helpers/commits_helper.rb:11:in `commit_author_link'app/views/projects/commits/_commit.html.haml:29:in `_app_views_projects_commits__commit_html_haml___146875318618028567_40865480'app/views/projects/commits/_commits.html.haml:10:in `block in _app_views_projects_commits__commits_html_haml___2752154967438722480_41055680'app/views/projects/commits/_commits.html.haml:1:in `each'app/views/projects/commits/_commits.html.haml:1:in `_app_views_projects_commits__commits_html_haml___2752154967438722480_41055680'app/views/projects/commits/show.html.haml:18:in `_app_views_projects_commits_show_html_haml___4219035452165901470_41927420'app/controllers/projects/commits_controller.rb:18:in `show'
I also tried Aki Tuomi's fix but it didn't help.
Currently using ubuntu-14.04/gitlab_7.5.3-omnibus.5.2.1.ci-1_amd64.deb (fresh install)
That fix the commit page, for the network and graph you have to add more "encode("UTF-8", :invalid => :replace, :undef => :replace, :replace => "?")" to app/views/projects/network/show.json.erb and app/controllers/projects/graphs_controller.rb
But i guess that there should be a way to filter that directly from the commit.rb, but i have no idea(neither time to learn atm) how ruby works.
Thanks for your help @josejulio!
It worked perfectly: Graphs, Network and Commits Page.
Continue with error File and Project Pages,
follows the logs:
File Page
Started GET "/dides/protocolo/tree/master" for 127.0.0.1 at 2014-12-24 10:21:37 -0400Processing by Projects::TreeController#show as HTML Parameters: {"project_id"=>"dides/protocolo", "id"=>"master"}Completed 500 Internal Server Error in 66msArgumentError (invalid byte sequence in UTF-8): app/models/tree.rb:11:in `select' app/models/tree.rb:11:in `initialize' app/models/repository.rb:208:in `new' app/models/repository.rb:208:in `tree' lib/extracts_path.rb:120:in `tree' app/controllers/projects/tree_controller.rb:5:in `show'
Project Page:
Started GET "/dides/protocolo" for 127.0.0.1 at 2014-12-24 10:22:26 -0400Processing by ProjectsController#show as HTML Parameters: {"id"=>"dides/protocolo"}Completed 500 Internal Server Error in 676msActionView::Template::Error (invalid byte sequence in UTF-8): 1: = render "home_panel" 2: 3: - readme = @repository.readme 4: %ul.nav.nav-tabs 5: %li.active 6: = link_to '#tab-activity', 'data-toggle' => 'tab' do app/models/tree.rb:11:in `select' app/models/tree.rb:11:in `initialize' app/models/repository.rb:208:in `new' app/models/repository.rb:208:in `tree' app/models/repository.rb:181:in `block in readme' app/models/repository.rb:180:in `readme' app/views/projects/show.html.haml:3:in `_app_views_projects_show_html_haml___856554287892327550_56563820' app/controllers/projects_controller.rb:69:in `block (2 levels) in show' app/controllers/projects_controller.rb:62:in `show'
I've got a similar issue in 7.7, the page listing commits fails for every branches :
Completed 500 Internal Server Error in 910ms (Views: 54.1ms | ActiveRecord: 21.3ms)Started GET "/xxx-group/xxx-project/commits/develop" for 127.0.0.1 at 2015-01-23 10:21:39 +0100Processing by Projects::CommitsController#show as HTML Parameters: {"project_id"=>"xxx-group/xxx-project", "id"=>"develop"}Encoding::CompatibilityError (incompatible character encodings: ASCII-8BIT and UTF-8): app/views/projects/commits/show.html.haml:19:in `_app_views_projects_commits_show_html_haml__467970287784325918_70217518263740' app/controllers/projects/commits_controller.rb:18:in `show'Completed 500 Internal Server Error in 745ms (Views: 53.4ms | ActiveRecord: 19.0ms)
I've tried everything that you guys listed here and it doesn't work.
As I don't know anything on Ruby, nor RoR, I don't know where to look to find what's causing this 500.
I can't find neither what's the commit doing this.
Every other pages works fines except the one listing commit.
I got a tag with accent in its name and it made crashed the view for the commit page list. Oddly it didn't made crash the tag page but only the page where the tag was.
I got same issue even upgraded to v7.9.1 6f6c5f18 . Got one commit having this encoding issue , within the commit it includes ^M character . Is this be considering in the fix ?
I got really big diff list , I can't show it here , the commit include some binary char in some key file as well as windows line break char ^M , but when I test a small commit with ^M char, it looks fine , when I test commit with below binary char ,it shows No preview for this file type , whcih is good .
I can't reproduce the issue with new commit in 6.9.1 , but as I migrate from 6.3.2 , after updated to 6.9.1 and try to view the previous commit it shows 500 encoding error .
@yikaus Are you sure the error message you're seeing is the same as in the issue description? Down to the app/models/commit.rb:76:in 'title' line in the stack trace?