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