DPDBeNeLux / magento-DPD_Shipping

Let op: er zijn nieuwe DPD plugins (BETA versie) beschikbaar met belangrijke nieuwe functionaliteiten. De oude plugins zullen na Brexit niet meer goed functioneren, download daarom de nieuwe versie op Github/DPDconnect.
11 stars 10 forks source link

fclose() PHP warning #35

Open hostep opened 9 years ago

hostep commented 9 years ago

Hi

We notice a couple of lines in our var/log/system.log Magento file which look like this:

fclose(): 437 is not a valid stream resource/path/to/our/project/lib/Varien/Io/File.php

Has anyone else encountered these? It happens when a pdf file is created in the filesystem. The pdf file is actually generated and nothing else goes wrong, just this warning in the log file.

I can get rid of them if I remove this line: https://github.com/DPDBeNeLux/magento-DPD_Shipping/blob/8216ce0bd1f6358f39dffca40595cd4af4506aaa/app/code/community/DPD/Shipping/Helper/Data.php#L133

But that's probably not the best solution.

If anyone has any idea what can cause this, please let me know.

Magento version: 1.9.1.0 (fully patched) PHP version: 5.5.27 Filesystem: Mac OS Extended (Case-sensitive, Journaled)

Thanks!

mvgucht commented 9 years ago

I would not remove the streamclose line. but I can't figure out why you get an error. I think this is a php problem.

mvgucht commented 8 years ago

Are you sure that the pdf are being written to the file system? because it could be that the streamreader fails because it doesn't have permission to write to the folder/file.

hostep commented 8 years ago

Yes, the files are being written. Everything works perfectly fine, except for that one warning. Very strange. We have it on our local developer machines running Mac OS X and also on the actual servers it runs on (staging & production, which are different machines) running Debian.

See: dpd-orders-flose (the timestamps are at a one hour difference because the Magento logs are logged in GMT time and the server itself runs in GMT+1 time)

You don't see this happen yourself?

mvgucht commented 8 years ago

I don't see this happen no, but we should add a check before the close. then this issue wouldn't show anymore.