Page MenuHomePhabricator

"400 Bad Request" errors from Aphlict server
Closed, ResolvedPublic

Description

I've got a bunch of these showing up in our error logs:

[17-Jul-2014 13:37:35 UTC] [2014-07-17 23:37:35] EXCEPTION: (HTTPFutureResponseStatusHTTP) [HTTP/400] 
400 Bad Request at [<phutil>/src/future/http/BaseHTTPFuture.php:337]
[17-Jul-2014 13:37:35 UTC]   #0 BaseHTTPFuture::parseRawHTTPResponse(string) called at [<phutil>/src/future/http/HTTPSFuture.php:371]
[17-Jul-2014 13:37:35 UTC]   #1 HTTPSFuture::isReady() called at [<phutil>/src/future/Future.php:39]
[17-Jul-2014 13:37:35 UTC]   #2 Future::resolve() called at [<phutil>/src/future/http/BaseHTTPFuture.php:277]
[17-Jul-2014 13:37:35 UTC]   #3 BaseHTTPFuture::resolvex() called at [<phabricator>/src/applications/notification/client/PhabricatorNotificationClient.php:47]
[17-Jul-2014 13:37:35 UTC]   #4 PhabricatorNotificationClient::postMessage(array) called at [<phabricator>/src/applications/notification/client/PhabricatorNotificationClient.php:34]
[17-Jul-2014 13:37:35 UTC]   #5 PhabricatorNotificationClient::tryToPostMessage(array) called at [<phabricator>/src/applications/feed/PhabricatorFeedStoryPublisher.php:182]
[17-Jul-2014 13:37:35 UTC]   #6 PhabricatorFeedStoryPublisher::sendNotification(integer) called at [<phabricator>/src/applications/feed/PhabricatorFeedStoryPublisher.php:115]
[17-Jul-2014 13:37:35 UTC]   #7 PhabricatorFeedStoryPublisher::publish() called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2140]
[17-Jul-2014 13:37:35 UTC]   #8 PhabricatorApplicationTransactionEditor::publishFeedStory(ManiphestTask, array, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:751]
[17-Jul-2014 13:37:35 UTC]   #9 PhabricatorApplicationTransactionEditor::applyTransactions(ManiphestTask, array) called at [<phabricator>/src/applications/maniphest/controller/ManiphestTaskEditController.php:316]
[17-Jul-2014 13:37:35 UTC]   #10 ManiphestTaskEditController::processRequest() called at [<phabricator>/webroot/index.php:95]

Revisions and Commits

Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision

Event Timeline

joshuaspence assigned this task to epriestley.
joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence updated the task description. (Show Details)
joshuaspence added a project: Phabricator.
joshuaspence added a subscriber: joshuaspence.

Ok, I managed to grab some of the data that is causing the 400:

{"key":"6037027907895705086","type":"notification","subscribers":{"0":"PHID-USER-csuh5hwlaf2uzs4k7yy5","3":"PHID-USER-tdwbgfwx7ryqgchakchq","4":"PHID-USER-hfenohlvucsbthy2su73","5":"PHID-USER-fgexdupj4ha47qlb7cgh","6":"PHID-USER-mjjldzhrwv4j3qj3thqw","7":"PHID-USER-3u5vybbidp7ael5ebh6z"}}

I'd guess we need to array_values() the subscribers list.

(So it gets JSON encoded as an array instead of an object.)

I'm not sure that is the issue. I'll have a further look from the NodeJS side and see what is happening.

Looking at the code, you're probably right.

Oh, actually, maybe it is? I think we'll end up calling (object).filter(...) in AphlictListener.isSubscribedToAny(), which probably throws, producing the 400.

Yeah:

[Thu Jul 17 2014 13:59:18 GMT-0700 (PDT)] Bad Request: TypeError: Object [object Object] has no method 'filter'

Closed by commit rP6bf4ec97d563.

joshuaspence added a commit: Restricted Diffusion Commit.Jul 17 2014, 11:02 PM
joshuaspence added a revision: Restricted Differential Revision.Jul 17 2014, 11:08 PM
joshuaspence renamed this task from "400 Bad Request" errors to "400 Bad Request" errors from Aphlict server.Jul 17 2014, 11:08 PM
joshuaspence added a project: Aphlict.
joshuaspence added a commit: Restricted Diffusion Commit.Jul 17 2014, 11:20 PM