When trying to save a panelized entity instance, I get the following error:

The database connection is not serializable. This probably means you are serializing an object that has an indirect reference to the database connection. Adjust your code so that is not necessary. Alternatively, look at DependencySerializationTrait as a temporary solution.

Any idea how to resolve this, or what causes it?

Comments

basvanderheijden created an issue. See original summary.

japerry’s picture

Status: Active » Postponed (maintainer needs more info)

I haven't stumbled upon this issue, can you provide steps to reproduce?

oinuma’s picture

I also suffered from the same error.
This error appears when installing the Supercache module.

When setting panels, Supercache module is uninstalled.

It is an error code in that case.

Uncaught PHP Exception LogicException: "The database connection is not serializable. This probably means you are serializing an object that has an indirect reference to the database connection. Adjust your code so that is not necessary. Alternatively, look at DependencySerializationTrait as a temporary solution." at /[drupal_root]/core/lib/Drupal/Core/Database/Connection.php line 1425, referer: http://www.example.com/
DamienMcKenna’s picture

Version: 8.x-3.0-beta4 » 8.x-3.x-dev

@basvanderheijden: Are you using the Supercache module too?

david_garcia’s picture

Project: Panels » Supercache
Version: 8.x-3.x-dev » 8.x-1.x-dev
Status: Postponed (maintainer needs more info) » Needs work

I've seen sparse reports if this issue, and seems to be related to the Supercache module.

The problem is that the issue happens at some point in the execution pipeine in which the stack trace at the moment of the issue is not helpful to diagnose the issue.

Anybody’s picture

phillamb168’s picture

@Anybody: I applied the patch from 2893029, but it didn't help.

FWIW I'm not sure this has to do with Supercache, but rather Wincache. If I disable Wincache, I no longer see the error.

Steps to reproduce:
IIS/SQLServer/D8.4.3; install Supercache + Wincache. Next, try to install any module. You should see the error immediately.

Disable wincache, the error goes away.

CC @david_garcia

Anybody’s picture

@phillamb168 Yes OK, somehow I think the reason is related... there are related issues in other modules having similar problems. I also have no clue yet how to fix it cleanly.