<p>Update the Notifications plugin.</p>

<p>From Craft Support:</p>

<blockquote>
  <p>Ultimately Yii/Craft is using PHP's serialize() method to do the
  serialization, which has always had quirks with serializing different
  types of objects, especially the more complex those objects are.</p>
  
  <p>We try to only serialize simple objects and primitive data structures
  (arrays, strings, bools, etc.) to try and minimize those issues as
  much as possible.</p>
</blockquote>

<p>From The Developer:</p>

<blockquote>
  <p>Notifications are no longer queued as this causes a lot of issues with
  serialization. Will find a better solution for this in the future.</p>
</blockquote>

<p>Prior to version 1.1.0, the Notifications plugin was attempted to serialize <em>the entire entry</em> to place it in queue.</p>

CC BY-SA 4.0
2018-05-21T16:08:44.080Z
2018-05-21T16:08:44.080Z
Steve Mock
<p>Craft Pro 3.0.7<br/>Notifications Plugin 1.0.6<br/>PHP 7.0</p>

<p>In trying to send notifications for new entries that have a checkbox field, we get this error in the logs:</p>

<blockquote>
  <p>2018-05-14 09:19:32
  [192.168.10.1][1][-][error][UnexpectedValueException]
  UnexpectedValueException: Error at offset 0 of 2 bytes in
  /home/path/to/vendor/yiisoft/yii2-queue/src/serializers/PhpSerializer.php:32</p>
</blockquote>

<p>This manifests as the notification getting stuck in queue, never releasing, always showing progress bar.</p>

<p>Removing only the checkbox field from this section, the notifications work as expected without any errors.</p>

<p>From what I read, serialization errors may result from encoding problems.</p>

<p>What else can I try to resolve this? Where else can I look?</p>

CC BY-SA 4.0
2018-05-14T20:20:26.510Z
It might be a good idea to show us your code
Robin Schambach
CC BY-SA 4.0
2018-05-14T20:25:43.177Z
What code? I have written no code. An error is getting thrown using Craft and Notifications right out of the box.
Steve Mock
CC BY-SA 4.0
2018-05-14T20:29:06.177Z
There is no default queue that sends notifications for new entries out of the box
Robin Schambach
CC BY-SA 4.0
2018-05-14T20:32:17.300Z
I know. That's what this plug in is for. Ostensibly. https://github.com/Rias500/craft-notifications
Steve Mock
CC BY-SA 4.0
2018-05-14T20:38:33.713Z
But this plugin won't magically send notifications either. You need to make certain configurations... Ostensibly. Anyway. Without further information the ability to help is really limited. I would suggest you to contact the creator of the plugin directly.
Robin Schambach
CC BY-SA 4.0
2018-05-14T20:43:50.547Z
Come on, man. I have. And I have also made these certain configurations. Which work perfectly in the absence of a checkbox field. Thanks for your help.
Steve Mock
CC BY-SA 4.0
2018-05-14T23:25:33.060Z
Have seen this error occur for various reasons when something in Craft's cache location gets corrupted (`craft/storage/runtime/cache` by default). If you nuke that folder so it gets rebuilt, does the error go away? Sometimes happens when a plugin tries to cache complex objects and PHP has a hard time serializing the data.
Brad Bell
CC BY-SA 4.0
2018-05-14T23:57:10.907Z
Thank you Brad. Saw that elsewhere. Tried it. No avail. How would that explain perfect behavior in the absence of a checkbox field? I mean, that’s the thing that enables replication. Every time. I’ve traced it that far.
Steve Mock
<php><serialization><queue>
What Might Be Causing This Serialization Error?
# What Might Be Causing This Serialization Error?

(Asked by: username_0 on 2018-05-14)

Craft Pro 3.0.7  
Notifications Plugin 1.0.6  
PHP 7.0

In trying to send notifications for new entries that have a checkbox field, we get this error in the logs:

> 2018-05-14 09:19:32
> [192.168.10.1][1][-][error][UnexpectedValueException]
> UnexpectedValueException: Error at offset 0 of 2 bytes in
> /home/path/to/vendor/yiisoft/yii2-queue/src/serializers/PhpSerializer.php:32

This manifests as the notification getting stuck in queue, never releasing, always showing progress bar.

Removing only the checkbox field from this section, the notifications work as expected without any errors.

From what I read, serialization errors may result from encoding problems.

What else can I try to resolve this? Where else can I look?

**Tags:** php, serialization, queue

> **Comments:**
> **username_1**: It might be a good idea to show us your code  
> **username_0**: What code? I have written no code. An error is getting thrown using Craft and Notifications right out of the box.  
> **username_1**: There is no default queue that sends notifications for new entries out of the box  
> **username_0**: I know. That's what this plug in is for. Ostensibly. https://github.com/Rias500/craft-notifications  
> **username_1**: But this plugin won't magically send notifications either. You need to make certain configurations... Ostensibly. Anyway. Without further information the ability to help is really limited. I would suggest you to contact the creator of the plugin directly.  
> **username_0**: Come on, man. I have. And I have also made these certain configurations. Which work perfectly in the absence of a checkbox field. Thanks for your help.  
> **username_2**: Have seen this error occur for various reasons when something in Craft's cache location gets corrupted (`craft/storage/runtime/cache` by default). If you nuke that folder so it gets rebuilt, does the error go away? Sometimes happens when a plugin tries to cache complex objects and PHP has a hard time serializing the data.  
> **username_0**: Thank you Brad. Saw that elsewhere. Tried it. No avail. How would that explain perfect behavior in the absence of a checkbox field? I mean, that’s the thing that enables replication. Every time. I’ve traced it that far.  

---

## 1 answers

### Answer by username_0 on 2018-05-21. Score: 1 | Accepted answer

Update the Notifications plugin.

From Craft Support:

> Ultimately Yii/Craft is using PHP's serialize() method to do the
> serialization, which has always had quirks with serializing different
> types of objects, especially the more complex those objects are.
>
> We try to only serialize simple objects and primitive data structures
> (arrays, strings, bools, etc.) to try and minimize those issues as
> much as possible.

From The Developer:

> Notifications are no longer queued as this causes a lot of issues with
> serialization. Will find a better solution for this in the future.

Prior to version 1.1.0, the Notifications plugin was attempted to serialize *the entire entry* to place it in queue.


---

