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

TypeError: Unsupported operand types: array & float #200

Open
bcutter opened this issue Jan 19, 2024 · 4 comments
Open

TypeError: Unsupported operand types: array & float #200

bcutter opened this issue Jan 19, 2024 · 4 comments
Labels
1. to develop bug Something isn't working

Comments

@bcutter
Copy link

bcutter commented Jan 19, 2024

After trying to create a ZIP archive from a folder name "@ABCTEST2024", the creation process fails. Same for other attemps with a) a single file and b) a set of single files.

ZIP files are created, but empty (size of 0 KB).

Let me know which information is needed. Does this app rely on 64 bit OS maybe?

[files_zip] Fehler: TypeError: Unsupported operand types: array & float at <<closure>>

 0. /var/www/nextcloud/3rdparty/deepdiver/zipstreamer/src/ZipStreamer.php line 387
    ZipStreamer\pack64le()
 1. /var/www/nextcloud/3rdparty/deepdiver/zipstreamer/src/ZipStreamer.php line 396
    ZipStreamer\ZipStreamer->buildZip64ExtendedInformationField()
 2. /var/www/nextcloud/3rdparty/deepdiver/zipstreamer/src/ZipStreamer.php line 343
    ZipStreamer\ZipStreamer->buildLocalFileHeader()
 3. /var/www/nextcloud/3rdparty/deepdiver/zipstreamer/src/ZipStreamer.php line 212
    ZipStreamer\ZipStreamer->beginFile()
 4. /var/www/nextcloud/apps/files_zip/lib/Service/ZipService.php line 212
    ZipStreamer\ZipStreamer->addFileFromStream()
 5. /var/www/nextcloud/apps/files_zip/lib/Service/ZipService.php line 192
    OCA\FilesZip\Service\ZipService->addFile()
 6. /var/www/nextcloud/apps/files_zip/lib/Service/ZipService.php line 206
    OCA\FilesZip\Service\ZipService->addNode()
 7. /var/www/nextcloud/apps/files_zip/lib/Service/ZipService.php line 188
    OCA\FilesZip\Service\ZipService->addFolder()
 8. /var/www/nextcloud/apps/files_zip/lib/Service/ZipService.php line 131
    OCA\FilesZip\Service\ZipService->addNode()
 9. /var/www/nextcloud/apps/files_zip/lib/BackgroundJob/ZipJob.php line 68
    OCA\FilesZip\Service\ZipService->zip()
10. /var/www/nextcloud/lib/public/BackgroundJob/Job.php line 81
    OCA\FilesZip\BackgroundJob\ZipJob->run()
11. /var/www/nextcloud/lib/public/BackgroundJob/QueuedJob.php line 57
    OCP\BackgroundJob\Job->start()
12. /var/www/nextcloud/lib/public/BackgroundJob/QueuedJob.php line 47
    OCP\BackgroundJob\QueuedJob->start()
13. /var/www/nextcloud/cron.php line 152
    OCP\BackgroundJob\QueuedJob->execute()

at 2024-01-19T21:15:04+01:00

By the way needing to wait for the cron run is a big downside of this app (5 minutes can be a long time).
Why not start instantly with creation, especially when there's a ZIP queue and no other progress is running currently?

@joshtrichards
Copy link
Member

Does this app rely on 64 bit OS maybe?

Yes, it seems so:

'zip64' => true,

In the zip mode that is built into server we have special handling, but not in Zipper:

https://github.com/nextcloud/server/blob/8a13f284765bd4606984e7d925c32ae6e82b8a27/lib/private/Streamer.php#L79-L80

@joshtrichards joshtrichards added bug Something isn't working 1. to develop labels Oct 31, 2024
@bcutter
Copy link
Author

bcutter commented Oct 31, 2024

Yes, it seems so:

What a pity. Many hosts serving NC still run on 32 bit OS.

For me therefore this was a "okay, great app but not working so uninstalled & bye" conclusion unfortunately.

@joshtrichards
Copy link
Member

joshtrichards commented Oct 31, 2024

Actually looking again this may have been fixed when the ZipStreamer dependency was upgraded. That didn't happen until after your report (except in the initial v29 release). At this point all current maintenance releases of Nc Server v28-v30 should have the fix from DeepDiver1975/PHPZipStreamer#11 in place.

If you're able, I'd be interested in your feedback if it works without this error now for you.

If not, I'll do a PR to at least force zip32 mode on 32-bit systems.

Note to self (if 32-bit seems to be working again): revert 44c7531

@bcutter
Copy link
Author

bcutter commented Nov 2, 2024

I tried to test it by re-enabling the app and patching Streamer.php following https://github.com/nextcloud/server/pull/49035/files.

Interestingly right after re-enabling the app (prior to patching the file) old notifications from the tests back then came up again:
Image

Anyway, after patching Streamer.php I created few zip files successfully.

But: then I reverted the changes in Streamer.php and created (same as well as different) zip files again - and it still worked. --> ?!?

No idea if some kind of caching is in place here or something has been fixed in the last months (this issue is ooooooold, isn't it?) - currently running NC v28.0.11 and Zipper v2.1.0, but this is what I've experienced. And yes, the 5 minutes wait is completely annoying - especially when you're waiting (like during testing but also in every day use) for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants