Uncaught ValueError: fread() in functions_download.php

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
Gambid
Registered User
Posts: 15
Joined: Fri Jul 22, 2011 10:35 am

Uncaught ValueError: fread() in functions_download.php

Post by Gambid »

Had a look at my logs recently and I saw a huge bunch of Fatal Errors all related to the same location in the phpbb installation.

Code: Select all

"PHP message: PHP Fatal error:  Uncaught ValueError: fread(): Argument #2 ($length) must be greater than 0 in /includes/functions_download.php:276"
"Stack trace:"
"#0 /includes/functions_download.php(276): fread()"
"#1 /download/file.php(317): send_file_to_browser()"
"#2 {main}"
"  thrown in /includes/functions_download.php on line 276"
Can someone familiar with the place in the code shed some light as to what is happening / why and how to prevent it.

Am I misreading this or is an error handling missing here?

Oh yeah: I am using a not modified 3.3.10 installation.
User avatar
janus_zonstraal
Registered User
Posts: 6418
Joined: Sat Aug 30, 2014 1:30 pm

Re: Uncaught ValueError: fread() in functions_download.php

Post by janus_zonstraal »

Oh yeah: I am using a not modified 3.3.10 installation.
It can help if you tell us what you modified
Sorry! My English is bat ;) !!!
Gambid
Registered User
Posts: 15
Joined: Fri Jul 22, 2011 10:35 am

Re: Uncaught ValueError: fread() in functions_download.php

Post by Gambid »

As I have mentioned in the first post, the installation is not modified. I do have some extensions though, none of which appear to be related to attachments:

Advertisement Management 3.0.0
Contact Admin 1.3.7
Google Analytics 1.0.6
Lightbox 2.0.4
mChat 2.1.4
phpBB Two Factor Authentication 1.0.1
Quick Style 1.4.3
Scroll Page 1.1.0
SEO Metadata 1.4.1
Share On 2.0.1

May be I should have also mentioned that the forum runs on php 8.2.6 / PHP-FPM

I have also attached the log file from the last day.
Attachments
error.log
(39.2 KiB) Downloaded 29 times
User avatar
janus_zonstraal
Registered User
Posts: 6418
Joined: Sat Aug 30, 2014 1:30 pm

Re: Uncaught ValueError: fread() in functions_download.php

Post by janus_zonstraal »

Sorry misread about the modification.
Did you try to disable all the extensions?
Sorry! My English is bat ;) !!!
Gambid
Registered User
Posts: 15
Joined: Fri Jul 22, 2011 10:35 am

Re: Uncaught ValueError: fread() in functions_download.php

Post by Gambid »

Haven't tried that yet as I have not really installed any new extensions and none of them have anything to do with attachments.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26503
Joined: Fri Aug 29, 2008 9:49 am

Re: Uncaught ValueError: fread() in functions_download.php

Post by Mick »

That doesn’t matter, there may be something unseen causing the problem. Just disable all the extensions and test.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
Gambid
Registered User
Posts: 15
Joined: Fri Jul 22, 2011 10:35 am

Re: Uncaught ValueError: fread() in functions_download.php

Post by Gambid »

Just disabled all extensions, lets see what happens.
Gambid
Registered User
Posts: 15
Joined: Fri Jul 22, 2011 10:35 am

Re: Uncaught ValueError: fread() in functions_download.php

Post by Gambid »

Any attempt to link the problem to an extension has failed.

So, I edited the code to log the file name in case the exception occurs. Will be happy for other ideas as well.
Post Reply

Return to “[3.3.x] Support Forum”