Bug #91404

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

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

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Reports
Target version:
Start date:
2020-05-14
Due date:
% Done:

100%

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

Description

I just updated core from 9.5.16 to 9.5.17 after that I get an error

(1/1) #1588784141 BadMethodCallException
Cannot serialize TYPO3\CMS\Extbase\Reflection\ReflectionService

In my log, I seeing it

Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1588784141: Cannot serialize TYPO3\CMS\Extbase\Reflection\ReflectionService | BadMethodCallException thrown in file /usr/share/typo3/typo3_src-9.5.17/typo3/sysext/core/Classes/Security/BlockSerializationTrait.php in line 30. Requested URL: https://dev9.typo3.org.ua/forum/typo3-cms/install-typo3

stack trace.html View (310 KB) Markus Hofmann, 2020-05-14 17:14

stack trace.html View (806 KB) Vasyl Mosiychuk, 2020-05-14 17:49


Related issues

Related to TYPO3 Core - Bug #91387: Relax constraints on serializing objects Closed 2020-05-13
Duplicated by TYPO3 Core - Bug #91393: Cachingproblems after recent TYPO3 9.5.17 Closed 2020-05-14

Associated revisions

Revision b9ace2c1 (diff)
Added by Alexander Schnitzler 5 months ago

[BUGFIX] Properly (un)serialize ReflectionService

The ReflectionService usually doesn't get serialized by users
directly but since Extbase has an unclean dependency chain, the
serialization of the ReflectionService is triggered in user land
code when serializing a LazyObjectStorage e.g.

Since it's no problem to implement a clean serialization and
unserialization of the ReflectionService it is implemented with
this patch and will no longer cause any troubles.

There is just one thing to mention. The ReflectionService usually
comes with a cache which cannot be restored during wakeup of the
serialized service. It's unlikely but it's possible that the
absense of the cache can cause a performance hit.

Releases: master, 9.5
Resolves: #91404
Change-Id: I8c64968f0f329528c9f578ba0ef76437ada40ac0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64494
Tested-by: Susanne Moog <>
Tested-by: Benjamin Franzke <>
Tested-by: TYPO3com <>
Reviewed-by: Susanne Moog <>
Reviewed-by: Benjamin Franzke <>

Revision eda9a9a4 (diff)
Added by Alexander Schnitzler 5 months ago

[BUGFIX] Properly (un)serialize ReflectionService

The ReflectionService usually doesn't get serialized by users
directly but since Extbase has an unclean dependency chain, the
serialization of the ReflectionService is triggered in user land
code when serializing a LazyObjectStorage e.g.

Since it's no problem to implement a clean serialization and
unserialization of the ReflectionService it is implemented with
this patch and will no longer cause any troubles.

There is just one thing to mention. The ReflectionService usually
comes with a cache which cannot be restored during wakeup of the
serialized service. It's unlikely but it's possible that the
absense of the cache can cause a performance hit.

Releases: master, 9.5
Resolves: #91404
Change-Id: I8c64968f0f329528c9f578ba0ef76437ada40ac0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64532
Tested-by: Benjamin Franzke <>
Tested-by: Alexander Schnitzler <>
Tested-by: TYPO3com <>
Reviewed-by: Benjamin Franzke <>
Reviewed-by: Alexander Schnitzler <>
Reviewed-by: Oliver Hader <>

History

#1 Updated by Oliver Hader 6 months ago

  • Target version set to 9.5.18 & 10.4.3

#2 Updated by Oliver Hader 6 months ago

Can you please provide a stack trace and describe what actually happens on your system, or where/when this message occurs. How can it be reproduced? Thx

#3 Updated by Oliver Hader 6 months ago

  • Related to Bug #91387: Relax constraints on serializing objects added

#4 Updated by Vasyl Mosiychuk 6 months ago

Oliver Hader wrote:

Can you please provide a stack trace and describe what actually happens on your system, or where/when this message occurs. How can it be reproduced? Thx

Yes, I will do it later...

Now I am researching it and search for the reason

Here place for test because it only happens here https://dev10.typo3.org.ua/forum/

#5 Updated by Markus Hofmann 6 months ago

According to our system the problem occurs when logging in with a frontend user. (9.5.17)

You will find the complete error output from my local system in stack trace.html

#6 Updated by Vasyl Mosiychuk 6 months ago

Markus Hofmann wrote:

According to our system the problem occurs when logging in with a frontend user. (9.5.17)

You will find the complete error output from my local system in stack trace.html

It is my stack trace.html...

I already know what is the issue... in my case and yours too ... it is UncacheViewHelper

https://fluidtypo3.org/viewhelpers/vhs/master/Render/UncacheViewHelper.html

In my template I use... I need this element not cached

<v:render.uncache partial="ItemLayout/Forums/Button/AddNew" arguments="{uid:'{pageData.uid}',navtitle:'{pageData.nav_title}'}"/>

In my and in your stack trace I found him... when I comment him an error not appeared...

Now is stay question, how is it resolve?

I use VHS: Fluid ViewHelpers version 6.0.0

#7 Updated by Oliver Hader 6 months ago

Vasyl Mosiychuk wrote:

Markus Hofmann wrote:
I use VHS: Fluid ViewHelpers version 6.0.0

Thanks, that helps... https://github.com/FluidTYPO3/vhs/blob/development/Classes/View/UncacheTemplateView.php#L48
ext:vhs is putting the whole rendering stack into cache - which is "suboptimal" in general, but with recent changes denied.

#8 Updated by Vasyl Mosiychuk 6 months ago

Oliver Hader wrote:

Thanks, that helps... https://github.com/FluidTYPO3/vhs/blob/development/Classes/View/UncacheTemplateView.php#L48
ext:vhs is putting the whole rendering stack into cache - which is "suboptimal" in general, but with recent changes denied.

Thanks!

...is there a way to solve this problem?

#9 Updated by Gerrit Code Review 6 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64494

#10 Updated by Gerrit Code Review 6 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64494

#11 Updated by Oliver Hader 6 months ago

  • Duplicated by Bug #91393: Cachingproblems after recent TYPO3 9.5.17 added

#12 Updated by Vasyl Mosiychuk 6 months ago

Thank everyone! Sorry! Who can say more about it because I can not understand whether the issue comes from TYPO3 or VHS ViewHelper?

I am just in case create a new issue here https://github.com/FluidTYPO3/vhs/issues/1647

#13 Updated by Gerrit Code Review 6 months ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64494

#14 Updated by Gerrit Code Review 6 months ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64494

#15 Updated by Gerrit Code Review 5 months ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64494

#16 Updated by Gerrit Code Review 5 months ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64494

#17 Updated by Gerrit Code Review 5 months ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64494

#18 Updated by Gerrit Code Review 5 months ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64532

#19 Updated by Anonymous 5 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#20 Updated by Gerrit Code Review 5 months ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64532

#21 Updated by Gerrit Code Review 5 months ago

Patch set 3 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64532

#22 Updated by Philip Heidenreich 5 months ago

Same error with FileLockStrategy. TYPO3 v9.5.17, vhs v6.0.0 (as well as 5.2.0) and changes from patch applied.

(1/1) #1588784141 BadMethodCallException
Cannot serialize TYPO3\CMS\Core\Locking\FileLockStrategy

#23 Updated by Anonymous 5 months ago

  • Status changed from Under Review to Resolved

#24 Updated by Jacco van der Post 5 months ago

Philip Heidenreich wrote:

Same error with FileLockStrategy. TYPO3 v9.5.17, vhs v6.0.0 (as well as 5.2.0) and changes from patch applied.

(1/1) #1588784141 BadMethodCallException
Cannot serialize TYPO3\CMS\Core\Locking\FileLockStrategy

I got the same

#25 Updated by Philip Heidenreich 5 months ago

Solution in https://forge.typo3.org/issues/91387#note-9 seems to work to write into the cache. But a page reload and reading from cache returns following error:

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

Removing __wakeup method works. Can anyone name side-effects or is this fine from a security point of view as well?

#26 Updated by Benni Mack 5 months ago

  • Status changed from Resolved to Closed

#27 Updated by Jacco van der Post 5 months ago

Philip Heidenreich wrote:

Same error with FileLockStrategy. TYPO3 v9.5.17, vhs v6.0.0 (as well as 5.2.0) and changes from patch applied.

(1/1) #1588784141 BadMethodCallException
Cannot serialize TYPO3\CMS\Core\Locking\FileLockStrategy

It seems to be solved now with 9.5.18.

Thanks guys!

#28 Updated by Vasyl Mosiychuk 5 months ago

Jacco van der Post wrote:

(1/1) #1588784141 BadMethodCallException
Cannot serialize TYPO3\CMS\Core\Locking\FileLockStrategy

It seems to be solved now with 9.5.18.

Thanks guys!

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

#29 Updated by Oliver Hader 5 months ago

  • Status changed from Closed to Needs Feedback

#30 Updated by Oliver Hader 5 months ago

Philip Heidenreich wrote:

Solution in https://forge.typo3.org/issues/91387#note-9 seems to work to write into the cache. But a page reload and reading from cache returns following error:

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

Removing __wakeup method works. Can anyone name side-effects or is this fine from a security point of view as well?

Not suggested from a security point of view

#31 Updated by Oliver Hader 5 months ago

Vasyl Mosiychuk wrote:

Jacco van der Post wrote:

(1/1) #1588784141 BadMethodCallException
Cannot serialize TYPO3\CMS\Core\Locking\FileLockStrategy

It seems to be solved now with 9.5.18.

Thanks guys!

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...

The initial report was on ReflectionCache and serialize. Is this still the same?
In case it's different, could you please create a new issue and attach the error stack trace? Thanks in advance!

#32 Updated by Oliver Hader 5 months ago

  • Status changed from Needs Feedback to Closed

Also available in: Atom PDF