kimai / kimai

Kimai is a web-based multi-user time-tracking application. Works great for everyone: freelancers, companies, organizations - everyone can track their times, generate reports, create invoices and do so much more. SaaS version available at https://www.kimai.cloud
https://www.kimai.org
GNU Affero General Public License v3.0
3.15k stars 550 forks source link

Invalid or uninitialized Zip object #3608

Closed BeckeBauer closed 1 year ago

BeckeBauer commented 1 year ago

Describe the issue

After upgrading to 1.28.1, I got the following error when I tried to create an invoice

php.CRITICAL: Uncaught Error: Invalid or uninitialized Zip object {"exception":"[object] (ValueError(code: 0): Invalid or uninitialized Zip object at /kimai2/vendor/phpoffice/phpword/src/PhpWord/Shared/ZipArchive.php:115)"} []
request.CRITICAL: Uncaught PHP Exception ValueError: "Invalid or uninitialized Zip object" at /kimai2/vendor/phpoffice/phpword/src/PhpWord/Shared/ZipArchive.php line 115 {"exception":"[object] (ValueError(code: 0): Invalid or uninitialized Zip object at /kimai2/vendor/phpoffice/phpword/src/PhpWord/Shared/ZipArchive.php:115)"} []

any idea how to fix it?

I already tried

Kimai version

1.28.1

Which PHP version are you using?

8.0

How do you run Kimai?

Self-Hosted

Steps to reproduce the behavior

  1. Go to '...'
  2. Scroll down to '...'
  3. Click on '...'
  4. See error

Logfile

No response

Screenshots

No response

Additional context

Device: [Ubuntu Laptop 16 inch, Windows Desktop 27 inch, iPhone 6s] Browser [e.g. Firefox 81, Chrome 85, Safari 14]

kevinpapst commented 1 year ago

Does it happen in the demo as well?

BeckeBauer commented 1 year ago

That's a trick question - I have not tried it in the demo but I assume it works flawless... Therefore, problem most probably caused by my own server, so I am closing here...

kevinpapst commented 1 year ago

I am just asking that, because testing it takes time and result might be related to your custom invoice template, which I cannot test at all. So can you confirm it is working on the demo?

BeckeBauer commented 1 year ago

As said before, I have not checked the demo but I found the issue: very strange "misbehaviour" of my synology server: After I changed the content of my invoice-template.docx to check out the new ${invoice.first} ${invoice.last} variables, it was no longer listed in the invoice templates / invoice document as "Microsoft Word (docx)" but as a "Docx@SynoResource".

image

Could fix it by merely moving the changed invoice-template.docx out of my template folder and back in... so, no Kimai issue at all ... sorry for creating bug report before fully examine the issue on my side...

kevinpapst commented 1 year ago

Thanks for the update!

Sounds weird, true. Glad it was rather easy to solve 👍

github-actions[bot] commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. If you use Kimai on a daily basis, please consider donating to support further development of Kimai.