Monthly Cron error

On my new VPS I get the following error while going to https://my_site/cron/monthly/

How to solve?

Thank you

Fatal Error.

An exception occurred while executing 'ALTER TABLE elgg_system_log_1627605221 engine=archive':

SQLSTATE[42000]: Syntax error or access violation: 1286 Unknown storage engine 'archive'

QUERY: ALTER TABLE elgg_system_log_1627605221 engine=archive

  • Your Q&A is here ;)

    I very recommend to disable System log plugin.

  • History repeats itself :)

    Thank you Nikolai

    I deactivated Log Rotate plugin and the error disappeared, instead I received a long report from the GARBAGE COLLECTOR.  

    Is there a way to disable public access to the cron pages?

    Thank you again. We really appreciate your help.

  • I deactivated Log Rotate plugin and the error disappeared, instead I received a long report from the GARBAGE COLLECTOR.  

    I recommend to disable System Log plugin too.

    Is there a way to disable public access to the cron pages?

    I think you're looking in the wrong way.

  • I do not see System Log plugin in my installation. I have Log Browser plugin.

    I think you're looking in the wrong way.

    I do not understand. I mean that everyone can visit https://my_site/cron/monthly/ and other cron pages and trigger the code, or maybe I'm wrong. I would like to block this possibility if possible and run the code in another way.

  • I do not see System Log plugin in my installation

    Nice.

    I do not understand.

    Ahh. Elgg 2.x.

    Sorry, you haven't such option ¯\_(ツ)_/¯

    It's time to upgrade.

  • It will take me sometime to upgrade. I have continue with the 2.3.

    I think I saw a discussion about the same topic with a suggestion how to do it on 2.3 but I cannot find it right now.

  • If MariaDB is used on your sever you need to adjust two things to get Elgg fully working. Unfortunately, I can only tell you how I had to adjust the configuration on my (local) Linux installation to get it working. The server configuration might be different in your case depending on what tools are available for server administration and where the necessary config files are to be found. If you don't find out yourself how to alter the DB server config, ask the support of your wehboster.

    Firstly, the "archive" database engine needs to be enabled. In case of my server the file is in /etc/my.cnf.d/default_plugins.cnf:

    [server]
    plugin-load-add=archive=ha_archive.so

    The second change I had to do was in /etc/my.cnf:

    [mysqld]
    max_delayed_threads = 0

    I've only posted the relevant lines and the sections these lines would be in the config files. So, there could be other content in these files you wouldn't have to modify.

    The archive engine is necessary for the log table rotation to work, i.e. older log entries are moved into a new table. If you don't need the log entries in the database, you can also use this plugin: https://elgg.org/plugins/1441338. Then the entries won't be created in the first place (on Elgg 3 or newer you could disable the corresponding plugin for the same effect). And you can increase the log rotation interval in the plugin settings.

    The delayed thread settings in my.cnf is necessary for an issue I also had regularly with MariaDB. I don't remember at the moment what action caused it (I had opened an issue in the Elgg repository at github but then realized how to "fix" it by adjusting the DB server configuration). The delayed queries happen only rarely, sothe delayed thread setting shouldn't decrease performance at all.

  • Thank you iionly.

    I followed your advise and as far as I understand it works well.

    I was not sure about the location of  /etc/my.cnf.d/default_plugins.cnf location in my installation so I followed the MariaDB guid and used the following:

    MariaDB> INSTALL PLUGIN archive SONAME 'ha_archive.so';

    I reactivated Log Rotate plugin and the monthly cron works well I think. For every monthly cron trigger a new table is created in Elgg DB.

    However the Log Rotate plugin does not delete tables older than one month as in its setup. Is it a known bug?

    I would appreciate it if you could briefly describe the importance of the archive for the functioning of the Elgg.

    Thank you very much for the detailed and useful answer.

     

     

  • However the Log Rotate plugin does not delete tables older than one month as in its setup. Is it a known bug?

    This wasn't a feature in Elgg 2.3. In Elgg 3 we added a setting that would cleanup the older log tables after a amount of time.

    I would appreciate it if you could briefly describe the importance of the archive for the functioning of the Elgg.

    If you don't rotate the log table it'll grow and grow. Thus making the Log browser feature slower and slower. It'll also affect backup times but that doesn't get any better with just rotating the logs. For that the rotated log tables need to be cleaned up.

    With the log tables rotated it's easier to remove old logs as you can simply drop an entire rotated table.

  • Thank you Jerome.

    The problem is that in spite of the following settings it does not delete old tables.

    Plugin Settings

    Log Rotate

    How often should the system log be archived? 
    Delete archived logs older than a