With Apache: File/folder renders empty page when it contains spaces
Summary
When visiting the files pane of a project on a GitLab instance that is served via Apache (because we use shibboleth as an OmniAuth provider), and navigating into a file or folder that contains spaces in its name, only an empty page is rendered.
Steps to reproduce
Create a repository, and create a file with arbitrary contents in it, and save the file under a name that contains spaces. Commit the file to the repository and push it to GitLab. Visit the project page in GitLab, go to the "files" view, and click on file for a preview.
What is the current bug behavior?
When clicking the file or folder the page is completely empty (white page, no contents).
What is the expected correct behavior?
The preview page (blob) should render the contents of the file.
Relevant logs and/or screenshots
Apache access.log
:
139.13.133.1 - - [27/Feb/2017:11:04:07 +0100] "GET /janwillhaus/git-intro-testproject/tree/master/Test%20with%20only%20spaces HTTP/1.1" 400 - "https://tgm-git.jade-hs.de/janwillhaus/git-intro-testproject/tree/master" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"
GitLab's logs don't list any errors, therefore narrowing the source of error down to Apache.
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)
Results of GitLab environment info
System information
System: CentOS 6.8
Current User: git
Using RVM: no
Ruby Version: 2.3.3p222
Gem Version: 2.6.6
Bundler Version:1.13.7
Rake Version: 10.5.0
Sidekiq Version:4.2.7
GitLab information
Version: 8.16.5-ee
Revision: d869576
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 9.2.18
URL: https://tgm-git.jade-hs.de
HTTP Clone URL: https://tgm-git.jade-hs.de/some-group/some-project.git
SSH Clone URL: git@tgm-git.jade-hs.de:some-group/some-project.git
Elasticsearch: no
Geo: no
Using LDAP: no
Using Omniauth: yes
Omniauth Providers: github, shibboleth
GitLab Shell
Version: 4.1.1
Repository storage paths:
- default: /mnt/storage/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Checking GitLab Shell ...
GitLab Shell version >= 4.1.1 ? ... OK (4.1.1)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
2/4 ... ok
2/5 ... ok
2/6 ... ok
2/7 ... ok
7/8 ... ok
5/9 ... ok
6/10 ... ok
3/16 ... ok
3/17 ... ok
2/18 ... ok
10/19 ... repository is empty
145/22 ... ok
26/27 ... ok
106/32 ... ok
2/37 ... repository is empty
3/38 ... ok
6/40 ... ok
5/42 ... ok
2/43 ... ok
3/44 ... ok
35/48 ... ok
31/51 ... ok
5/52 ... ok
2/53 ... repository is empty
123/54 ... ok
11/56 ... ok
11/57 ... ok
26/60 ... ok
3/61 ... ok
26/67 ... ok
6/69 ... ok
27/70 ... ok
145/71 ... ok
15/72 ... ok
5/73 ... ok
145/75 ... ok
137/76 ... ok
5/78 ... ok
5/80 ... ok
39/84 ... ok
31/86 ... ok
6/88 ... ok
53/89 ... ok
57/91 ... ok
5/92 ... ok
53/94 ... ok
24/96 ... ok
5/100 ... ok
3/101 ... ok
123/102 ... ok
123/109 ... ok
123/110 ... ok
53/111 ... ok
31/114 ... ok
5/116 ... ok
23/117 ... ok
24/118 ... ok
2/121 ... ok
5/122 ... ok
31/123 ... ok
5/128 ... ok
7/129 ... ok
145/130 ... ok
23/132 ... ok
66/133 ... ok
23/135 ... ok
66/138 ... ok
66/139 ... ok
31/140 ... ok
67/142 ... ok
31/143 ... ok
11/144 ... ok
11/145 ... ok
68/147 ... ok
145/148 ... ok
66/149 ... ok
66/150 ... ok
23/155 ... ok
145/158 ... ok
24/159 ... ok
5/160 ... ok
145/161 ... ok
6/163 ... ok
31/167 ... ok
3/168 ... ok
23/169 ... ok
27/170 ... ok
145/171 ... ok
66/173 ... ok
73/174 ... ok
5/175 ... ok
5/177 ... ok
66/183 ... repository is empty
5/188 ... ok
66/189 ... ok
24/190 ... ok
31/191 ... ok
5/192 ... ok
23/193 ... ok
5/194 ... ok
23/196 ... ok
66/200 ... repository is empty
10/201 ... ok
66/204 ... ok
145/205 ... ok
5/208 ... ok
5/209 ... ok
24/210 ... ok
23/212 ... ok
23/217 ... ok
66/220 ... ok
5/222 ... ok
40/223 ... ok
39/224 ... ok
5/225 ... ok
5/226 ... ok
53/227 ... ok
73/229 ... ok
27/230 ... ok
137/231 ... ok
74/234 ... ok
27/235 ... ok
91/236 ... ok
145/237 ... ok
66/238 ... ok
53/239 ... ok
66/240 ... ok
11/241 ... ok
27/242 ... ok
145/243 ... ok
6/244 ... ok
73/245 ... ok
98/246 ... ok
84/247 ... repository is empty
8/248 ... ok
11/249 ... ok
5/250 ... ok
5/251 ... ok
66/252 ... ok
5/253 ... ok
98/257 ... ok
102/258 ... repository is empty
105/259 ... ok
103/260 ... ok
47/263 ... ok
109/264 ... ok
110/265 ... ok
93/266 ... ok
111/267 ... ok
109/268 ... ok
15/269 ... ok
119/270 ... ok
45/271 ... ok
5/274 ... ok
110/275 ... ok
5/277 ... ok
47/279 ... ok
124/280 ... ok
124/281 ... ok
31/282 ... ok
98/283 ... ok
80/284 ... ok
116/286 ... repository is empty
31/287 ... ok
145/289 ... ok
103/290 ... ok
104/291 ... repository is empty
5/292 ... ok
127/293 ... ok
31/294 ... ok
103/295 ... ok
23/296 ... ok
3/297 ... ok
3/298 ... ok
23/299 ... ok
45/300 ... ok
145/301 ... ok
80/302 ... ok
98/303 ... ok
110/306 ... ok
109/307 ... ok
127/308 ... ok
27/309 ... ok
27/310 ... ok
47/311 ... ok
6/312 ... ok
93/313 ... ok
145/314 ... ok
104/315 ... ok
27/316 ... ok
113/317 ... ok
66/318 ... ok
145/319 ... ok
27/320 ... ok
15/321 ... ok
111/323 ... ok
111/324 ... ok
124/326 ... ok
6/329 ... ok
145/336 ... ok
72/337 ... ok
130/339 ... ok
72/340 ... ok
45/341 ... ok
6/342 ... ok
72/343 ... ok
44/344 ... ok
23/345 ... ok
68/346 ... ok
5/348 ... ok
5/350 ... ok
124/351 ... ok
24/352 ... ok
27/353 ... ok
57/357 ... repository is empty
91/358 ... ok
44/359 ... ok
15/360 ... ok
130/362 ... ok
130/363 ... ok
5/364 ... ok
5/365 ... ok
15/366 ... ok
53/367 ... ok
6/368 ... ok
137/369 ... ok
23/370 ... ok
124/371 ... ok
124/372 ... ok
23/373 ... ok
23/374 ... ok
23/375 ... ok
31/376 ... ok
3/377 ... ok
145/378 ... ok
11/379 ... ok
124/380 ... ok
89/381 ... repository is empty
89/382 ... ok
111/383 ... ok
111/384 ... ok
5/385 ... ok
5/386 ... ok
140/387 ... repository is empty
15/388 ... ok
23/389 ... ok
128/390 ... ok
5/391 ... ok
92/392 ... ok
5/393 ... ok
5/394 ... ok
111/395 ... ok
3/396 ... ok
5/397 ... ok
5/399 ... ok
60/400 ... repository is empty
45/401 ... ok
111/402 ... ok
5/403 ... ok
144/404 ... ok
144/405 ... ok
31/406 ... ok
111/407 ... ok
83/408 ... ok
5/409 ... ok
15/410 ... ok
48/411 ... ok
26/412 ... ok
31/413 ... ok
148/414 ... ok
26/415 ... repository is empty
44/416 ... ok
50/417 ... ok
66/418 ... ok
105/420 ... ok
152/421 ... ok
105/424 ... ok
5/426 ... ok
23/428 ... ok
44/429 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... 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: ...
2/4 ... yes
2/5 ... yes
2/6 ... yes
2/7 ... yes
7/8 ... yes
5/9 ... yes
6/10 ... yes
3/16 ... yes
3/17 ... yes
2/18 ... yes
10/19 ... yes
145/22 ... yes
26/27 ... yes
106/32 ... yes
2/37 ... yes
3/38 ... yes
6/40 ... yes
5/42 ... yes
2/43 ... yes
3/44 ... yes
35/48 ... yes
31/51 ... yes
5/52 ... yes
2/53 ... yes
123/54 ... yes
11/56 ... yes
11/57 ... yes
26/60 ... yes
3/61 ... yes
26/67 ... yes
6/69 ... yes
27/70 ... yes
145/71 ... yes
15/72 ... yes
5/73 ... yes
145/75 ... yes
137/76 ... yes
5/78 ... yes
5/80 ... yes
39/84 ... yes
31/86 ... yes
6/88 ... yes
53/89 ... yes
57/91 ... yes
5/92 ... yes
53/94 ... yes
24/96 ... yes
5/100 ... yes
3/101 ... yes
123/102 ... yes
123/109 ... yes
123/110 ... yes
53/111 ... yes
31/114 ... yes
5/116 ... yes
23/117 ... yes
24/118 ... yes
2/121 ... yes
5/122 ... yes
31/123 ... yes
5/128 ... yes
7/129 ... yes
145/130 ... yes
23/132 ... yes
66/133 ... yes
23/135 ... yes
66/138 ... yes
66/139 ... yes
31/140 ... yes
67/142 ... yes
31/143 ... yes
11/144 ... yes
11/145 ... yes
68/147 ... yes
145/148 ... yes
66/149 ... yes
66/150 ... yes
23/155 ... yes
145/158 ... yes
24/159 ... yes
5/160 ... yes
145/161 ... yes
6/163 ... yes
31/167 ... yes
3/168 ... yes
23/169 ... yes
27/170 ... yes
145/171 ... yes
66/173 ... yes
73/174 ... yes
5/175 ... yes
5/177 ... yes
66/183 ... yes
5/188 ... yes
66/189 ... yes
24/190 ... yes
31/191 ... yes
5/192 ... yes
23/193 ... yes
5/194 ... yes
23/196 ... yes
66/200 ... yes
10/201 ... yes
66/204 ... yes
145/205 ... yes
5/208 ... yes
5/209 ... yes
24/210 ... yes
23/212 ... yes
23/217 ... yes
66/220 ... yes
5/222 ... yes
40/223 ... yes
39/224 ... yes
5/225 ... yes
5/226 ... yes
53/227 ... yes
73/229 ... yes
27/230 ... yes
137/231 ... yes
74/234 ... yes
27/235 ... yes
91/236 ... yes
145/237 ... yes
66/238 ... yes
53/239 ... yes
66/240 ... yes
11/241 ... yes
27/242 ... yes
145/243 ... yes
6/244 ... yes
73/245 ... yes
98/246 ... yes
84/247 ... yes
8/248 ... yes
11/249 ... yes
5/250 ... yes
5/251 ... yes
66/252 ... yes
5/253 ... yes
98/257 ... yes
102/258 ... yes
105/259 ... yes
103/260 ... yes
47/263 ... yes
109/264 ... yes
110/265 ... yes
93/266 ... yes
111/267 ... yes
109/268 ... yes
15/269 ... yes
119/270 ... yes
45/271 ... yes
5/274 ... yes
110/275 ... yes
5/277 ... yes
47/279 ... yes
124/280 ... yes
124/281 ... yes
31/282 ... yes
98/283 ... yes
80/284 ... yes
116/286 ... yes
31/287 ... yes
145/289 ... yes
103/290 ... yes
104/291 ... yes
5/292 ... yes
127/293 ... yes
31/294 ... yes
103/295 ... yes
23/296 ... yes
3/297 ... yes
3/298 ... yes
23/299 ... yes
45/300 ... yes
145/301 ... yes
80/302 ... yes
98/303 ... yes
110/306 ... yes
109/307 ... yes
127/308 ... yes
27/309 ... yes
27/310 ... yes
47/311 ... yes
6/312 ... yes
93/313 ... yes
145/314 ... yes
104/315 ... yes
27/316 ... yes
113/317 ... yes
66/318 ... yes
145/319 ... yes
27/320 ... yes
15/321 ... yes
111/323 ... yes
111/324 ... yes
124/326 ... yes
6/329 ... yes
145/336 ... yes
72/337 ... yes
130/339 ... yes
72/340 ... yes
45/341 ... yes
6/342 ... yes
72/343 ... yes
44/344 ... yes
23/345 ... yes
68/346 ... yes
5/348 ... yes
5/350 ... yes
124/351 ... yes
24/352 ... yes
27/353 ... yes
57/357 ... yes
91/358 ... yes
44/359 ... yes
15/360 ... yes
130/362 ... yes
130/363 ... yes
5/364 ... yes
5/365 ... yes
15/366 ... yes
53/367 ... yes
6/368 ... yes
137/369 ... yes
23/370 ... yes
124/371 ... yes
124/372 ... yes
23/373 ... yes
23/374 ... yes
23/375 ... yes
31/376 ... yes
3/377 ... yes
145/378 ... yes
11/379 ... yes
124/380 ... yes
89/381 ... yes
89/382 ... yes
111/383 ... yes
111/384 ... yes
5/385 ... yes
5/386 ... yes
140/387 ... yes
15/388 ... yes
23/389 ... yes
128/390 ... yes
5/391 ... yes
92/392 ... yes
5/393 ... yes
5/394 ... yes
111/395 ... yes
3/396 ... yes
5/397 ... yes
5/399 ... yes
60/400 ... yes
45/401 ... yes
111/402 ... yes
5/403 ... yes
144/404 ... yes
144/405 ... yes
31/406 ... yes
111/407 ... yes
83/408 ... yes
5/409 ... yes
15/410 ... yes
48/411 ... yes
26/412 ... yes
31/413 ... yes
148/414 ... yes
26/415 ... yes
44/416 ... yes
50/417 ... yes
66/418 ... yes
105/420 ... yes
152/421 ... yes
105/424 ... yes
5/426 ... yes
23/428 ... yes
44/429 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.3)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.10.2)
Active users: 98
Checking GitLab ... Finished
Possible fixes
The issue seems to be fixable by removing the NE|noescape
flag from the main rewrite rule in the Apache 2.2 config recipe in L40 like this:
RewriteRule .* http://127.0.0.1:8181%{REQUEST_URI} [P,QSA]
I'm not aware of any repercussions toward other pages, but it seems like that's not the case.