• Resolved ssoares

    (@ssoares)


    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)
  • Plugin Author Tim W

    (@timwhitlock)

    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

    (@ssoares)

    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

    (@timwhitlock)

    Scratch what I said before.

    The exception should be caught here.

    What version of Loco Translate are you running?

    Thread Starter ssoares

    (@ssoares)

    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

    (@timwhitlock)

    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

    (@ssoares)

    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

    (@ssoares)

    I forgot this :
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

    Plugin Author Tim W

    (@timwhitlock)

    And what happens if you disable the opcache? Or even just clear the opcache?

    Plugin Author Tim W

    (@timwhitlock)

    Looks like Zend Opcache have had exception-catching bugs in the past.

    That issue was apparently fixed in 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

    (@ssoares)

    I have disabled opcache and the problem still occurs.
    I will give a try to the stable version of opcache.

    Plugin Author Tim W

    (@timwhitlock)

    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

    (@timwhitlock)

    BTW. I’ve patched the development version 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

    (@ssoares)

    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

    (@timwhitlock)

    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

    (@ssoares)

    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)

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