[Wikidata-bugs] [Maniphest] [Commented On] T211806: Passing in the "body" request option as an array to send a POST request has been deprecated

2018-12-12 Thread Stashbot
Stashbot added a comment.
Mentioned in SAL (#wikimedia-operations) [2018-12-13T00:52:48Z]  Synchronized php-1.33.0-wmf.8/includes/http/GuzzleHttpRequest.php: T211806 (duration: 00m 51s)TASK DETAILhttps://phabricator.wikimedia.org/T211806EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: StashbotCc: Stashbot, gerritbot, Legoktm, Reedy, BPirkle, Aklapper, TerraCodes, Liuxinyu970226, zeljkofilipin, Eladio.15, CucyNoiD, Nandana, NebulousIris, Gaboe420, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Lahi, Gq86, Baloch007, Darkminds3113, Bsandipan, Lordiis, GoranSMilovanovic, Adik2382, Nakohdo, Th3d3v1ls, Ramalepe, Liugev6, QZanden, LawExplorer, Lewizho99, Maathavan, Reasno, _jensen, D3r1ck01, Jonas, Wikidata-bugs, aude, jayvdb, Lydia_Pintscher, Mbch331, Jay8g, Krenair___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T211806: Passing in the "body" request option as an array to send a POST request has been deprecated

2018-12-12 Thread gerritbot
gerritbot added a comment.
Change 479362 merged by jenkins-bot:
[mediawiki/core@wmf/1.33.0-wmf.8] Fix guzzle InvalidArgumentException when body is passed as an array

https://gerrit.wikimedia.org/r/479362TASK DETAILhttps://phabricator.wikimedia.org/T211806EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: gerritbotCc: gerritbot, Legoktm, Reedy, BPirkle, Aklapper, TerraCodes, Liuxinyu970226, zeljkofilipin, Eladio.15, CucyNoiD, Nandana, NebulousIris, Gaboe420, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Lahi, Gq86, Baloch007, Darkminds3113, Bsandipan, Lordiis, GoranSMilovanovic, Adik2382, Nakohdo, Th3d3v1ls, Ramalepe, Liugev6, QZanden, LawExplorer, Lewizho99, Maathavan, Reasno, _jensen, D3r1ck01, Jonas, Wikidata-bugs, aude, jayvdb, Lydia_Pintscher, Mbch331, Jay8g, Krenair___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T211806: Passing in the "body" request option as an array to send a POST request has been deprecated

2018-12-12 Thread gerritbot
gerritbot added a comment.
Change 479359 merged by jenkins-bot:
[mediawiki/core@master] Fix guzzle InvalidArgumentException when body is passed as an array

https://gerrit.wikimedia.org/r/479359TASK DETAILhttps://phabricator.wikimedia.org/T211806EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: gerritbotCc: gerritbot, Legoktm, Reedy, BPirkle, Aklapper, TerraCodes, Liuxinyu970226, zeljkofilipin, Eladio.15, CucyNoiD, Nandana, NebulousIris, Gaboe420, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Lahi, Gq86, Baloch007, Darkminds3113, Bsandipan, Lordiis, GoranSMilovanovic, Adik2382, Nakohdo, Th3d3v1ls, Ramalepe, Liugev6, QZanden, LawExplorer, Lewizho99, Maathavan, Reasno, _jensen, D3r1ck01, Jonas, Wikidata-bugs, aude, jayvdb, Lydia_Pintscher, Mbch331, Jay8g, Krenair___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T211806: Passing in the "body" request option as an array to send a POST request has been deprecated

2018-12-12 Thread gerritbot
gerritbot added a comment.
Change 479362 had a related patch set uploaded (by Reedy; owner: BPirkle):
[mediawiki/core@wmf/1.33.0-wmf.8] Fix guzzle InvalidArgumentException when body is passed as an array

https://gerrit.wikimedia.org/r/479362TASK DETAILhttps://phabricator.wikimedia.org/T211806EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: gerritbotCc: gerritbot, Legoktm, Reedy, BPirkle, Aklapper, TerraCodes, Liuxinyu970226, zeljkofilipin, Eladio.15, CucyNoiD, Nandana, NebulousIris, Gaboe420, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Lahi, Gq86, Baloch007, Darkminds3113, Bsandipan, Lordiis, GoranSMilovanovic, Adik2382, Nakohdo, Th3d3v1ls, Ramalepe, Liugev6, QZanden, LawExplorer, Lewizho99, Maathavan, Reasno, _jensen, D3r1ck01, Jonas, Wikidata-bugs, aude, jayvdb, Lydia_Pintscher, Mbch331, Jay8g, Krenair___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T211806: Passing in the "body" request option as an array to send a POST request has been deprecated

2018-12-12 Thread gerritbot
gerritbot added a comment.
Change 479359 had a related patch set uploaded (by BPirkle; owner: BPirkle):
[mediawiki/core@master] Fix guzzle InvalidArgumentException when body is passed as an array

https://gerrit.wikimedia.org/r/479359TASK DETAILhttps://phabricator.wikimedia.org/T211806EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: gerritbotCc: gerritbot, Legoktm, Reedy, BPirkle, Aklapper, TerraCodes, Liuxinyu970226, zeljkofilipin, Eladio.15, Nandana, Lahi, Gq86, GoranSMilovanovic, Nakohdo, QZanden, LawExplorer, Reasno, _jensen, D3r1ck01, Jonas, Wikidata-bugs, aude, jayvdb, Lydia_Pintscher, Mbch331, Jay8g, Krenair___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T211806: Passing in the "body" request option as an array to send a POST request has been deprecated

2018-12-12 Thread BPirkle
BPirkle added a comment.
This looks more promising:

			if ( is_array( $postData )  ) {
$this->guzzleOptions['form_params'] = $postData;
			} else {
$this->guzzleOptions['body'] = $postData;
			}

Per http://docs.guzzlephp.org/en/stable/quickstart.html, Guzzle will automatically set Content-Type to application/x-www-form-urlencoded .  This happens within Guzzle's Client.php on line 314.  This mirrors curl's behavior with CURLOPT_POSTFIELDS, which we previously used in CurlHttpRequest.php.  Per https://curl.haxx.se/libcurl/c/CURLOPT_POSTFIELDS.html, if CURLOPT_POSTFIELDS is set :

This POST is a normal application/x-www-form-urlencoded kind (and libcurl will set that Content-Type by default when this option is used), which is commonly used by HTML forms.

So the normal case of sending an array of POST fields should work happily, and callers can also override as needed.  I'm running unit tests locally right now, but of course, that only goes so far (else we wouldn't be here in the first place).

Worst case, if this doesn't work out, we can get the train unblocked by modifying HttpRequestFactory::create to only use guzzle if explicitly requested.  The CurlHttpRequest and PhpHttpRequest code remains in the codebase.TASK DETAILhttps://phabricator.wikimedia.org/T211806EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: BPirkleCc: Legoktm, Reedy, BPirkle, Aklapper, TerraCodes, Liuxinyu970226, zeljkofilipin, Eladio.15, Nandana, Lahi, Gq86, GoranSMilovanovic, Nakohdo, QZanden, LawExplorer, Reasno, _jensen, D3r1ck01, Jonas, Wikidata-bugs, aude, jayvdb, Lydia_Pintscher, Mbch331, Jay8g, Krenair___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T211806: Passing in the "body" request option as an array to send a POST request has been deprecated

2018-12-12 Thread BPirkle
BPirkle added a comment.
Reproduced the exception locally using trivial test data:

$params = [ 'foo' => 'bar' ];
$response = Http::post(
	'http://www.example.net',
	[ 'postData' => $params ]
);

Then confirmed the exception disappeared per the suggestion from stack overflow, by adding this to GuzzleHttpRequest.php just before we use $postData:

			if ( is_array( $postData) ) {
$postData = json_encode( $postData );
			}

Now looking at more complex cases, and confirming actual functionality rather than just lack of an exception.TASK DETAILhttps://phabricator.wikimedia.org/T211806EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: BPirkleCc: Legoktm, Reedy, BPirkle, Aklapper, TerraCodes, Liuxinyu970226, zeljkofilipin, Eladio.15, Nandana, Lahi, Gq86, GoranSMilovanovic, Nakohdo, QZanden, LawExplorer, Reasno, _jensen, D3r1ck01, Jonas, Wikidata-bugs, aude, jayvdb, Lydia_Pintscher, Mbch331, Jay8g, Krenair___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T211806: Passing in the "body" request option as an array to send a POST request has been deprecated

2018-12-12 Thread BPirkle
BPirkle added a comment.
GuzzleHttpRequest.php line 94, we are indeed setting the 'body' field and trusting that $postData was happily passed to the constructor by calling code.  Fiddling...TASK DETAILhttps://phabricator.wikimedia.org/T211806EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: BPirkleCc: Legoktm, Reedy, BPirkle, Aklapper, TerraCodes, Liuxinyu970226, zeljkofilipin, Eladio.15, Nandana, Lahi, Gq86, GoranSMilovanovic, Nakohdo, QZanden, LawExplorer, Reasno, _jensen, D3r1ck01, Jonas, Wikidata-bugs, aude, jayvdb, Lydia_Pintscher, Mbch331, Jay8g, Krenair___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T211806: Passing in the "body" request option as an array to send a POST request has been deprecated

2018-12-12 Thread Reedy
Reedy added a comment.
https://stackoverflow.com/a/38060763 seems very likely as to what's going on, especially as we're doing json stuff in jsonconfig (well, duh)

Note in Guzzle V6.0+, another source of getting the following error may be incorrect use of JSON as an array:
Passing in the "body" request option as an array to send a POST request has been deprecated. Please use the "form_params" request option to send a application/x-www-form-urlencoded request, or a the "multipart" request option to send a multipart/form-data request.TASK DETAILhttps://phabricator.wikimedia.org/T211806EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: ReedyCc: Legoktm, Reedy, BPirkle, Aklapper, TerraCodes, Liuxinyu970226, zeljkofilipin, Eladio.15, Nandana, Lahi, Gq86, GoranSMilovanovic, Nakohdo, QZanden, LawExplorer, Reasno, _jensen, D3r1ck01, Jonas, Wikidata-bugs, aude, jayvdb, Lydia_Pintscher, Mbch331, Jay8g, Krenair___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T211806: Passing in the "body" request option as an array to send a POST request has been deprecated

2018-12-12 Thread zeljkofilipin
zeljkofilipin added a comment.
Do you have an estimate on the numbers when move group2 to wmf.8? If you estimate that the number will remain low, then I guess this is not blocking the train. If you don't have an estimate, I would be reluctant to move the train forward and this would still block the train. All train blockers have UBN priority.TASK DETAILhttps://phabricator.wikimedia.org/T211806EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: zeljkofilipinCc: Legoktm, Reedy, BPirkle, Aklapper, TerraCodes, Liuxinyu970226, zeljkofilipin, Eladio.15, Nandana, Lahi, Gq86, GoranSMilovanovic, Nakohdo, QZanden, LawExplorer, Reasno, _jensen, D3r1ck01, Jonas, Wikidata-bugs, aude, jayvdb, Lydia_Pintscher, Mbch331, Jay8g, Krenair___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T211806: Passing in the "body" request option as an array to send a POST request has been deprecated

2018-12-12 Thread Reedy
Reedy added a comment.
84 in the last hour... I don't think this is unbreak now, but is probably at least HighTASK DETAILhttps://phabricator.wikimedia.org/T211806EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: ReedyCc: Legoktm, Reedy, BPirkle, Aklapper, TerraCodes, Liuxinyu970226, zeljkofilipin, Eladio.15, Nandana, Lahi, Gq86, GoranSMilovanovic, Nakohdo, QZanden, LawExplorer, Reasno, _jensen, D3r1ck01, Jonas, Wikidata-bugs, aude, jayvdb, Lydia_Pintscher, Mbch331, Jay8g, Krenair___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs