biigle / largo

:m: BIIGLE module to review image annotations in a regular grid
GNU General Public License v3.0
0 stars 1 forks source link

Annotation patches are grey #25

Closed mzur closed 6 years ago

mzur commented 7 years ago

We've had a few annotation patches of volume 320 (a remote volume) that were completely grey images. All patches belong to annotations that were created on 2017-04-25 between 2 pm and 6 pm. The logfiles show some errors like these on this day:

[2017-04-25 14:33:46] production.ERROR: exception 'Intervention\Image\Exception\NotReadableException' with message 'Unable to init from given binary data.' in /vol/uwi/www/bias/vendor/intervention/image/src/Intervention/Image/Gd/Decoder.php:96
Stack trace:
#0 /vol/uwi/www/bias/vendor/intervention/image/src/Intervention/Image/AbstractDecoder.php(65): Intervention\Image\Gd\Decoder->initFromBinary('\x89PNG\r\n\x1A\n\x00\x00\x00\rIHD...')
#1 /vol/uwi/www/bias/vendor/intervention/image/src/Intervention/Image/AbstractDecoder.php(287): Intervention\Image\AbstractDecoder->initFromUrl('http://plym-mar...')
#2 /vol/uwi/www/bias/vendor/intervention/image/src/Intervention/Image/AbstractDriver.php(64): Intervention\Image\AbstractDecoder->init('http://plym-mar...')
#3 /vol/uwi/www/bias/vendor/intervention/image/src/Intervention/Image/ImageManager.php(50): Intervention\Image\AbstractDriver->init('http://plym-mar...')
#4 [internal function]: Intervention\Image\ImageManager->make('http://plym-mar...')
#5 /vol/uwi/www/bias/vendor/intervention/imagecache/src/Intervention/Image/ImageCache.php(255): call_user_func_array(Array, Array)
#6 /vol/uwi/www/bias/vendor/intervention/imagecache/src/Intervention/Image/ImageCache.php(270): Intervention\Image\ImageCache->processCall(Array)
#7 /vol/uwi/www/bias/vendor/intervention/imagecache/src/Intervention/Image/ImageCache.php(316): Intervention\Image\ImageCache->process()
#8 /vol/uwi/www/bias/vendor/biigle/largo/src/Jobs/GenerateAnnotationPatch.php(138): Intervention\Image\ImageCache->get(5, true)
#9 [internal function]: Biigle\Modules\Largo\Jobs\GenerateAnnotationPatch->handle()
#10 /vol/uwi/www/bias/bootstrap/cache/compiled.php(1375): call_user_func_array(Array, Array)
#11 /vol/uwi/www/bias/bootstrap/cache/compiled.php(9947): Illuminate\Container\Container->call(Array)
#12 /vol/uwi/www/bias/bootstrap/cache/compiled.php(10062): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(Biigle\Modules\Largo\Jobs\GenerateAnnotationPatch))
#13 /vol/uwi/www/bias/bootstrap/cache/compiled.php(10040): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Biigle\Modules\Largo\Jobs\GenerateAnnotationPatch))
#14 /vol/uwi/www/bias/bootstrap/cache/compiled.php(9950): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#15 /vol/uwi/www/bias/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(47): Illuminate\Bus\Dispatcher->dispatchNow(Object(Biigle\Modules\Largo\Jobs\GenerateAnnotationPatch), NULL)
#16 /vol/uwi/www/bias/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(73): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\DatabaseJob), Array)
#17 /vol/uwi/www/bias/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(203): Illuminate\Queue\Jobs\Job->fire()
#18 /vol/uwi/www/bias/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(154): Illuminate\Queue\Worker->process('database', Object(Illuminate\Queue\Jobs\DatabaseJob), Object(Illuminate\Queue\WorkerOptions))
#19 /vol/uwi/www/bias/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(75): Illuminate\Queue\Worker->runNextJob('database', 'default', Object(Illuminate\Queue\WorkerOptions))
#20 /vol/uwi/www/bias/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(101): Illuminate\Queue\Worker->daemon('database', 'default', Object(Illuminate\Queue\WorkerOptions))
#21 /vol/uwi/www/bias/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(85): Illuminate\Queue\Console\WorkCommand->runWorker('database', 'default')
#22 [internal function]: Illuminate\Queue\Console\WorkCommand->fire()
#23 /vol/uwi/www/bias/bootstrap/cache/compiled.php(1375): call_user_func_array(Array, Array)
#24 /vol/uwi/www/bias/vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container->call(Array)
#25 /vol/uwi/www/bias/vendor/symfony/console/Command/Command.php(254): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /vol/uwi/www/bias/vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /vol/uwi/www/bias/vendor/symfony/console/Application.php(821): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 /vol/uwi/www/bias/vendor/symfony/console/Application.php(187): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 /vol/uwi/www/bias/vendor/symfony/console/Application.php(118): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#30 /vol/uwi/www/bias/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(121): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 /vol/uwi/www/bias/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#32 {main}

Our best guess is that the remote location of the volume (AWS) temporarily served malformed PNGs. Sometimes the GD decoder detected the image as malformed and threw the error, which should result in a new attempt to generate the annotation patch. But sometimes GD may not have detected the image as malformed, put it to the image cache and then generate only grey annotation patches because the image could not be read properly. All attempts to re-generate the grey annotation patches were successful so this was definitely a temporary issue.

If this problem may ever occur again, it can most probably be identified by similar error messages in the log file. Grey annotation patches can be identified by this command (executed in the largo_patches directory):

find . -type f -exec bash -c 'identify -verbose {} | grep -q "#808080 gray(128)" && echo {}' \;

(note that this command also identifies patches that rightfully contain some pixels with this color)

mzur commented 6 years ago

Closing as we can't make any progress on this. Also this will likely become obsolete with our switching to Vips.