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

Fatal error: Uncaught TypeError: fread() #561

Open
SitesByYogi opened this issue Jul 21, 2023 · 0 comments
Open

Fatal error: Uncaught TypeError: fread() #561

SitesByYogi opened this issue Jul 21, 2023 · 0 comments

Comments

@SitesByYogi
Copy link

SitesByYogi commented Jul 21, 2023

Describe the bug
In reference to this ticket https://www.boldgrid.com/support/question/experiencing-a-backup-error-with-total-upkeep/

ERROR MESSAGES:
Fatal error: Uncaught TypeError: fread(): Argument #1 ($stream) must be of type resource, bool given in /data/c/f/cf8377f2-6293-4e48-a3cd-7b172316e806/ekoservislm.sk/web/wp-content/plugins/boldgrid-backup/admin/class-boldgrid-backup-admin-cli.php:139 Stack trace: #0 /data/c/f/cf8377f2-6293-4e48-a3cd-7b172316e806/ekoservislm.sk/web/wp-content/plugins/boldgrid-backup/admin/class-boldgrid-backup-admin-cli.php(139): fread(false, 4096)

Warning: popen(crontab -l > /tmp/boldgrid_backup/crontab 2>/dev/null,r): Permission denied in /data/c/f/cf8377f2-6293-4e48-a3cd-7b172316e806/ekoservislm.sk/web/wp-content/plugins/boldgrid-backup/admin/class-boldgrid-backup-admin-cli.php on line 137

If you look at these lines you'd get a boolean false if an error occured using popen. We check later down in the file if it was false, but we already tried to fread the value of popen, which caused the error. We should probably check for that false before we try to fread.

Could also be something weird with this particular users server, because popen looks like it's available but is erroring out, but we could prevent that fatal if we checked before reading it.

Likely can be resolved by moving line 139 inside of the if ( false !== $handle ) statement.

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

No branches or pull requests

1 participant