Page MenuHomePhabricator

Advanced Search hits exception if data returned is not valid UTF-8
Closed, WontfixPublic

Description

Certain users belonging to a project with an SVN repository get the following exception when performing an Advanced Search for the string svn.

Invalid UTF-8 string passed to phutil_utf8v().

After following the steps described here, I looked at the ssl_error.log to see exactly why this was failing.

[Wed Nov 12 14:38:31 2014] [error] [client 140.102.44.115] [2014-11-12 14:38:31] EXCEPTION: (Exception) Invalid UTF-8 string passed to phutil_utf8v(). at [<phutil>/src/utils/utf8.php:338], referer: https://phabricator.draper.com/maniphest/
[Wed Nov 12 14:38:31 2014] [error] [client 140.102.44.115]   #0 phutil_utf8v(string) called at [<phabricator>/src/applications/search/view/PhabricatorSearchResultView.php:140], referer: https://phabricator.draper.com/maniphest/
[Wed Nov 12 14:38:31 2014] [error] [client 140.102.44.115]   #1 PhabricatorSearchResultView::emboldenQuery(string) called at [<phabricator>/src/applications/search/view/PhabricatorSearchResultView.php:53], referer: https://phabricator.draper.com/maniphest/
[Wed Nov 12 14:38:31 2014] [error] [client 140.102.44.115]   #2 PhabricatorSearchResultView::render() called at [<phabricator>/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php:260], referer: https://phabricator.draper.com/maniphest/
[Wed Nov 12 14:38:31 2014] [error] [client 140.102.44.115]   #3 PhabricatorSearchApplicationSearchEngine::renderResultList(array, PhabricatorSavedQuery, array) called at [<phabricator>/src/applications/search/engine/PhabricatorApplicationSearchEngine.php:656], referer: https://phabricator.draper.com/maniphest/
[Wed Nov 12 14:38:31 2014] [error] [client 140.102.44.115]   #4 PhabricatorApplicationSearchEngine::renderResults(array, PhabricatorSavedQuery) called at [<phabricator>/src/applications/search/controller/PhabricatorApplicationSearchController.php:231], referer: https://phabricator.draper.com/maniphest/
[Wed Nov 12 14:38:31 2014] [error] [client 140.102.44.115]   #5 PhabricatorApplicationSearchController::processSearchRequest() called at [<phabricator>/src/applications/search/controller/PhabricatorApplicationSearchController.php:80], referer: https://phabricator.draper.com/maniphest/
[Wed Nov 12 14:38:31 2014] [error] [client 140.102.44.115]   #6 PhabricatorApplicationSearchController::processRequest() called at [<phabricator>/src/aphront/AphrontController.php:33], referer: https://phabricator.draper.com/maniphest/
[Wed Nov 12 14:38:31 2014] [error] [client 140.102.44.115]   #7 AphrontController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/AphrontController.php:69], referer: https://phabricator.draper.com/maniphest/
[Wed Nov 12 14:38:31 2014] [error] [client 140.102.44.115]   #8 AphrontController::delegateToController(PhabricatorApplicationSearchController) called at [<phabricator>/src/applications/search/controller/PhabricatorSearchController.php:80], referer: https://phabricator.draper.com/maniphest/
[Wed Nov 12 14:38:31 2014] [error] [client 140.102.44.115]   #9 PhabricatorSearchController::processRequest() called at [<phabricator>/src/aphront/AphrontController.php:33], referer: https://phabricator.draper.com/maniphest/
[Wed Nov 12 14:38:31 2014] [error] [client 140.102.44.115]   #10 AphrontController::handleRequest(AphrontRequest) called at [<phabricator>/webroot/index.php:103], referer: https://phabricator.draper.com/maniphest/

I then updated the exception so that I could see the string that was causing the UTF8 string error and found the following:

[Wed Nov 12 15:37:23 2014] [error] [client 140.102.44.115] [2014-11-12 15:37:23] EXCEPTION: (Exception) Invalid UTF-8 string (rSVN201: Adding M/R processing pipeline dependancies for new Sequence File approach. The\xe2) passed to phutil_utf8v(). at [<phutil>/src/utils/utf8.php:338], referer: https://phabricator.draper.com/search/query/vkE8oB9hoPTc/
[Wed Nov 12 15:37:23 2014] [error] [client 140.102.44.115]   #0 phutil_utf8v(string) called at [<phabricator>/src/applications/search/view/PhabricatorSearchResultView.php:140], referer: https://phabricator.draper.com/search/query/vkE8oB9hoPTc/
[Wed Nov 12 15:37:23 2014] [error] [client 140.102.44.115]   #1 PhabricatorSearchResultView::emboldenQuery(string) called at [<phabricator>/src/applications/search/view/PhabricatorSearchResultView.php:53], referer: https://phabricator.draper.com/search/query/vkE8oB9hoPTc/
[Wed Nov 12 15:37:23 2014] [error] [client 140.102.44.115]   #2 PhabricatorSearchResultView::render() called at [<phabricator>/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php:260], referer: https://phabricator.draper.com/search/query/vkE8oB9hoPTc/
[Wed Nov 12 15:37:23 2014] [error] [client 140.102.44.115]   #3 PhabricatorSearchApplicationSearchEngine::renderResultList(array, PhabricatorSavedQuery, array) called at [<phabricator>/src/applications/search/engine/PhabricatorApplicationSearchEngine.php:656], referer: https://phabricator.draper.com/search/query/vkE8oB9hoPTc/
[Wed Nov 12 15:37:23 2014] [error] [client 140.102.44.115]   #4 PhabricatorApplicationSearchEngine::renderResults(array, PhabricatorSavedQuery) called at [<phabricator>/src/applications/search/controller/PhabricatorApplicationSearchController.php:231], referer: https://phabricator.draper.com/search/query/vkE8oB9hoPTc/
[Wed Nov 12 15:37:23 2014] [error] [client 140.102.44.115]   #5 PhabricatorApplicationSearchController::processSearchRequest() called at [<phabricator>/src/applications/search/controller/PhabricatorApplicationSearchController.php:80], referer: https://phabricator.draper.com/search/query/vkE8oB9hoPTc/
[Wed Nov 12 15:37:23 2014] [error] [client 140.102.44.115]   #6 PhabricatorApplicationSearchController::processRequest() called at [<phabricator>/src/aphront/AphrontController.php:33], referer: https://phabricator.draper.com/search/query/vkE8oB9hoPTc/
[Wed Nov 12 15:37:23 2014] [error] [client 140.102.44.115]   #7 AphrontController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/AphrontController.php:69], referer: https://phabricator.draper.com/search/query/vkE8oB9hoPTc/
[Wed Nov 12 15:37:23 2014] [error] [client 140.102.44.115]   #8 AphrontController::delegateToController(PhabricatorApplicationSearchController) called at [<phabricator>/src/applications/search/controller/PhabricatorSearchController.php:80], referer: https://phabricator.draper.com/search/query/vkE8oB9hoPTc/
[Wed Nov 12 15:37:23 2014] [error] [client 140.102.44.115]   #9 PhabricatorSearchController::processRequest() called at [<phabricator>/src/aphront/AphrontController.php:33], referer: https://phabricator.draper.com/search/query/vkE8oB9hoPTc/
[Wed Nov 12 15:37:23 2014] [error] [client 140.102.44.115]   #10 AphrontController::handleRequest(AphrontRequest) called at [<phabricator>/webroot/index.php:103], referer: https://phabricator.draper.com/search/query/vkE8oB9hoPTc/

So the search is working but it's finding a bad character in the SVN repository

Invalid UTF-8 string (rSVN201: Adding M/R processing pipeline dependancies for new Sequence File approach. The\xe2) passed to phutil_utf8v()

That string is a description of an earlier commit to the SVN repository (which is hosted externally to Phabricator).

Event Timeline

pmepablo raised the priority of this task from to Needs Triage.
pmepablo updated the task description. (Show Details)
pmepablo added a subscriber: pmepablo.

This is the string returned to a file for more information.

What is your expectation here?

chad renamed this task from Advanced Search fails for certain users belonging to a project with an SVN repository to Advanced Search if data returned is not valid UTF-8.Nov 13 2014, 5:37 PM
chad renamed this task from Advanced Search if data returned is not valid UTF-8 to Advanced Search hits exception if data returned is not valid UTF-8.Nov 13 2014, 7:06 PM

To make you aware of what was happening. The data was cleaned up on this end but thought there might have been a cleaner way of dealing with a bad character. Because of the cleanup on our end, this is not an issue for us at this point.

chad claimed this task.

Okay, thanks! We'll close this for now and if someone runs into a similar issue we'll look at reconsider options then.