Bug #91451

After update from 9.5.16 to 9.5.17 then to 9.5.18, I get an error 'Cannot serialize'

Added by Vasyl Mosiychuk 5 months ago. Updated 5 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-05-20
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

First was this problem https://forge.typo3.org/issues/91404

(1/1) #1588784142 BadMethodCallException
Cannot unserialize TYPO3\CMS\Core\Locking\FileLockStrategy

System:
- PHP 7.2
- TYPO3 9.5.18
- VHS 6.0.0

No, it is not resolved! I had updated to 9.5.18 but I still see this error...

but not immediately ... something changed

The previous time I saw an error immediately as I go to the page where I have this element with VHS...

This time all not so... I get an error when you view the same page again

I get an error when I visit one more time the page (revisit a page) where I have this element with VHS (<v:render.uncache/>)...

Step 1:

I go to the page where I have this element with VHS (<v:render.uncache/>). - No error

Step 2:

I go to another any page where I do not have this element with VHS (<v:render.uncache/>). - No error

Step 3:

I return to the page where I have this element with VHS (<v:render.uncache/>).... which I have already visited - I get this error

Conclusion:

I get an error when I view the same page (a content element with VHS - (<v:render.uncache/>).) again...

After Clear cache, the error disappears...

But when I repeat steps 1 - 2 - 3 ... I get an error again

stack_trace_error.html View (3.7 MB) Vasyl Mosiychuk, 2020-05-20 16:50


Related issues

Duplicated by TYPO3 Core - Bug #91452: After update from 9.5.16 to 9.5.17 then to 9.5.18, I get an error 'Cannot serialize' Closed 2020-05-20

History

#1 Updated by Tymoteusz Motylewski 5 months ago

  • Duplicated by Bug #91452: After update from 9.5.16 to 9.5.17 then to 9.5.18, I get an error 'Cannot serialize' added

#2 Updated by Vasyl Mosiychuk 5 months ago

Vasyl Mosiychuk wrote:

First was this problem https://forge.typo3.org/issues/91404

The same added here... https://github.com/FluidTYPO3/vhs/issues/1647

....so you may need to thoroughly review every argument you pass to `v:render.uncache` to truly fix this problem.

Very interesting, where can I find out, what can be passed that is not?

I did it... I mean I thoroughly reviewed every argument I pass to <v:render.uncache/>

It is my experiment. The very simple example:

In my `Layouts` - `List.html`

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:n="http://typo3.org/ns/GeorgRinger/News/ViewHelpers" xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers" data-namespace-typo3-fluid="true">
    <f:if condition="{news}">
        <f:then>
            [ ===  nothing === ]
        </f:then>
    </f:if>
</html>

In my `Partials` - `AddNew.html`

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:n="http://typo3.org/ns/GeorgRinger/News/ViewHelpers" xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers" data-namespace-typo3-fluid="true">
    [ ### nothing ### ]
</html>

No nothing, no problems

Now:

In my `Layouts` - `List.html`

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:n="http://typo3.org/ns/GeorgRinger/News/ViewHelpers" xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers" data-namespace-typo3-fluid="true">
    <f:if condition="{news}">
        <f:then>
            <v:render.uncache partial="ItemLayout/AddNew" arguments="{uid:'{pageData.uid}'}"/>
        </f:then>
    </f:if>
</html>

In my `Partials` - `AddNew.html`

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:n="http://typo3.org/ns/GeorgRinger/News/ViewHelpers" xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers" data-namespace-typo3-fluid="true">
    [ ### uid: {uid} ### ]
</html>

I get an error

(1/1) #1588784142 BadMethodCallException
Cannot unserialize TYPO3\CMS\Core\Locking\FileLockStrategy

Then Originally posted by @typo3ua in https://github.com/FluidTYPO3/vhs/issues/1647#issuecomment-631498498

What is wrong with my code and argument?

Closing the issue since the base problem no longer exists.

I think the problem is not resolved... The `v:render.uncache` is blocked.

TYPO3 blocks the ViewHelpers <v:render.uncache />

#3 Updated by Vasyl Mosiychuk 5 months ago

I seem I found the culprit... it is the ext:news I think that creates a problem core...

More about it here...

#4 Updated by Stefan Berger 5 months ago

We could confirm the case, that after the regression update to 9.5.18 the problem isn't completely fixed yet.

In our conclusion it is not just the news, but using a non cached user plugin on a cached page.

The stacktrace shows that the trigger comes from the unserialization of non cached user plugin, witch contain a FileLockStrategy object.

typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php line 3846

                    $label = 'Include ' . $INTiS_config[$INTiS_key]['type'];
                    $label = $label . isset($INTiS_config[$INTiS_key]['file']) ? ' ' . $INTiS_config[$INTiS_key]['file'] : '';
                    $timeTracker->push($label);
                    $incContent = '';
                    $INTiS_cObj = unserialize($INTiS_config[$INTiS_key]['cObj']);
                    /* @var ContentObjectRenderer $INTiS_cObj */
                    switch ($INTiS_config[$INTiS_key]['type']) {
                        case 'COA':
                            $incContent = $INTiS_cObj->cObjGetSingle('COA', $INTiS_config[$INTiS_key]['conf']);

Here an excerpt of the serialized content:

...
'locks";a:2:{s:11:"pagesection";a:2:{s:10:"accessLock";N;s:8:"pageLock";N;}s:5:"pages";a:2:{s:10:"accessLock";O:39:"TYPO3\\CMS\\Core\\Locking\\FileLockStrategy":3:{s:14:"' . "\0" . '*' . "\0" . 'filePointer";i:0;s:11:"' . "\0" . '*' . "\0" . 'filePath";s:102:"/var/www/vhosts/migration.local/httpdocs_dev/typo3temp/var/lock/flock_b3b32a2d422265cd25c3323ed0157f81";s:13:"' . "\0" . '*' . "\0" . 'isAcquired";b:0;}s:8:"pageLock";O:39:"TYPO3\\CMS\\Core\\Locking\\FileLockStrategy":3:{s:14:"' . "\0" . '*' . "\0" . 'filePointer";i:0;s:11:"' . "\0" . '*' . "\0" . 'filePath";s:102:"/var/www/vhosts/migration.local/httpdocs_dev/typo3temp/var/lock/flock_892f474204fa67a317b9d83ea5e1c895";s:13:"' . "\0" . '*' . "\0" . 'isAcquired";b:1;}}}
...

Mayby the solution could be removing the BlockSerializationTrait from the FileLockStrategy?!.

#5 Updated by Vasyl Mosiychuk 5 months ago

Stefan Berger wrote:

We could confirm the case...

Thank you! I have a question for you... does your problem appear whenever you use COA_INT whether you use <v:render.uncache/>?

#6 Updated by Stefan Berger 5 months ago

Vasyl Mosiychuk wrote:

Thank you! I have a question for you... does your problem appear whenever you use COA_INT whether you use <v:render.uncache/>?

We don't use vhs on our system, so I couldn't answer your question.

#7 Updated by Vasyl Mosiychuk 5 months ago

Stefan Berger wrote:

We don't use vhs on our system, so I couldn't answer your question.

Thanks! Understood .. then it is TypoScript - COA_INT? ... Am I correctly understand?

#8 Updated by Stefan Berger 5 months ago

Vasyl Mosiychuk wrote:

Thanks! Understood .. then it is TypoScript - COA_INT? ... Am I correctly understand?

We use the standard way. It's a plugin in the tt_content, inserted in the backend on page xy. So under the hood it's USER_INT typoscript.

#9 Updated by Vasyl Mosiychuk 5 months ago

if in short... last changes core (related to security) does not give the opportunity to update my current core 9.5.16 to newer.

the code and extensions which I use and situation which I wrote before... do nothing dangerous

then how to define the cause and to whom to write?

Also available in: Atom PDF