Drupal 8.6 website where we have an image / upload field getting. "Invalid serialization data for DateTime object in DateTime."

We get this error when we are trying to edit any content on our drupal 8.6 website where we have an image / upload field… We are not able to replicate this when we disable Cloudflare.

AJAX Error - when adding dynamic fields during content edit (Eg. Recursive paragraphs…)

[{“command”:“insert”,“method”:“prepend”,“selector”:null,“data”:" \u003Cdiv role=\u0022contentinfo\u0022 aria-label=\u0022Error message\u0022 class=\u0022messages messages–error\u0022\u003E\n \u003Cdiv role=\u0022alert\u0022\u003E\n \u003Ch2 class=\u0022visually-hidden\u0022\u003EError message\u003C/h2\u003E\n An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (600 MB) that this server supports.\n \u003C/div\u003E\n \u003C/div\u003E\n ",“settings”:null}]

This error is what gets logged in the website error logs

Error: Invalid serialization data for DateTime object in DateTime->__wakeup() (line 21 of /mnt/HDD/new-usgbc/web/core/lib/Drupal/Component/Serialization/PhpSerialize.php) #0 [internal function]: DateTime->__wakeup() #1 /mnt/HDD/new-usgbc/web/core/lib/Drupal/Component/Serialization/PhpSerialize.php(21): unserialize(‘a:46:{s:11:"#at…’) #2 [internal function]: Drupal\Component\Serialization\PhpSerialize::decode(‘a:46:{s:11:"#at…’) #3 /mnt/HDD/new-usgbc/web/core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php(55): array_map(Array, Array) #4 /mnt/HDD/new-usgbc/web/core/lib/Drupal/Core/KeyValueStore/StorageBase.php(35): Drupal\Core\KeyValueStore\DatabaseStorageExpirable->getMultiple(Array) #5 /mnt/HDD/new-usgbc/web/core/lib/Drupal/Core/Form/FormCache.php(121): Drupal\Core\KeyValueStore\StorageBase->get(‘form-wz7t8WjUpm…’) #6 /mnt/HDD/new-usgbc/web/core/lib/Drupal/Core/Form/FormBuilder.php(438): Drupal\Core\Form\FormCache->getCache(‘form-wz7t8WjUpm…’, Object(Drupal\Core\Form\FormState)) #7 /mnt/HDD/new-usgbc/web/core/lib/Drupal/Core/Form/FormBuilder.php(261): Drupal\Core\Form\FormBuilder->getCache(‘form-wz7t8WjUpm…’, Object(Drupal\Core\Form\FormState)) #8 /mnt/HDD/new-usgbc/web/core/lib/Drupal/Core/Entity/EntityFormBuilder.php(48): Drupal\Core\Form\FormBuilder->buildForm(‘node_landing_pa…’, Object(Drupal\Core\Form\FormState)) #9 /mnt/HDD/new-usgbc/web/core/modules/node/src/Controller/NodeController.php(113): Drupal\Core\Entity\EntityFormBuilder->getForm(Object(Drupal\node\Entity\Node)) #10 [internal function]: Drupal\node\Controller\NodeController->add(Object(Drupal\node\Entity\NodeType)) #11 /mnt/HDD/new-usgbc/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #12 /mnt/HDD/new-usgbc/web/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() #13 /mnt/HDD/new-usgbc/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #14 /mnt/HDD/new-usgbc/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #15 /mnt/HDD/new-usgbc/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() #16 /mnt/HDD/new-usgbc/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #17 /mnt/HDD/new-usgbc/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 /mnt/HDD/new-usgbc/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /mnt/HDD/new-usgbc/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /mnt/HDD/new-usgbc/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /mnt/HDD/new-usgbc/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /mnt/HDD/new-usgbc/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /mnt/HDD/new-usgbc/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /mnt/HDD/new-usgbc/web/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 /mnt/HDD/new-usgbc/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #26 {main}.

That seems to be the key.

You can typically only upload 100 MB → https://support.cloudflare.com/hc/en-us/articles/201303340-How-can-I-change-the-client-maximum-upload-size-

This topic was automatically closed after 14 days. New replies are no longer allowed.