Page MenuHomePhabricator

Stacktrace on copy-by-url upload
Closed, ResolvedPublic

Description

With the following config:

$wgGroupPermissions['*']['upload'] = true;
$wgGroupPermissions['*']['reupload'] = true;
$wgGroupPermissions['*']['reupload-shared'] = true;
$wgGroupPermissions['*']['upload_by_url'] = true;
$wgAllowCopyUploads = true;
$wgShowExceptionDetails = true;

attempting a upload-by-url fails with the following params:

filename=robots.txt
url=http://en.wikipedia.org/robots.txt

The backtrace is returned is:

<?xml version="1.0"?><p>Internal error in ApiFormatXml::recXmlPrint: (allowed, ...) has integer keys without _element value. Use ApiResult::setIndexedTagName().</p><p>Backtrace:</p><p>#0 .../includes/api/ApiBase.php(1242): wfDebugDieBacktrace('Internal error ...')<br />
#1 .../includes/api/ApiFormatXml.php(160): ApiBase::dieDebug('ApiFormatXml::r...', '(allowed, ...) ...')<br />
#2 .../includes/api/ApiFormatXml.php(175): ApiFormatXml::recXmlPrint('allowed', Array, NULL)<br />
#3 .../includes/api/ApiFormatXml.php(175): ApiFormatXml::recXmlPrint('error', Array, NULL)<br />
#4 .../includes/api/ApiFormatXml.php(85): ApiFormatXml::recXmlPrint('api', Array, NULL, false)<br />
#5 .../includes/api/ApiMain.php(737): ApiFormatXml-&gt;execute()<br />
#6 .../includes/api/ApiMain.php(392): ApiMain-&gt;printResult(true)<br />
#7 .../includes/api/ApiMain.php(347): ApiMain-&gt;executeActionWithErrorHandling()<br />
#8 .../api.php(117): ApiMain-&gt;execute()<br />
#9 {main}</p>

Version: 1.20.x
Severity: normal
URL: need-phpunit-test

Details

Reference
bz32204
TitleReferenceAuthorSource BranchDest Branch
Revert rPHEX705c52059f655d6a0b8fddee60e9745b287e7db0repos/phabricator/extensions!27aklapperT342041differentialCustomwmf/stable
Upgrade configuration to more modern defaultsrepos/design-systems/CodexExample!3egardnerupdate-configmain
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:01 AM
bzimport set Reference to bz32204.
bzimport added a subscriber: Unknown Object (MLST).

Please include a minimal script or command-line to reproduce to the error.

  • Bug 32194 has been marked as a duplicate of this bug. ***

I think this has been fixed. I can't repro after after svn upping.

I am able to see this error on master.

(In reply to comment #4)

I am able to see this error on master.

Can you include the the request params to reproduce? Or the stacktrace?

Url upload for txt in the first description gives code=filetype-banned, info=Filetype not permitted: txt, filetype=txt

Works for jpg from commons to localhost

Anomie claimed this task.
Anomie subscribed.

The particular error reported here would have been fixed by Gerrit change 16040. If there is another similar error as suggested in T34204#368940, it should be reported as a new bug.

I also note that Gerrit change 182858 will fix this entire class of errors, as it removes the error condition from ApiFormatXml in favor of it choosing an arbitrary a value for the indexed tag name.