sjelfull / craft-audit

Audit log for Craft 3
https://superbig.co
Other
20 stars 11 forks source link

Unserialize Error accessing audit log #61

Closed agrigg closed 3 years ago

agrigg commented 3 years ago

I installed the Audit Log plugin and updated some entries and it logged the changes correctly and I was able to view the audit log. I came in later after some additional changes where made and now I'm getting the following error trying to access the Audit Log:

`yii\base\ErrorException: unserialize(): Error at offset 0 of 65535 bytes in /srv/app/craft3-rskp/htdocs/vendor/superbig/craft-audit/src/models/AuditModel.php:166 Stack trace:

0 /srv/app/craft3-rskp/htdocs/vendor/craftcms/cms/src/web/ErrorHandler.php(74): yii\base\ErrorHandler->handleError(8, 'unserialize(): ...', '/srv/app/craft3...', 166)

1 [internal function]: craft\web\ErrorHandler->handleError(8, 'unserialize(): ...', '/srv/app/craft3...', 166, Array)

2 /srv/app/craft3-rskp/htdocs/vendor/superbig/craft-audit/src/models/AuditModel.php(166): unserialize('YTo1OntzOjY6InV...')

3 /srv/app/craft3-rskp/htdocs/vendor/superbig/craft-audit/src/controllers/DefaultController.php(62): superbig\audit\models\AuditModel::createFromRecord(Object(superbig\audit\records\AuditRecord))

4 [internal function]: superbig\audit\controllers\DefaultController->actionIndex()

5 /srv/app/craft3-rskp/htdocs/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)

6 /srv/app/craft3-rskp/htdocs/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)

7 /srv/app/craft3-rskp/htdocs/vendor/craftcms/cms/src/web/Controller.php(178): yii\base\Controller->runAction('index', Array)

8 /srv/app/craft3-rskp/htdocs/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('index', Array)

9 /srv/app/craft3-rskp/htdocs/vendor/craftcms/cms/src/web/Application.php(291): yii\base\Module->runAction('audit/default/i...', Array)

10 /srv/app/craft3-rskp/htdocs/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('audit/default/i...', Array)

11 /srv/app/craft3-rskp/htdocs/vendor/craftcms/cms/src/web/Application.php(276): yii\web\Application->handleRequest(Object(craft\web\Request))

12 /srv/app/craft3-rskp/htdocs/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))

13 /srv/app/craft3-rskp/htdocs/web/index.php(42): yii\base\Application->run()

14 {main}`

sjelfull commented 3 years ago

This error is most likely caused by Image Optimize storing large chunks of JSON in the snapshot, which in turn made the serialized version too big for the database column.

Will change the column type to mediumtext and also log exceptions like this in the future instead of taking the whole log screen down.