dompdf / dompdf

HTML to PDF converter for PHP
https://dompdf.github.io/
GNU Lesser General Public License v2.1
10.54k stars 1.8k forks source link

dompdf_font_family_cache.dist.php Failed to open stream: No such file or directory #3522

Closed Cookiezzz closed 2 months ago

Cookiezzz commented 2 months ago

I have a project that I upgraded from using dompdf1.x to the latest version. (3.0.0) I'm using the https://github.com/barryvdh/laravel-dompdf package. my config/dompdf.php is default with the exception I set enable_remote to true

When generating a PDF I get this error require(vendor/dompdf/dompdf/lib/fonts/dompdf_font_family_cache.dist.php): Failed to open stream: No such file or directory

I've already removed the /vendor directory. Ran composer clearcache and fully reinstalled all packages.

I just have no idea why it's still looking for the dompdf_font_family_cache.dist.php file. Going by https://github.com/barryvdh/laravel-dompdf/issues/987 this was removed in ^2.0. Which I can confirm from the following commits: https://github.com/dompdf/dompdf/pull/2863/files & https://github.com/dompdf/dompdf/pull/2450/files

bsweeney commented 2 months ago

I don't have any specific insights into what might be happening here. You are right that the file shouldn't be referenced anymore. Could this possibly be a php opcache issue?

Cookiezzz commented 2 months ago

I don't have any specific insights into what might be happening here. You are right that the file shouldn't be referenced anymore. Could this possibly be a php opcache issue?

Sadly it doesn't seem to be a cache issue. Reset opcache, restarted the webserver, all to no avail.

Considering it's a Laravel app, I also tried clearing the bootstrap/cache folder, php artisan cache:clear and all of those.

Cookiezzz commented 2 months ago

Figured it out. I'm going hide in shame for the rest of the evening. It was a piece of code running in a queue worker through supervisord. Did not restart the queues... All good now. Cheers.

bsweeney commented 2 months ago

It happens to us all. Glad you were able to discover the source.