Jump to content

Talk:Shellbox

Add topic
From mediawiki.org
Latest comment: 10 months ago by MythraWasTaken in topic Unexpected end of stream while inside of part

shellbox.php in public_html

[edit]

When I set up shellbox following the steps given, after running "composer install --no-dev", the "shellbox.php" file was found within the "public_html" directory, not in /srv/shellbox.


So if you are having trouble like I was, try changing


"Alias /shellbox /srv/shellbox/shellbox.php"

to

"Alias /shellbox /srv/shellbox/public_html/shellbox.php"

Someone who knows more than I do may want to edit the page to reflect this.

174.166.22.197 01:51, 30 July 2023 (UTC)Reply

Docker

[edit]

Where could I see the Dockerfile for docker-registry.wikimedia.org/wikimedia/mediawiki-libs-shellbox?
Alexander Mashin talk 07:08, 8 October 2023 (UTC)Reply

Hello Alexander! You can obtain the Dockerfile (actually, Dockerfile.dev) by running make Dockerfile.dev in the cloned Shellbox directory.
Alexander Mashin talk 15:30, 11 October 2023 (UTC)Reply
Thank you so much, Alexander!
Alexander Mashin talk 15:30, 11 October 2023 (UTC)Reply

Unexpected end of stream while inside of part

[edit]

I've been attempting to use shellbox for a small extension to run exiftool. Unfortunately i've been plagued with an error, that I can't quite seem to figure out, and I'm looking for any bright ideas that I maybe haven't tried. The actual error we are seeing is:


[09dd3bf660baab73cde067bf] /index.php/Special:Upload Shellbox\ShellboxError: Shellbox server error: unexpectedly reached the end of the stream while inside a part Backtrace: from /srv/mediawiki/1.43.3/document/vendor/wikimedia/shellbox/src/Client.php(182)

  1. 0 /srv/mediawiki/1.43.3/document/vendor/wikimedia/shellbox/src/Command/RemoteBoxedExecutor.php(82): Shellbox\Client->sendRequest()
  2. 1 /srv/mediawiki/1.43.3/document/vendor/wikimedia/shellbox/src/Command/BoxedExecutor.php(20): Shellbox\Command\RemoteBoxedExecutor->executeValid()
  3. 2 /srv/mediawiki/1.43.3/document/vendor/wikimedia/shellbox/src/Command/BoxedCommand.php(406): Shellbox\Command\BoxedExecutor->execute()
  4. 3 /srv/mediawiki/1.43.3/document/extensions/StripExifGPSData/StripExifGPSData.php(60): Shellbox\Command\BoxedCommand->execute()
  5. 4 /srv/mediawiki/1.43.3/document/extensions/StripExifGPSData/StripExifGPSData.php(33): StripExifGPSDataHooks::stripShellbox()
  6. 5 /srv/mediawiki/1.43.3/document/includes/HookContainer/HookContainer.php(159): StripExifGPSDataHooks::onUploadComplete()
  7. 6 /srv/mediawiki/1.43.3/document/includes/HookContainer/HookRunner.php(4158): MediaWiki\HookContainer\HookContainer->run()
  8. 7 /srv/mediawiki/1.43.3/document/includes/upload/UploadBase.php(1010): MediaWiki\HookContainer\HookRunner->onUploadComplete()
  9. 8 /srv/mediawiki/1.43.3/document/includes/specials/SpecialUpload.php(834): UploadBase->performUpload()
  10. 9 /srv/mediawiki/1.43.3/document/includes/specials/SpecialUpload.php(298): MediaWiki\Specials\SpecialUpload->processUpload()
  11. 10 /srv/mediawiki/1.43.3/document/includes/specialpage/SpecialPage.php(728): MediaWiki\Specials\SpecialUpload->execute()
  12. 11 /srv/mediawiki/1.43.3/document/includes/specialpage/SpecialPageFactory.php(1717): MediaWiki\SpecialPage\SpecialPage->run()
  13. 12 /srv/mediawiki/1.43.3/document/includes/actions/ActionEntryPoint.php(504): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
  14. 13 /srv/mediawiki/1.43.3/document/includes/actions/ActionEntryPoint.php(146): MediaWiki\Actions\ActionEntryPoint->performRequest()
  15. 14 /srv/mediawiki/1.43.3/document/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute()
  16. 15 /srv/mediawiki/1.43.3/document/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
  17. 16 {main}

I can't quite seem to figure out what the issue is, as everything looks like the documentation on this page in our configuration, and we're using the latest release of Shellbox (there doesn't seem to be any changes past lastest release that stand out to me as helping with it, but I am not certain). I've also done packet dumps, and see a complete http request coming in on the interface the container is listening on.

I've uploaded the relevant apache/dockerfile configuration here: https://gist.github.com/Mythra/e1a2f9c278bd48f10c19f7ebc55e750f , our shellbox configuration is the one mentioned on the shellbox page. If it's of any help the code that I wrote that is attempting to call this shellbox command is:

   private static function stripShellbox( LocalFile $file, array $arguments ): bool {
       $path = $file->getLocalRefPath();
       $command = MediaWikiServices::getInstance()->getShellCommandFactory()
           ->createBoxed( 'stripexifgpsdata' )
           ->disableNetwork()
           ->firejailDefaultSeccomp()
           ->routeName( 'stripexifgpsdata-strip' )
           ->params(
               '/usr/bin/exiftool',
               '-o stripped-file',
               '-gps:all=',
               'to-strip',
           )
           ->inputFileFromFile( 'to-strip', $path )
           ->outputFileToFile( 'stripped-file',  $path )
           ->includeStderr();
       return $command->execute()->getExitCode() === 0;
   }

MythraWasTaken (talk) 20:28, 24 September 2025 (UTC)Reply