New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incompatible character encodings: UTF-8 and ASCII-8BIT #843

Closed
schmunk42 opened this Issue Jul 28, 2014 · 30 comments

Comments

Projects
None yet
@schmunk42
Copy link

schmunk42 commented Jul 28, 2014

I am having the following error, when editing pages via gollum, which were modified with an editor (PHPstorm or Mou) and pushed back into the wiki repo - and there as usually located two levels (folders) below root.

Encoding::CompatibilityError at /edit/my-page
incompatible character encodings: UTF-8 and ASCII-8BIT

file: index.rb location: % line: 176

I've looked through several encoding issues I've found here. And came to the conclusion, that this is an error with grit (fork from gitlab).

I've tried different version of ruby (1.9.3, 2.1.2) and gollum (2.1.0, 2.5.0, 3.0.0) to fix the problem, but the only way (for me) to work around this issue, was modifiying this line to:

tree_contents[k] = "%s %s\0%s" % [tmode, obj.name.force_encoding('ASCII-8BIT'), sha]

Which does not really look right to me.
Is there any way to fix this in gollum or even via config.rb?

Error Stacktrace:

localhost - - [28/Jul/2014:19:31:17 CEST] "GET /javascript/editor/langs/markdown.js?_=1406568677805 HTTP/1.1" 200 11837
http://localhost:4567/edit/intern/orga/my-page -> /javascript/editor/langs/markdown.js?_=1406568677805
Encoding::CompatibilityError - incompatible character encodings: UTF-8 and ASCII-8BIT:
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:176:in `%'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:176:in `block in write_tree'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:171:in `each'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:171:in `write_tree'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:198:in `block in write_tree'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:180:in `each'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:180:in `write_tree'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:198:in `block in write_tree'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:180:in `each'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:180:in `write_tree'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/gitlab-grit-2.6.7/lib/grit/index.rb:123:in `commit'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/gollum-lib-3.0.0/lib/gollum-lib/committer.rb:170:in `commit'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/gollum-3.0.0/lib/gollum/app.rb:248:in `block in <class:App>'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `block in compile!'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (3 levels) in route!'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in `route_eval'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (2 levels) in route!'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in `block in process_route'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `catch'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `process_route'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block in route!'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `each'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `route!'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1076:in `block in dispatch!'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1073:in `dispatch!'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `block in call!'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `call!'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/show_exceptions.rb:21:in `call'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'
    /opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
    /opt/local/lib/ruby1.9/1.9.1/webrick/httpserver.rb:138:in `service'
    /opt/local/lib/ruby1.9/1.9.1/webrick/httpserver.rb:94:in `run'
    /opt/local/lib/ruby1.9/1.9.1/webrick/server.rb:191:in `block in start_thread'
@thelinuxlich

This comment has been minimized.

Copy link

thelinuxlich commented Aug 11, 2014

+1 for this!

@thelinuxlich

This comment has been minimized.

Copy link

thelinuxlich commented Aug 11, 2014

Would this work? https://github.com/gitlabhq/grit_ext

Apparently is a extension to gitlab grit which adds utf8 support

@schmunk42

This comment has been minimized.

Copy link
Author

schmunk42 commented Aug 11, 2014

Umm, I can't retest this at the moment, but could you try to wrap gollum into rack, like described here and see if the error goes away.

@dometto

This comment has been minimized.

Copy link
Member

dometto commented Oct 26, 2014

@thelinuxlich does the workaround proposed by @schmunk42 work? Otherwise, we would certainly appreciate a PR adding grit_ext to https://github.com/gollum/grit_adapter (our own priorities lie with moving away from grit alltogether).

@sssfff

This comment has been minimized.

Copy link

sssfff commented Oct 28, 2014

I can confirm that the work-around mentioned by @schmunk42 (edit line 176 in grit/index.rb) is working well. This solved my UTF-8 encoding problem.

Thanks!

@bartkamphorst

This comment has been minimized.

Copy link
Member

bartkamphorst commented Nov 3, 2014

@schmunk42 @sssfff @thelinuxlich Could any of you test whether this issue still persists with gollum & gollum-lib's rc branches and grit_adapter v.0.0.2 (which now uses gitlab-grit v.2.7.1 instead of 2.6.5)?

@dometto

This comment has been minimized.

Copy link
Member

dometto commented Nov 3, 2014

A regression test for this issue in gollum-lib would be useful anyway so we can make sure that alternative adapters don't break this in the future.

@bartkamphorst

This comment has been minimized.

Copy link
Member

bartkamphorst commented Nov 3, 2014

Yes, but judging from @schmunk42's original problem description, a regression test might be tricky to come up with:

I am having the following error, when editing pages via gollum, which were modified with an editor (PHPstorm or Mou) and pushed back into the wiki repo - and there as usually located two levels (folders) below root.

But I agree that it would be very helpful to have.

@dometto dometto added the bug label Nov 4, 2014

@datenzauberer

This comment has been minimized.

Copy link

datenzauberer commented Nov 9, 2014

This workaround saved my day. Many thanks @schmunk42

@CheneyWong

This comment has been minimized.

Copy link

CheneyWong commented Nov 23, 2014

+1 for this and thanks @schmunk42

@CheneyWong

This comment has been minimized.

Copy link

CheneyWong commented Nov 24, 2014

and a similar problem : #830

@bartkamphorst

This comment has been minimized.

Copy link
Member

bartkamphorst commented Nov 24, 2014

@ChanNew We are aware of the issues and their relatedness. What's unclear to me at the moment is whether this issue (or these issues) still persists (in the same form) with gollum & gollum-lib's rc branches (v. 4.0 and v. 3.1 respectively) and grit_adapter v.0.0.2 (which now uses gitlab-grit v.2.7.1 instead of 2.6.5). Would you be willing to test that? Also, having a good test case as @dometto suggested would be a helpful step towards a solution. Thanks.

@bennibu

This comment has been minimized.

Copy link

bennibu commented Dec 3, 2014

@bartkamphorst I can confirm this issue. We use gollum 3.1.0 (gollum-lib 4.0.0, gitlab-grit 2.7.2, ruby 2.0.0). The manuall patch for gitlab-grit from @schmunk42 works fine.

The test case is hard. We stumbled upon the problem when adding a page under the path /SSL_Zertifikate. So we are not using any non ascii characters here.

@schmunk42

This comment has been minimized.

Copy link
Author

schmunk42 commented Dec 3, 2014

@bennibu We're experiencing a similar issue, we also have a lot of German Umlauts in our markdown docs, but they are not the problem. I can create new pages on the root level with contents from another page eg. /two/levels/deep.md which fails when updating.
So I thought I there may be also problem in the URLs with the /, but I can't reproduce it also.

Another thing which I haven't investigated too deeply are the locales (ENV vars) - do they affect Ruby or Rack?

PS: I tried to migrate our wiki to the latest version in a Docker container, here's the WIP Code - maybe we could create a reproduceable test case with it.

@happymenu

This comment has been minimized.

Copy link

happymenu commented Dec 4, 2014

thanks @schmunk42 , you saved my 1 hour!

schmunk42 added a commit to hrzg/docker-gollum that referenced this issue Dec 8, 2014

@dometto

This comment has been minimized.

Copy link
Member

dometto commented Jan 3, 2015

@schmunk42 gollum@HEAD can now use the new gollum-rugged_adapter gem (beta). It would be great to know if that solves this issue (although the adapter needs more refactoring and testing before being production ready, it is almost fully functional). Steps to do this:

  1. clone gollum@master
  2. Add gollum-rugged_adapter to the Gemfile and bundle install
  3. bundle exec gollum --adapter rugged
@dometto

This comment has been minimized.

Copy link
Member

dometto commented Jan 3, 2015

I've managed to reproduce this myself, and can confirm that the problem is gone when using the rugged adapter. We will not be able to solve this issue when using the grit adapter (unless someone wants to fix the underlying issue in gitlab_grit), so @schmunk42's workaround is all we can offer for that use case. The rugged adapter is still in beta, but almost fully functional -- please check it out if you are suffering from unicode problems.

@dometto dometto closed this Jan 3, 2015

@schmunk42

This comment has been minimized.

Copy link
Author

schmunk42 commented Jan 4, 2015

@dometto I am using gem and rackup in my Docker setup, could you guide me how to add rugged there?

@dometto

This comment has been minimized.

Copy link
Member

dometto commented Jan 4, 2015

I have no experience with docker, but looking at your setup I imagine something like:

EDIT: You need:

RUN gem install --no-ri --no-rdoc --pre \
    gollum-rugged_adapter

and in config.ru, before you require gollum/app:

module Gollum
  Gollum::GIT_ADAPTER = "rugged"
end

If you want to test that you're actually using the rugged adapter, it should through a LoadError when you manually uninstall the gollum-rugged_adapter gem. There's currently no way of testing this from within the webapp.

P.S. If you're interested, gollum now has a contrib directory to which your Docker setup could be added.

@bennibu

This comment has been minimized.

Copy link

bennibu commented Jan 5, 2015

@dometto Thanks for the new adapter. It seems to work fine on my ubuntu 14.04. But when I deploy on my server (debian squeeze, git 1.7.10.4) I got a the error Rugged::ConfigError: Config value 'user.name' was not found when creating a new wiki page. I can't reproduce this error on my local machine (ubuntu 14.04), but as the git version differs I assume this is related? Any Idea?

@dometto

This comment has been minimized.

Copy link
Member

dometto commented Jan 5, 2015

@bennibu: Rugged is based on libgit2 and doesn't require the presence of a git binary on the system, so git version should be irrelevant. Maybe the debian system has an older version of libgit2? (although I think libgit2 should be compiled when installing the rugged gem)

@schmunk42

This comment has been minimized.

Copy link
Author

schmunk42 commented Jan 6, 2015

@dometto Thanks for the advice and notice about the contrib section. Will check that.

nsmith added a commit to winkapp/docker-gollum that referenced this issue Aug 5, 2015

Enable rugged as an alternative backend to grit
Grit seems to be no longer maintained, and using it with new versions of Ruby causes encoding errors.

Rugged is in beta right now, but both rugged and grit can co-exist, letting the user of the container specify which backend he/she would like to use.

There is a temporary hack in here that builds the gitlab-grit gem directly from the repo instead of pulling from rubygems. The reason is that there is a conflict in the mime-types dependency between grit and rugged. There is a merged PR that updates the dependency on grit, but the new version has not been pushed to rubygems (see gitlabhq/grit#53). Once the new version is on rubygems, we can simply add the gem to the gemfile instead of building from the repo.

For context on the original issue that caused the move from grit, see this issue: gollum/gollum#843
@tnt

This comment has been minimized.

Copy link

tnt commented Nov 10, 2015

Exactly this error occurs when the directory contains a file with non-ascii characters in the name. To reproduce this the following should work:

$ echo "# Just Nothing" > blöd.md
$ git add blöd.md
$ git commit

If you now try to save an arbitrary file from the Gollum front-end you should get the error.

@bartkamphorst

This comment has been minimized.

Copy link
Member

bartkamphorst commented Nov 10, 2015

Which adapter are you using @tnt ?

@bartkamphorst

This comment has been minimized.

Copy link
Member

bartkamphorst commented Nov 10, 2015

I got a the error Rugged::ConfigError: Config value 'user.name' was not found when creating a new wiki page.

BTW, @bennibu This was traced in issue gollum/rugged_adapter#11 and has been addressed by jhominal/rugged_adapter@10b6da7 .

@tnt

This comment has been minimized.

Copy link

tnt commented Nov 10, 2015

@bartkamphorst gitlab-grit?

edit I switched to rugged and now everything works fine with utf-8 file names! This should be the default.

@edusantana

This comment has been minimized.

Copy link

edusantana commented Jan 4, 2017

Using gollum-rugged_adapter worked for me, it requires cmake to build:

sudo apt-get install cmake
sudo gem install gollum-rugged_adapter
gollum --adapter rugged

After that, it worked without the error.

@wangluzhou

This comment has been minimized.

Copy link

wangluzhou commented Sep 3, 2017

@edusantana Thanks! It works. but it just succeeded at a sudden. I remember in the early I input thw command

gollum --port 4567 --adapter rugged 

It gives me the error info below:

/Users/luke/.bundle/gems/gollum-lib-4.2.7/lib/gollum-lib.rb:11:in `require': cannot load such file -- rugged_adapter (LoadError)
	from /Users/luke/.bundle/gems/gollum-lib-4.2.7/lib/gollum-lib.rb:11:in `<top (required)>'
	from /Users/luke/.bundle/bundler/gems/gollum-6de0914788e2/lib/gollum/app.rb:4:in `require'
	from /Users/luke/.bundle/bundler/gems/gollum-6de0914788e2/lib/gollum/app.rb:4:in `<top (required)>'
	from /Users/luke/.bundle/bundler/gems/gollum-6de0914788e2/bin/gollum:242:in `require'
	from /Users/luke/.bundle/bundler/gems/gollum-6de0914788e2/bin/gollum:242:in `<top (required)>'
	from /Users/luke/.rvm/gems/ruby-2.4.0/bin/gollum:23:in `load'
	from /Users/luke/.rvm/gems/ruby-2.4.0/bin/gollum:23:in `<main>'
	from /Users/luke/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `eval'
	from /Users/luke/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `<main>'

It is really confusing me, but I can not remember what I have done to make the error disappear.

@runech

This comment has been minimized.

Copy link

runech commented Jun 9, 2018

I added the rugged-adapter and this problem disappeared.
Insted, sarch, which worked earlier, now fails with "invalid byte sequence in UTF-8"

@fhwedel-hoe

This comment has been minimized.

Copy link

fhwedel-hoe commented Jul 5, 2018

With the rugged adapter, file upload works as @runech describes. Search does not. For a wiki, this is a major inconvenience. I am on 64bit Ubuntu 16.04.4 LTS.

Installed gems:

*** LOCAL GEMS ***

afm (0.2.2)
Ascii85 (1.0.2)
asciidoctor (1.5.4)
bigdecimal (1.2.8)
blankslate (3.1.3)
builder (3.2.2)
charlock_holmes (0.7.3)
coderay (1.1.1)
creole (0.5.0)
did_you_mean (1.0.0)
diff-lcs (1.2.5)
expression_parser (0.9.1)
gemojione (3.3.0)
github-markup (1.7.0)
gitlab-grit (2.8.2)
gollum (4.1.2)
gollum-grit_adapter (1.0.1)
gollum-lib (4.2.7)
gollum-rugged_adapter (0.4.1)
hashery (2.1.1)
i18n (0.7.0)
io-console (0.4.5)
json (1.8.3)
kramdown (1.9.0)
mime-types (2.6.1)
minitest (5.8.4)
mustache (0.99.8)
net-telnet (0.1.1)
nokogiri (1.6.7.2)
org-ruby (0.9.12)
pdf-core (0.5.1)
pdf-reader (1.4.0)
posix-spawn (0.3.11)
power_assert (0.2.7)
prawn (2.0.2)
prawn-table (0.2.1)
psych (2.0.17)
rack (1.6.4)
rack-protection (1.5.3)
rake (10.5.0)
rdoc (4.2.1)
RedCloth (4.2.9)
rinku (1.7.3)
rouge (2.2.1)
ruby-rc4 (0.1.5)
rubypants (0.2.0)
rugged (0.24.0, 0.23.3)
sanitize (2.1.0)
sinatra (1.4.7)
stringex (2.8.4)
test-unit (3.1.7)
tilt (2.0.1)
ttfunk (1.4.0)
useragent (0.16.10)
wikicloth (0.8.1)

Error message:

application error
Encoding::CompatibilityError at /search
incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)
file: git_layer_rugged.rb location: match line: 170
BACKTRACE
(condense)

JUMP TO: GET POST COOKIES ENV
/usr/lib/ruby/vendor_ruby/rugged_adapter/git_layer_rugged.rb in match
            next unless line.match(/#{Regexp.escape(query)}/i)
/usr/lib/ruby/vendor_ruby/rugged_adapter/git_layer_rugged.rb in match
            next unless line.match(/#{Regexp.escape(query)}/i)
/usr/lib/ruby/vendor_ruby/rugged_adapter/git_layer_rugged.rb in block (2 levels) in grep
            next unless line.match(/#{Regexp.escape(query)}/i)
/usr/lib/ruby/vendor_ruby/rugged_adapter/git_layer_rugged.rb in each_line
          blob.content.each_line do |line|
/usr/lib/ruby/vendor_ruby/rugged_adapter/git_layer_rugged.rb in block in grep
          blob.content.each_line do |line|
/usr/lib/ruby/vendor_ruby/rugged/tree.rb in block in walk_blobs
      self.walk(mode) { |root, e| yield root, e if e[:type] == :blob }
/usr/lib/ruby/vendor_ruby/rugged/tree.rb in walk
      self.walk(mode) { |root, e| yield root, e if e[:type] == :blob }
/usr/lib/ruby/vendor_ruby/rugged/tree.rb in walk_blobs
      self.walk(mode) { |root, e| yield root, e if e[:type] == :blob }
/usr/lib/ruby/vendor_ruby/rugged_adapter/git_layer_rugged.rb in grep
        tree.walk_blobs(:postorder) do |root, entry|
/var/lib/gems/2.3.0/gems/gollum-lib-4.2.7/lib/gollum-lib/wiki.rb in search
      @repo.git.grep(query, options).each do |hit|
/var/lib/gems/2.3.0/gems/gollum-4.1.2/lib/gollum/app.rb in block in <class:App>
      @results = wiki.search(@query).sort { |a, b| (a[:count] <=> b[:count]).nonzero? || b[:name] <=> a[:name] }.reverse
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in call
          proc { |a,p| unbound_method.bind(a).call }
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in block in compile!
          proc { |a,p| unbound_method.bind(a).call }
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in block (3 levels) in route!
            route_eval { block[*args] }
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in route_eval
      throw :halt, yield
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in block (2 levels) in route!
            route_eval { block[*args] }
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in block in process_route
        block ? block[self, values] : yield(self, values)
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in catch
      catch(:pass) do
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in process_route
      catch(:pass) do
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in block in route!
          returned_pass_block = process_route(pattern, keys, conditions) do |*args|
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in each
        routes.each do |pattern, keys, conditions, block|
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in route!
        routes.each do |pattern, keys, conditions, block|
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in block in dispatch!
        route!
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in block in invoke
      res = catch(:halt) { yield }
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in catch
      res = catch(:halt) { yield }
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in invoke
      res = catch(:halt) { yield }
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in dispatch!
      invoke do
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in block in call!
      invoke { dispatch! }
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in block in invoke
      res = catch(:halt) { yield }
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in catch
      res = catch(:halt) { yield }
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in invoke
      res = catch(:halt) { yield }
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in call!
      invoke { dispatch! }
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in call
      dup.call!(env)
/usr/lib/ruby/vendor_ruby/rack/protection/xss_header.rb in call
        status, headers, body = @app.call(env)
/usr/lib/ruby/vendor_ruby/rack/protection/path_traversal.rb in call
        app.call env
/usr/lib/ruby/vendor_ruby/rack/protection/json_csrf.rb in call
        status, headers, body = app.call(env)
/usr/lib/ruby/vendor_ruby/rack/protection/base.rb in call
        result or app.call(env)
/usr/lib/ruby/vendor_ruby/rack/protection/base.rb in call
        result or app.call(env)
/usr/lib/ruby/vendor_ruby/rack/protection/frame_options.rb in call
        status, headers, body        = @app.call(env)
/usr/lib/ruby/vendor_ruby/rack/nulllogger.rb in call
      @app.call(env)
/usr/lib/ruby/vendor_ruby/rack/head.rb in call
    status, headers, body = @app.call(env)
/usr/lib/ruby/vendor_ruby/sinatra/show_exceptions.rb in call
      @app.call(env)
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in call
      result, callback = app.call(env), env['async.callback']
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in call
      @stack.call(env)
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in block in call
        synchronize { prototype.call(env) }
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in synchronize
          yield
/usr/lib/ruby/vendor_ruby/sinatra/base.rb in call
        synchronize { prototype.call(env) }
/usr/lib/ruby/vendor_ruby/rack/handler/webrick.rb in service
        status, headers, body = @app.call(env)
/usr/lib/ruby/2.3.0/webrick/httpserver.rb in service
      si.service(req, res)
/usr/lib/ruby/2.3.0/webrick/httpserver.rb in run
          server.service(req, res)
/usr/lib/ruby/2.3.0/webrick/server.rb in block in start_thread
          block ? block.call(sock) : run(sock)
GET
Variable	Value
q	
"ö"
POST
No POST data.

COOKIES
No cookie data.

Rack ENV
Variable	Value
GATEWAY_INTERFACE	
CGI/1.1
HTTP_ACCEPT	
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
HTTP_ACCEPT_ENCODING	
gzip, deflate
HTTP_ACCEPT_LANGUAGE	
de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7
HTTP_CONNECTION	
Keep-Alive
HTTP_HOST	
localhost:4567
HTTP_REFERER	
http://REDACTED/Home
HTTP_UPGRADE_INSECURE_REQUESTS	
1
HTTP_USER_AGENT	
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
HTTP_VERSION	
HTTP/1.1
HTTP_X_FORWARDED_FOR	
REDACTED
HTTP_X_FORWARDED_HOST	
REDACTED
HTTP_X_FORWARDED_SERVER	
REDACTED
PATH_INFO	
/search
QUERY_STRING	
q=%C3%B6
REMOTE_ADDR	
127.0.0.1
REMOTE_HOST	
127.0.0.1
REQUEST_METHOD	
GET
REQUEST_PATH	
/search
REQUEST_URI	
http://REDACTED/search?q=%C3%B6
SCRIPT_NAME	
SERVER_NAME	
REDACTED
SERVER_PORT	
80
SERVER_PROTOCOL	
HTTP/1.1
SERVER_SOFTWARE	
WEBrick/1.3.1 (Ruby/2.3.1/2016-04-26)
rack.errors	
#<Object:0x00000001ca7d98>
rack.hijack	
#<Proc:0x00000001940f38@/usr/lib/ruby/vendor_ruby/rack/handler/webrick.rb:76 (lambda)>
rack.hijack?	
true
rack.hijack_io	
nil
rack.input	
#<StringIO:0x000000019411e0>
rack.logger	
#<Rack::NullLogger:0x00000001dbf758 @app=#<Rack::Protection::FrameOptions:0x00000001dbfa50 @app=#<Rack::Protection::HttpOrigin:0x00000001dbfb90 @app=#<Rack::Protection::IPSpoofing:0x00000001dbfca8 @app=#<Rack::Protection::JsonCsrf:0x00000001dbfd70 @app=#<Rack::Protection::PathTraversal:0x00000001dbfe38 @app=#<Rack::Protection::XSSHeader:0x00000001dbff50 @app=#<Precious::App:0x00000001e94138 @default_layout=:layout, @preferred_extension=nil, @app=nil, @template_cache=#<Tilt::Cache:0x00000001e941b0 @cache={}>>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :xss_mode=>:block, :nosniff=>true, :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :frame_options=>:sameorigin, :except=>[:session_hijacking, :remote_token]}, @frame_options="SAMEORIGIN">>
rack.multiprocess	
false
rack.multithread	
true
rack.request.cookie_hash	
{}
rack.request.query_hash	
{"q"=>"ö"}
rack.request.query_string	
q=%C3%B6
rack.run_once	
false
rack.url_scheme	
http
rack.version	
[1, 3]
sinatra.accept	
[#<Sinatra::Request::AcceptEntry:0x0000000193ae30 @entry="text/html", @type="text/html", @params={}, @q=1.0>, #<Sinatra::Request::AcceptEntry:0x0000000193ac28 @entry="application/xhtml+xml", @type="application/xhtml+xml", @params={}, @q=1.0>, #<Sinatra::Request::AcceptEntry:0x0000000193a6b0 @entry="image/webp", @type="image/webp", @params={}, @q=1.0>, #<Sinatra::Request::AcceptEntry:0x0000000193a390 @entry="image/apng", @type="image/apng", @params={}, @q=1.0>, #<Sinatra::Request::AcceptEntry:0x0000000193aa48 @entry="application/xml;q=0.9", @type="application/xml", @params={}, @q=0.9>, #<Sinatra::Request::AcceptEntry:0x0000000193a1b0 @entry="*/*;q=0.8", @type="*/*", @params={}, @q=0.8>]
sinatra.error	
#<Encoding::CompatibilityError: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)>
sinatra.route	
GET /search

Funny thing is: Gollum 4.1.1 works on another server just fine (and without the rugged adapter). Installed gems on working server:

*** LOCAL GEMS ***

bigdecimal (1.2.8)
charlock_holmes (0.7.3)
did_you_mean (1.0.0)
diff-lcs (1.3)
gemojione (3.2.0)
github-markup (1.6.0)
gitlab-grit (2.8.1)
gollum (4.1.1)
gollum-grit_adapter (1.0.1)
gollum-lib (4.2.5)
io-console (0.4.5)
json (1.8.3)
kramdown (1.9.0)
mime-types (2.99.3)
mini_portile2 (2.1.0)
minitest (5.8.4)
mustache (0.99.8)
net-telnet (0.1.1)
nokogiri (1.6.8.1)
posix-spawn (0.3.13)
power_assert (0.2.7)
psych (2.0.17)
rack (1.6.8)
rack-protection (1.5.3)
rake (10.5.0)
rdoc (4.2.1)
rouge (2.1.0)
sanitize (2.1.0)
sinatra (1.4.8)
stringex (2.7.1)
test-unit (3.1.7)
tilt (2.0.7)
useragent (0.16.8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment