Page MenuHomePhabricator

"Batch Edit" from workboards uses "?ids=X,Y,Z" which can exceed "Location" header or URL byte limits for large task sets
Closed, ResolvedPublic

Description

I can't reproduce it on this install, presumably because this install has less tasks on each workboard than we do. Navigating to https://phabricator.redacted.com/tag/redacted/?batch=all on all install returns a 502. There are no errors in the PHP logs, but I can see this in the nginx error logs:

2016/02/02 17:02:30 [error] 26958#0: *10748546 upstream sent too big header while reading response header from upstream, client: 59.100.120.194, server: phabricator.redacted.com, request: "GET /tag/redacted/?batch=all HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.socket:", host: "phabricator.redacted.com"

Event Timeline

How many tasks are you attempting to batch edit?

Well I don't choose any tasks, I guess it defaults to all objects visible on the workboard (of which there are 865).

I can't immediately reproduce this by issuing a query for 1,000 tasks, then doing "Select All > Batch Edit Selected". The page takes a couple seconds, but loads fine.

We probably should not render all of the "Selected Tasks" in the header, but I'd expect ~1K to work fine, as they do on this install.

Oh, maybe the issue is actually the redirect. Specifically, we'll end up issuing this:

Location: /maniphest/batch/?board=X&batch=1,2,3,4,...9999,1000

Presumably, nginx might not be happy about a 4KB URI in a Location header.

If that's the case, a workaround is to query for the tasks in Maniphest with page size > 865 instead, then "Select All" and "Batch Edit Selected".

Yeah, I suspect that the length of the header is the issue.

epriestley added a subscriber: swisspol.

@swisspol hit a variant of this with 1,172 tasks bumping up against an Apache URL limit in the Phacility cluster when editing from a workboard column.

epriestley renamed this task from Batch Edit tasks returns a 502 to "Batch Edit" from workboards uses "?ids=X,Y,Z" which can exceed "Location" header or URL byte limits for large task sets.Jun 13 2017, 9:57 PM

Interestingly I worked around the issue by doing the batch edit from the Maniphest search UI which is passing the selected tasks an HTTP body instead of a URL query I guess?

Yeah -- the workflow from the Maniphest side dumps all the values into inputs in the body and does a POST, I believe.

I think the best fix for this likely bumps into T5024, and is roughly to make /query/<the active query>/?columns=<the column PHID> work, although I believe there were a couple other oddities here.

T10005 is also vaguely related, although I expect this can be resolved in a narrow way without triggering a big entangled mess there.