Title: Unexpected data error
Last modified: April 26, 2017

---

# Unexpected data error

 *  Resolved [ssoares](https://wordpress.org/support/users/ssoares/)
 * (@ssoares)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/)
 * Hello,
    I installed the plugin and when I display the page to manage themes or
   plugins I a have a list of messages : InvalidArgumentException: Unexpected data
   in /srv/www/boutique-dermapure.dev/current/web/wp-content/plugins/loco-translate/
   src/data/Serializable.php on line 133 It seems to display one for each plugin/
   theme.
 * Here is the stack trace :
    Loco_package_Theme::create( ) …/Bundle.php:100 16 
   Loco_package_Theme::createFromTheme( ) …/Theme.php:81 17 Loco_package_Bundle-
   >configure( ) …/Theme.php:116 18 Loco_package_Bundle->configureDb( ) …/Bundle.
   php:532 19 Loco_package_Bundle->getCustomConfig( ) …/Bundle.php:419 20 Loco_data_Option-
   >fetch( ) …/Bundle.php:543 21 Loco_data_Serializable->setUnserialized( ) …/Option.
   php:33
 * Does any body have an idea how to fix this?
    If I deactivate the errors diplay
   it seems to save data but I prefer not have this errors. Thank you.

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/unexpected-data-error/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/unexpected-data-error/page/2/?output_format=md)

 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/#post-9070846)
 * Two guesses: Either
 * 1. the serialized data in your database is corrupt, or
    2. some other plugin 
   is modifying the data via filters.
 * What happens if you disable all other plugins except Loco translate? This will
   eliminate no.2
 *  Thread Starter [ssoares](https://wordpress.org/support/users/ssoares/)
 * (@ssoares)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/#post-9071067)
 * I’ve got this message just after I insralled the plugin.
    I assumed that there
   was no data in the DB.
 * I tried to disable other plugins and theres was only two errors.
 * Maybe this info could help: the $data is false after the fetch :
    $key = ‘loco_’.
   $this->getKey(); $data = get_option( $key ); The loco_xxxxx are not in the DB,
   I just installed the plugin.
 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/#post-9071101)
 * Scratch what I said before.
 * The exception should be caught [here](https://github.com/loco/wp-loco/blob/master/src/data/Option.php#L32-L37).
 * What version of Loco Translate are you running?
 *  Thread Starter [ssoares](https://wordpress.org/support/users/ssoares/)
 * (@ssoares)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/#post-9071265)
 * I have WP : 4.7.4 et Loco Translate 2.0.13.
    I tried with the 1.x and no error
   messages were shown.
 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/#post-9071283)
 * I don’t understand how this can happen. The catch block should stop the exception
   from being thrown out of the stack. Are you running some kind of bytecode compiler
   or anything that could affect the behaviour of PHP?
 * What version of PHP are you running?
 *  Thread Starter [ssoares](https://wordpress.org/support/users/ssoares/)
 * (@ssoares)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/#post-9071406)
 * My PHP version is
    PHP Version 5.6.30-7+deb.sury.org~xenial+1 FPM/FastCGI Linux
   stg 4.4.0-66-generic #87-Ubuntu SMP Fri Mar 3 15:29:05 UTC 2017 x86_64
 *  Thread Starter [ssoares](https://wordpress.org/support/users/ssoares/)
 * (@ssoares)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/#post-9071410)
 * I forgot this :
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend
   Technologies
 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/#post-9073258)
 * And what happens if you disable the opcache? Or even just clear the opcache?
 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/#post-9073361)
 * Looks like Zend Opcache have had exception-catching bugs [in the past](https://bugs.php.net/bug.php?id=65665).
 * That issue was apparently fixed in [7.0.3](https://pecl.php.net/package/ZendOpcache/7.0.3),
   but I notice you’re running a bleeding edge version. May be worth checking if
   the last stable version works better.
 *  Thread Starter [ssoares](https://wordpress.org/support/users/ssoares/)
 * (@ssoares)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/#post-9074127)
 * I have disabled opcache and the problem still occurs.
    I will give a try to the
   stable version of opcache.
 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/#post-9074170)
 * If you’ve disabled it (and restarted your server etc..) and the problem persists
   then the opcache is not the issue.
 * In which case I am clueless. I don’t understand what else would cause a PHP catch
   block to fail. Are you in a position to debug this code?
 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/#post-9074201)
 * BTW. I’ve [patched](https://github.com/loco/wp-loco/commit/c5f2bca0eb6a66711973eb1ba451499919861881#diff-c6ef849fd8e9f99a566bfbed5273893d)
   the [development version](https://localise.biz/wordpress/plugin/developers) so
   that empty data isn’t caught in an exception at all.
 * The code does the same thing, and shouldn’t be required, but is probably better
   style.
 * However, your bug still makes no sense to me and I’d like to get to the bottom
   of it. You may find other catch blocks suffer the same problem.
 *  Thread Starter [ssoares](https://wordpress.org/support/users/ssoares/)
 * (@ssoares)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/#post-9074230)
 * Yes, I will do some test and try the plugin on an other server to find out if
   it’s a server configuration problem.
    And you are right, this occurs with others
   catch blocks. I assumed it was related to the missing data. I have already done
   some research and that’s why I’ve decided to contact the support. I’m not sure
   I will / can do that on my day of work. It’s not a problem if no errors are displayed
   so I can’t justify the time to investigate but I will let you know about what
   I found.
 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/#post-9074300)
 * Thanks. My best guess is still some kind of cache/optimiser messing with code
   execution.
 * I installed your version of Zend Opcode and couldn’t reproduce the error, so 
   must be something else.
 *  Thread Starter [ssoares](https://wordpress.org/support/users/ssoares/)
 * (@ssoares)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/#post-9081181)
 * I found out what was responsible for the message output thanks to your last message.
 * > xdebug.show_exception_trace
   >  Type: integer, Default value: 0
   > When this setting is set to 1, Xdebug will show a stack trace whenever an Exception
   > or Error is raised – even if this Exception or Error is actually caught.
 * My xdebug was configured with xdebug.show_exception_trace = on. It could make
   sense in some case but I’m not sure I need this information so I turned it off
   and it’s ok. If I need, in other projects, the error message to be displayed 
   I will have to defined it in the catch part where it is needed.
    It just better
   for my error management.
 * Thanks for your help and I apologize for the waste of time.

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/unexpected-data-error/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/unexpected-data-error/page/2/?output_format=md)

The topic ‘Unexpected data error’ is closed to new replies.

 * ![](https://ps.w.org/loco-translate/assets/icon-256x256.png?rev=1000676)
 * [Loco Translate](https://wordpress.org/plugins/loco-translate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/loco-translate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/loco-translate/)
 * [Active Topics](https://wordpress.org/support/plugin/loco-translate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/loco-translate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/loco-translate/reviews/)

 * 16 replies
 * 2 participants
 * Last reply from: [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/unexpected-data-error/page/2/#post-9081208)
 * Status: resolved