Bug 14844

Summary: Corrupted storable string. When adding/editing an Item, cookie LastCreatedItem might be corrupted.
Product: Koha Reporter: Olli-Antti Kivilahti <olli-antti.kivilahti>
Component: CatalogingAssignee: Olli-Antti Kivilahti <olli-antti.kivilahti>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: frederic, fridolin.somers, gitbot, julian.maurice, kyle, m.de.rooy, tomascohen, veron
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20971
Change sponsored?: --- Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 14844 - Corrupted storable string. When adding/editing an Item, cookie LastCreatedItem might be corrupted.
Bug 14844: Corrupted storable string. When adding/editing an Item, cookie LastCreatedItem might be corrupted.
Bug 14844: Corrupted storable string. When adding/editing an Item, cookie LastCreatedItem might be corrupted.

Description Olli-Antti Kivilahti 2015-09-17 10:04:42 UTC
No idea how to replicate this issue but we have been getting several reports about the following error:

Software error:

Corrupted storable string (binary v2.9) at /usr/lib/perl/5.18/Storable.pm line 417, at /home/koha/kohaclone/cataloguing/additem.pl line 375.


This patch prevents the whole program from dying, because this error is not critical enough to warrant dying.
Also there is no centralized mechanism in Koha for showing messages to the user, so there is no easy and convenient way to warn the user that the:
'LastCreatedItem'-cookie or the systempreference 'PrefillItem' is malfunctioning.

So we instead just warn to the server logs with the malfunctioning cookie in hopes of nailing down what causes the issues.
Comment 1 Olli-Antti Kivilahti 2015-09-17 10:31:51 UTC Comment hidden (obsolete)
Comment 2 Frédéric Demians 2015-10-27 10:55:19 UTC
I've already seen that. What web server do you use? and what browsers?
Comment 3 Marc Véron 2016-06-02 09:36:02 UTC
Maybe the error occurs when the cookie is created (line 479).
Just a guess after reading:
http://stackoverflow.com/questions/1384702/should-i-use-storable-or-freezethaw-to-serialize-perl-data-as-a-cookie-value
Comment 4 Tomás Cohen Arazi 2016-07-28 14:35:10 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2016-08-01 11:59:15 UTC
Created attachment 53833 [details] [review]
Bug 14844: Corrupted storable string. When adding/editing an Item, cookie LastCreatedItem might be corrupted.

No idea how to replicate this issue but we have been getting several reports
about the following error:

Software error:

Corrupted storable string (binary v2.9) at /usr/lib/perl/5.18/Storable.pm line
417, at /home/koha/kohaclone/cataloguing/additem.pl line 375.

TEST PLAN:
1. Add or modify an Item.
2. No observed changes.
?. We don't know what causes this but we know that add/modify Item occasionally
   crashes due to failure of a cookie thawing.

This patch prevents the whole program from dying, because this error is not
critical enough to warrant dying.
Also there is no centralized mechanism in Koha for showing messages to the
user, so there is no easy and convenient way to warn the user that the:
'LastCreatedItem'-cookie or the systempreference 'PrefillItem' is
malfunctioning.

So we instead just warn to the server logs with the malfunctioning cookie in
hopes of nailing down what causes the issues.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Tomás Cohen Arazi 2016-08-16 14:14:24 UTC
Marking as Major, as it breaks production sites on upgrade.
Comment 7 Kyle M Hall 2016-08-17 18:00:29 UTC
Pushed to master for 16.11, thanks Olli!
Comment 8 Frédéric Demians 2016-08-23 10:26:07 UTC
Pushed in 16.05. Will be in 16.05.03.
Comment 9 Julian Maurice 2016-08-24 10:30:51 UTC
Pushed to 3.22.x, will be in 3.22.10
Comment 10 Fridolin Somers 2016-09-29 08:49:31 UTC
Why not empty the cookie if corrupted ?