Leap2a: import/leap/lib.php:1117 unserialize: Error at offset 65512 of 65535 bytes"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Aaron Wells | ||
1.10 |
Won't Fix
|
Medium
|
Aaron Wells | ||
1.9 |
Won't Fix
|
Medium
|
Aaron Wells | ||
15.04 |
Won't Fix
|
Medium
|
Aaron Wells | ||
15.10 |
Fix Released
|
Medium
|
Aaron Wells |
Bug Description
This bug was reported by Kwantlen Polytechnic.
The problem they were experiencing was that some leap2a files error out when they're attempted to be imported. With error-reporting turned on, the same message is always present:
[WAR] f7 (import/
Call stack (most recent first):
log_message(
error(8, "unserialize(): Error at offset 65512 of 65535 byte...", "/var/www/
unserialize(
PluginImportLea
PluginImportLea
print_import_
tags: | added: import leap2a mysql |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
This problem only occurs if:
1. You are using MySQL
2. You are doing self-import (interactive import), not the admin's "import into a new account" option.
3. Your export includes a page which is more than 65 kilobytes in size, when serialized. (not including file attachments)
The problem occurs because one of the steps during the interactive import process is to serialize the page, and store the serialized page in the database. The serialized page goes in the "import_ entry_requests. entrycontent" table in the database. This table is the "text" data type, but because we didn't specify a size, in MySQL it defaults to being a standard TEXT field, which has a limit of 65,536 bytes. Attempts to insert values longer than that, are simply truncated to 65,536 bytes.
So what happens is, the page is serialized into a big long string greater than 65,536 bytes in length. It's inserted into the import_ entry_requests. entrycontent column. Then once you make all your import decisions and submit that, we try to pull the page back out of import_ entry_requests. entrycontent and unserialize it. We retrieve the truncated value from the database, try to unserialize it, and the call to unserialize() fails because the truncated string lacks a closing quotation mark and bracket.
The fix here is to expand the size of the import_ entry_requests column to a LONGTEXT, which can hold up to 4GB of text. That should be enough.