Page MenuHomePhabricator
Paste P5158

(An Untitled Masterwork)
ActivePublic

Authored by Paladox on Mar 29 2017, 9:10 PM.
Tags
None
Referenced Files
F7083357:
Mar 29 2017, 9:10 PM
Subscribers
[2017-03-29 21:09:18] EXCEPTION: (HTTPFutureHTTPResponseStatus) [HTTP/406]
{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406} at [<phutil>/src/future/http/BaseHTTPFuture.php:339]
arcanist(), phabricator(), phutil(), security(), sprint(), wmf-ext-misc(head=wmf/stable, ref.wmf/stable=ef53ff4b0a99)
#0 BaseHTTPFuture::parseRawHTTPResponse(string) called at [<phutil>/src/future/http/HTTPSFuture.php:418]
#1 HTTPSFuture::isReady() called at [<phutil>/src/future/Future.php:37]
#2 Future::resolve() called at [<phutil>/src/future/http/BaseHTTPFuture.php:279]
#3 BaseHTTPFuture::resolvex() called at [<phabricator>/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php:517]
#4 PhabricatorElasticFulltextStorageEngine::executeRequest(PhabricatorElasticSearchHost, string, array) called at [<phabricator>/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php:313]
#5 PhabricatorElasticFulltextStorageEngine::indexExists() called at [<phabricator>/src/applications/search/management/PhabricatorSearchManagementInitWorkflow.php:32]
#6 PhabricatorSearchManagementInitWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:441]
#7 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:333]
#8 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/search/manage_search.php:21]
root@phabricator:/srv/phab/phabricator#

Event Timeline

@Paladox: Try this?

diff --git a/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php b/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php
index aa966ca..60c6185 100644
--- a/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php
+++ b/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php
@@ -550,7 +550,11 @@ class PhabricatorElasticFulltextStorageEngine
 
     $uri = $host->getURI($path);
     $data = phutil_json_encode($data);
-    $future = new HTTPSFuture($uri, $data);
+    $future = new HTTPSFuture($uri);
+
+    $future->addHeader('Content-Type', 'application/json');
+    $future->write($data);
+
     if ($method != 'GET') {
       $future->setMethod($method);
     }
diff --git a/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php b/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php
index 60c6185..2e456ec 100644
--- a/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php
+++ b/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php
@@ -550,10 +550,8 @@ class PhabricatorElasticFulltextStorageEngine
 
     $uri = $host->getURI($path);
     $data = phutil_json_encode($data);
-    $future = new HTTPSFuture($uri);
-
+    $future = new HTTPSFuture($uri, $data);
     $future->addHeader('Content-Type', 'application/json');
-    $future->write($data);
 
     if ($method != 'GET') {
       $future->setMethod($method);