Viewing 15 replies - 1 through 15 (of 21 total)
  • Thread Starter gagomap

    (@gagomap)

    I just have deactivated NF and changed admin email. Then i have reactivated NF again and didn’t see any noctice.

    NF iss very strange.

    Plugin Author nintechnet

    (@nintechnet)

    Hi,

    Where did you change the admin email: From the WordPress “Users” menu, or the “Settings” Menu or from NinjaFirewall “Event Notifications” menu?

    Thread Starter gagomap

    (@gagomap)

    it’s in admin profile.

    Plugin Author nintechnet

    (@nintechnet)

    Maybe you (or your host) had a database backup running and the tables were locked which would explain the message? Or your DB was too slow and it was not possible to connect to it?

    I can change the admin password and I don’t get any error.

    Thread Starter gagomap

    (@gagomap)

    No, there is no backup running or my DB is too slow.
    I run 2 site on a VPS 2GB ram. Everthing are very fast.

    I have tried to change email 3 times. This notice always display.

    Plugin Author nintechnet

    (@nintechnet)

    Did you check MySQL log?
    The firewall will display the error message if this query failed:

    SELECT * FROM '{table_prefix}options' WHERE 'option_name' = 'nfw_rules'

    Thread Starter gagomap

    (@gagomap)

    Where i can find MySQL log file ?

    I’m using MariaDB on EasyEngine.

    Plugin Author nintechnet

    (@nintechnet)

    Depends on your OS, distro etc.
    Folders:
    /var/log/ and /var/log/mysql/
    /var/lib/mysql/

    Files: /var/log/messages

    Thread Starter gagomap

    (@gagomap)

    I’m installing all site on Ubuntu. I had install suhoshin on my VPS.

    There is no error message in log file.
    I have checked /var/log/mysql and all log files in /var/log

    Plugin Author nintechnet

    (@nintechnet)

    We can force NinjaFirewall to write the error message to the dashboard.
    But fist, I need to know which message exactly you received because there are 3 differents ones.
    Is it:
    Cannot retrieve user rules from database (#1)
    Or:
    Cannot retrieve user rules from database (#2)
    Or:
    Cannot retrieve user rules from database (#3)

    Thread Starter gagomap

    (@gagomap)

    It is: Cannot retrieve user rules from database (#2)

    As i remember it. ??

    Plugin Author nintechnet

    (@nintechnet)

    You can try this:

    1. Download the /plugins/ninjafirewall/lib/firewall.php to your computer.
    2. Make a backup of it (very important).
    3. Open firewall.php and search for those 2 lines:
    Line 325:

    define( 'NFW_STATUS', 7 );

    Line 331:

    define( 'NFW_STATUS', 8 );

    -Replace those 2 lines with that one:

    define( 'NFW_STATUS', htmlspecialchars($nfw_['mysqli']->error) );

    4. Save and upload the new version.
    5. Go to your admin dashboard and paste here the error message.
    6. Restore the original firewall.php backup script.

    Thread Starter gagomap

    (@gagomap)

    I do as you say, but there is no error message, and there is no notice appear.

    I will restore my VPS then i can test more.

    Thread Starter gagomap

    (@gagomap)

    After i restored my VPS, replaced your code, changed email again.
    And this is a error message:

    NinjaFirewall fatal error: unknown error #MySQL server has gone away. Review your installation, your site is not protected

    .

    Plugin Author nintechnet

    (@nintechnet)

    That is a MySQL error/issue.
    You will need to check the doc (https://dev.mysql.com/doc/refman/5.7/en/gone-away.html) and solve the problem.
    Check time out values, connection etc.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Cannot retrieve user rules from database’ is closed to new replies.