Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An unhandled exception has been thrown while running #506

Closed
thehijacker opened this issue Aug 27, 2024 · 4 comments · Fixed by nextcloud/server#47509
Closed

An unhandled exception has been thrown while running #506

thehijacker opened this issue Aug 27, 2024 · 4 comments · Fixed by nextcloud/server#47509
Assignees

Comments

@thehijacker
Copy link

Hello.

Script never finishes. I get this crash:

2024-08-27T04:50:23+00:00 Scanning folder /laraeva/files/Shared/Photos Ati/2015/2015-10-27
An unhandled exception has been thrown:
TypeError: OC_Image::getOrientation(): Return value must be of type int, string returned in /var/www/html/lib/private/legacy/OC_Image.php:485
Stack trace:
#0 /var/www/html/lib/private/legacy/OC_Image.php(519): OC_Image->getOrientation()
#1 /var/www/html/lib/private/Preview/Image.php(52): OC_Image->fixOrientation()
#2 /var/www/html/lib/private/Preview/GeneratorHelper.php(64): OC\Preview\Image->getThumbnail(Object(OC\Files\Node\File), 2048, 2048)
#3 /var/www/html/lib/private/Preview/Generator.php(361): OC\Preview\GeneratorHelper->getThumbnail(Object(OC\Preview\JPEG), Object(OC\Files\Node\File), 2048, 2048)
#4 /var/www/html/lib/private/Preview/Generator.php(337): OC\Preview\Generator->generateProviderPreview(Object(OC\Files\SimpleFS\SimpleFolder), Object(OC\Files\Node\File), 2048, 2048, false, true, 'image/jpeg', '')
#5 /var/www/html/lib/private/Preview/Generator.php(143): OC\Preview\Generator->getMaxPreview(Object(OC\Files\SimpleFS\SimpleFolder), Array, Object(OC\Files\Node\File), 'image/jpeg', '')
#6 /var/www/html/lib/private/PreviewManager.php(211): OC\Preview\Generator->generatePreviews(Object(OC\Files\Node\File), Array, 'image/jpeg')
#7 /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php(232): OC\PreviewManager->generatePreviews(Object(OC\Files\Node\File), Array)
#8 /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php(214): OCA\PreviewGenerator\Command\Generate->parseFile(Object(OC\Files\Node\File))
#9 /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php(212): OCA\PreviewGenerator\Command\Generate->parseFolder(Object(OC\Files\Node\Folder), Array)
#10 /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php(212): OCA\PreviewGenerator\Command\Generate->parseFolder(Object(OC\Files\Node\Folder), Array)
#11 /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php(212): OCA\PreviewGenerator\Command\Generate->parseFolder(Object(OC\Files\Node\Folder), Array)
#12 /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php(212): OCA\PreviewGenerator\Command\Generate->parseFolder(Object(OC\Files\Node\Folder), Array)
#13 /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php(192): OCA\PreviewGenerator\Command\Generate->parseFolder(Object(OC\Files\Node\Folder), Array)
#14 /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php(138): OCA\PreviewGenerator\Command\Generate->generateUserPreviews(Object(OC\User\User))
#15 /var/www/html/lib/private/User/Manager.php(666): OCA\PreviewGenerator\Command\Generate->OCA\PreviewGenerator\Command\{closure}(Object(OC\User\User))
#16 /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php(137): OC\User\Manager->callForSeenUsers(Object(Closure))
#17 /var/www/html/3rdparty/symfony/console/Command/Command.php(298): OCA\PreviewGenerator\Command\Generate->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/html/3rdparty/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /var/www/html/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand(Object(OCA\PreviewGenerator\Command\Generate), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /var/www/html/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /var/www/html/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /var/www/html/console.php(102): OC\Console\Application->run()
#23 /var/www/html/occ(11): require_once('/var/www/html/c...')
#24 {main}

Any idea what and where to look to debug this?

@thehijacker
Copy link
Author

I have manualy opened and saved all the problematic files and generation went on. They were images from a bathroom tile preview generator.

@st3iny
Copy link
Member

st3iny commented Aug 27, 2024

It would be helpful if you could share the image. Just in case it is not private.

@thehijacker
Copy link
Author

thehijacker commented Aug 27, 2024

Not private. Just layout of our bathroom from the shop. Here are few of them that caused that error. I have opened them in Paint.NET, saved and reuploaded.

So far no new issues and it slowly generates all previews:

2024-08-27T07:30:42+00:00 Scanning folder /admin/files/Photos/2016/2016-06-10
2024-08-27T07:30:47+00:00 Scanning folder /admin/files/Photos/2016/2016-06-11
2024-08-27T07:31:55+00:00 Scanning folder /admin/files/Photos/2016/2016-06-12

Here is one file:

kralj_2_kopalnica_zarja-01

Not sure if github changes anything in uploaded images. But here are also few more zipped:

https://upload.kralj.top/u/jFk5hA.zip

Great addon for Nextcloud by the way. Switched from Immich and Seafile to Nextcloud with Memories. Loving it so far, but scrolling down too far and server CPU went up to 100% fast. Hoping pregenerating images will help.

@st3iny
Copy link
Member

st3iny commented Aug 27, 2024

Thanks a lot! I was able to confirm that my fix solves your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants