Page MenuHomePhabricator

Running a saved search on old-bugzilla broken due to character URL encoding
Closed, ResolvedPublic

Description

"Sidebar searches on old bugzilla are broken because special characters have been URL encoded. Or, they are correctly URL encoded, but not converted back by the search engine.

e.g. it'd try to search for foobar%40gmail.com for "My Bugs" which doesn't work."

(Mentioned by someone else on IRC. I'm filing on behalf of.)

screenshot of a named search with spaces in the title:

Event Timeline

Quiddity created this task.Nov 25 2014, 8:22 AM
Quiddity updated the task description. (Show Details)
Quiddity raised the priority of this task from to Needs Triage.
Quiddity added a project: Bugzilla-Migration.
Quiddity changed Security from none to None.
Quiddity renamed this task from Searching a old-bugzilla partially broken due to character encoding to Searching old-bugzilla partially broken due to character encoding.
Quiddity added a subscriber: Quiddity.
Qgil added subscribers: Aklapper, Qgil.
Aklapper renamed this task from Searching old-bugzilla partially broken due to character encoding to Running a saved search on old-bugzilla broken due to character URL encoding.Nov 25 2014, 2:05 PM
Aklapper triaged this task as Low priority.Nov 25 2014, 2:09 PM

I can confirm that but no idea why. Would be great to know if anybody knows if that still worked 24h ago as we moved old-bugzilla behind the misc-web varnish/nginx layer about 12h ago (T366).

Workaround: remove the "25"s from the URL.

Comparison:

https://old-bugzilla.wikimedia.org/buglist.cgi?namedcmd=Time%3A%20New%20Bugs%20-%2024%20Hours&cmdtype=dorem&remaction=run&sharer_id=1234
https://old-bugzilla.wikimedia.org/buglist.cgi?namedcmd=Time%253A%2520New%2520Bugs%2520-%252024%2520Hours&cmdtype=dorem&remaction=run&sharer_id=1234
cscott added a subscriber: cscott.Dec 2 2014, 11:12 PM

This also seems to make the 'My bugs' link in the sidebar not work for me (url encoding the @ symbol in my username), and also breaks many of the component bug lists, ie https://old-bugzilla.wikimedia.org/buglist.cgi?component=PDF%20renderer&list_id=360888&product=OCG&resolution=---

Workaround: For the time being, it works for me in Firefox 33 to remove the "25" string after any percentage signs in the URL and loading that new URL again.

Tgr added a comment.Dec 7 2014, 6:16 PM

When I enter

https://old-bugzilla.wikimedia.org/buglist.cgi?cmdtype=runnamed&namedcmd=UploadWizard%20bugs

the site will return a

Location: http://old-bugzilla.wikimedia.org/buglist.cgi?cmdtype=runnamed&namedcmd=UploadWizard%20bugs&list_id=360937

redirect (this is Bugzilla resolving the saved search name to a search id, and for some reason redirecting to HTTP at the same time), which is then followed by

Location: https://old-bugzilla.wikimedia.org/buglist.cgi?cmdtype=runnamed&namedcmd=UploadWizard%2520bugs&list_id=360937

So there are two separate bugs:

  1. Bugzilla redirecting to HTTP (the Apache config has a bunch of X-Forwarded-Proto rules in it, so I am guessing the SSL connection is terminated at some load balancer or web proxy, and that gets Bugzilla confused)
  2. the HTTP --> HTTPS redirect does an extra URLencoding.

Bug #2 can be demonstrated in isolation

$ curl -vso/dev/null 'http://old-bugzilla.wikimedia.org/foo?bar%20baz' 2>&1 | grep Location
< Location: https://old-bugzilla.wikimedia.org/foo?bar%2520baz

The bug only affects the query string, percent signs in the path part are left intact.

Krenair added a subscriber: Krenair.Dec 7 2014, 9:17 PM

CC'ing @Dzahn as this might be an outcome of fixing T366.

Change 178186 had a related patch set uploaded (by Gergő Tisza):
Attempt to fix double-encoding in old-bugzilla HTTPS redirects

https://gerrit.wikimedia.org/r/178186

Patch-For-Review

Change 178186 merged by Dzahn:
Attempt to fix double-encoding in old-bugzilla HTTPS redirects

https://gerrit.wikimedia.org/r/178186

In T75848#823885, @Tgr wrote:

Bug #2 can be demonstrated in isolation

$ curl -vso/dev/null 'http://old-bugzilla.wikimedia.org/foo?bar%20baz' 2>&1 | grep Location
< Location: https://old-bugzilla.wikimedia.org/foo?bar%2520baz

I merged your change and puppet applied on zirconium. I graceful'ed Apache. Now:

curl -vso/dev/null 'http://old-bugzilla.wikimedia.org/foo?bar%20baz' 2>&1 | grep Location
< Location: https://old-bugzilla.wikimedia.org/foo?bar%20baz

looks fixed to me from that. thanks Gergő !

Dzahn closed this task as Resolved.Dec 9 2014, 11:10 AM
Dzahn claimed this task.

logged in on old-BZ and clicked sidebar searches. they work for me. claiming ticket is resolved but confirmation would be nice.

Works for me too now. Thank you Gergő and Daniel!

Tgr mentioned this in Unknown Object (Diffusion Commit).Dec 10 2014, 8:38 PM