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

processingInstructions, no File in fileadmin/_processed_ generated #240

Open
braukma opened this issue Feb 1, 2024 · 7 comments
Open

processingInstructions, no File in fileadmin/_processed_ generated #240

braukma opened this issue Feb 1, 2024 · 7 comments
Assignees
Labels

Comments

@braukma
Copy link

braukma commented Feb 1, 2024

Hello,
I am facing problems using the image view helper with some processingInstructions. The PDF generation fails with an exeption:
Call to undefined method TYPO3\CMS\Core\Resource\ProcessedFile::setMissing()
This refers to an access to a non existing file in fileadmin/processed

Much testing: Reason is, the file is never generated and therefore cannot be found.

I used something like processingInstructions="{width: '{size_veroeff}c'}" in my Code, that worked well with pdfviewhelpers 2.5.0

Removing that bit of code cured my problem, I wonder wether that's related to the changes that took place with the changes to the processingInstructions, user dumbness or whatever. :-)

Environment
TYPO3 version v11.5
pdfviewhelpers version: v3.0.0

Best Regards,

Jürgen

@maechler
Copy link
Member

maechler commented Feb 2, 2024

@braukma Thanks for your report! I don't think it should be related to that change, but you never know, I will have to have a closer look. Apart from the pdfviewhelpers version there is no difference? It's exactly the same TYPO3 and Fluid version? Exactly the same template?

@braukma
Copy link
Author

braukma commented Feb 2, 2024

Thanks for the very quick response! :-)

OK, my longer story is told like this:

I started with Typo3, V9.5, pdfviewhelpers 4.5.0 and an extension by an external developer to produce that PDF-Booklet from within the backend of Typo. For obvious reasons, I migrated to Typo3 V11.
To migrate from 9 to 11, I set up 9, 10 and 11 in a local install to update the database. Beeing lazy, I shared the whole of fileadmin with all versions by a symlink.
I got an updated version for the PDF-export (that works in v11 and requires pdfviewhelpers 3.0.0) that worked well in my local install, but failed on my production install.
Long, long search: It worked localy, because the files in question whre already there, generated long before with my very old 9.5 working install. Deleting fileadmin/processed reproduced that contition and deleting the processingInstruction in my partial cured it.
Any chance for me to look deeper / help more?

Jürgen

@maechler
Copy link
Member

maechler commented Feb 2, 2024

Without further testing I think it could be a Fluid parsing issue because of the special syntax with the variable in the string processingInstructions="{width: '{size_veroeff}c'}". Could you try setting it to a fixed value instead?

e.g. processingInstructions="{width: '400c'}"

If that doesn‘t help it would be interesting if there was some error in the log files. Because you are upgrading TYPO3 as well, there might be several other problems causing this issue.

@braukma
Copy link
Author

braukma commented Feb 2, 2024

OK,

I edited my partial an replaced the processingInstructions as suggested. Then, I killed fileadmin/processed to make sure to delete the spoilers :-), aka to be sure there is nothing left to pop up from the nonexisting and started the Export:

Call to undefined method TYPO3\CMS\Core\Resource\ProcessedFile::setMissing()

Again, deleting the Instructions brought relief.

From the log:
Core: Exception handler (WEB): Uncaught TYPO3 Exception: Call to undefined method TYPO3\CMS\Core\Resource\ProcessedFile::setMissing() | Error thrown in file /var/www/htdocs/typo3_src-11.5.33/typo3/sysext/core/Classes/Resource/ResourceStorage.php in line 753. Requested URL: [URL removed, if needed pse. tell me]

Is there more for me to scratch from the logs? I am a bit unexperienced with this sort of troubleshooting.

Jürgen

@maechler
Copy link
Member

maechler commented Feb 6, 2024

@braukma I just quickly tested the image processing with v3.0.0 and it seems to work as expected. Thus I suspect there is a general image processing issue with your TYPO3 instance.

Does the image processing work in other parts of the installation? You could run the checks in the backend under "Admin Tools" > "Environment" > "Image Processing" to see if image processing works in general.

@braukma
Copy link
Author

braukma commented Feb 6, 2024

Tried a bit again:
cleared all in processed
Generated my PDF with processingInstructions, static entry:
The exeption occurs and an empty directory structure ./1/d is created in processed
But no file(s) in that, just empty
removed ./1/d in processed
removed the processingInstruction
tried to create the PDF: of course, that worked now
no new files directories in fileadmin
---- 8< ---
Played a bit in the frontend, called different Pages:
fileadmin filles up with new generated directories and files (png) in it.
I recon, these are generated from within Typo3
---- 8< ----
Image Processing:
Looks fine, all on my system looks like the reference, exept converting to webp throws a complaint.

Let's call it a day for now. I'll check further into that matter and pick up that thread a bit later, since I also have non Typo3 jobs on my agenda .... :-)

Jürgen

@maechler
Copy link
Member

maechler commented Feb 8, 2024

Looking at the TYPO3 core code in ResourceStorage I think it might be missing an !$isProcessedFile check where your error originates from:

https://github.com/TYPO3/typo3/blob/ddf15a5d1574c6431addfae1b1ed2e1df05bd5e7/typo3/sysext/core/Classes/Resource/ResourceStorage.php#L744-L747

However the question remains why this happens with your example. It could help if you added some debug statements in the ResourceStorage class just before the call to setMissing that leads to that error.

e.g.

if ($isProcessedFile) {
    var_dump($action);
    debug_print_backtrace();     
}

Also debugging some more properties of the file object could help here.

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

No branches or pull requests

2 participants