Page MenuHomePhabricator

Shellbox getFileContents dooesn't return the file in production CLI
Closed, InvalidPublic

Description

I had to revert this patch: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/720143 because when running mwscript refreshImageMetadata.php --wiki=testcommonswiki --mediatype=OFFICE --verbose --mime 'image/*' --force --batch-size 1 --sleep 1 the result was always empty metadata.

By putting var_dump here and there, it turned out that command result in shellbox does not communicate value of the file back to php and it's always null (replace the shell file with echo 'foo' > dump) when ran in CLI. It can be an issue specific to production though. I didn't have the issue in my localhost/beta cluster but worth double checking

Event Timeline

Most likely the problem was that the file wasn't there. Shellbox can only send a file if it exists.

replace the shell file with echo 'foo' > dump

An incorrect wrapper configuration can break even such a simple shell command.

DjVuImage::retrieveMetaData() was eventually ported to Shellbox in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/979386 , and CLI mode was tested and fixed as part of T352515. So files are certainly being sent to CLI mode clients now.