• Resolved superninchen

    (@superninchen)


    Hi,

    first of all, I am really happy with this plugin. It’s doing a great job! After putting more and more hacker’s IP addresses on the blacklist I have decreased the number of unauthorised login attempts now to zero within the past 10 days!

    To me this means my access list is what I need.

    Now, I have started a second wordpress page, which immediately got targeted by hundreds of unauthorised login attempts from Russia and Asia, and therefore I wanted to copy my successful access list from my first site to the new one.

    I exported it with the download button on site A and tried to upload it on site B, but I always get the error message “Error parsing file”.

    Looking at the exported file, I noticed some HTML fragments at the top of the file:

    <br />
    <b>Notice</b>:  Undefined index: exportset in <b>/home/myusername/htdocs/wp-content/plugins/wp-cerber/cerber-tools.php</b> on line <b>128</b><br />

    After these lines follows the regular access list:

    {"cerber_version":"4.3","home":"https:\/\/mywebsite","date":"16 Mar 2017 11:25:06","acl":[["213.143.60.*","W",""],["83.*.*.*","B",""],["109.*.*.*","B",""],["194.*.*.*","B",""],["168.*.*.*","B",""]
    (...)

    Removing the HTML tags didn’t help. Still the file cannot be parsed.

    So I tried to export the list from site B and imported it again right after that. This worked without error.

    Next I tried to paste the list of IP addresses from the config file of site A into the one of site B. But still the file cannot be parsed.

    Is there some hash value in the end mark of the file?

    If so, the root problem lies, obviously, in the error reported during export.

    How do I proceed?

    Thank you for suggestions and hints,
    Sascha

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author gioni

    (@gioni)

    Hi!

    That means that you either enabled WP_DEBUG mode on the site A or your PHP error_reporting setting on that site is set to display notices (by default they are disabled). To disable both add the following lines to the wp-config.php file on the site A:

    define( 'WP_DEBUG', false );
    ini_set('display_errors', 0);

    P.S. I’ll update the plugin soon to avoid that issue.

    • This reply was modified 7 years, 11 months ago by gioni.
    Thread Starter superninchen

    (@superninchen)

    Hi Gioni,

    thank you for your quick reply.

    Yes, you are right! Debugging… Now that you said it. I had been having issues with another plugin recently and had debugging switched on.

    With the debugging switched off on site A, I could export and import the access list without error.

    THANK YOU VERY MUCH! Problem solved!

    Cheers,
    Sascha

    • This reply was modified 7 years, 11 months ago by superninchen.
    Thread Starter superninchen

    (@superninchen)

    Unfortunately I have to re-open this topic.

    Today I started another WP site and wanted to import my access list from my first site to this new one.

    Both are running WP 4.8.1 and WPCerber 5.0.

    I export the access list from site A and it looks alright in my text editor. No HTML fragments. Only a comma separated list of IP addresses in rectangular brackets, plus “cerber_version”, “home” and “date” at the beginning.

    At the end of the file I see this string: ==/3397/1776576948/EOF

    I don’t know if it belongs there, but anyway, with or without that string I get the error message on site C: “Error parsing file”.

    What could it be this time? Debugging is switched off on both sites.

    Thanks in advance!
    Sascha

    Thread Starter superninchen

    (@superninchen)

    I see a difference between the two.

    The source site A is running on PHP 5.6.30 and the target site C is running on 7.0.20.

    Would this explain why the access list cannot be parsed?

    Plugin Author gioni

    (@gioni)

    First of all, you must not edit or change an export file in any way because it contains a checksumm and the plugin verifies data integrity in a file.

    Could you inspect the Apache error log file for relevant error messages?

    Thread Starter superninchen

    (@superninchen)

    I first tried import without altering the file, as it used to be working fine the last time I did that (some months ago). It was only after the parsing error that I started messing with the content. ??

    Unfortunately the domain provider does not allow access to the tomcat logs. I wonder if they even write logs.

    By the way, the PHP version was not the reason. I changed it to 5.6.30 on the target site but the error persists.

    Plugin Author gioni

    (@gioni)

    Yes, the version of PHP is not the cause at all.

    Have you tried to reimport the file back to the source website?

    Try to export/import just settings only and then settings plus access lists.

    Thread Starter superninchen

    (@superninchen)

    Hi Gioni,

    thank you for your immediate response.

    Meanwhile I tried all variations, exporting and then directly importing the same file on the same site again. Settings, Access Lists, and Settings + Access Lists. All three fail to parse.

    The server’s error log does not show anything.

    Very strange indeed.

    Cheers,
    Sascha

    Thread Starter superninchen

    (@superninchen)

    I have a new trace!

    Back in March I managed to import the settings and access lists from site A to site B. Currently I was trying to import those from A to site C, when said error occurred.

    Today I created another new WP site D and tried to import from A again, which failed to parse again.

    Then I exported from site B and imported that file successfully into site D.

    I compared the two exported files with Notepad++, and the exported file from site A is in UTF-8-BOM format, while the other is in UTF-8 format only. There is the difference!

    Question is: where is it coming from?

    Plugin Author gioni

    (@gioni)

    Wow! That’s an interesting issue.

    I suspect:

    1. An intermediate device or software like a proxy server.
    2. The webserver and most likely a particular PHP setting (module).
    3. Different versions of PHP.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Import access list –> “Error parsing file”’ is closed to new replies.