[OJS 3.1.2.4] Problem plugin Lucene Solr

Hi,

Activate the Lucene / Solr plugin in my OJS version 3.1.2.4, with the Solr installed on my server correctly and when entering a magazine I am shown the following errors:

PHP Warning:  Declaration of LuceneSettingsForm::execute() should be compatible with Form::execute(...$functionArgs) in /plugins/generic/lucene/classes/form/LuceneSettingsForm.inc.php on line 0
PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /lib/pkp/classes/db/DAO.inc.php on line 87
PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 528384 bytes) in /lib/pkp/classes/db/DAO.inc.php on line 87

Hi,

Someone who knows or who can help me with this problem.

Hi @diegomejia07

you’ll need to adjust your PHP configuration on your server to allow for more than 30 seconds’ worth of run time and more than 1Mb of memory. You can do this in a number of ways, but it depends on your server environment.

Here’s a resource showing how to raise the memory limit. Raising the execution time will be similar:

https://www.simplified.guide/php/increase-memory-limit

Best,
Jason

Hi @jnugent,

I had already modified my values ​​in my server’s php.ini file, but this error keeps appearing.

image

PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 528384 bytes) in /lib/pkp/classes/db/DAO.inc.php on line 87.
PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in /lib/pkp/lib/vendor/illuminate/database/Grammar.php on line 99.

If it isn’t working with your regular ini file you can also try a .user.ini file in your webroot:

Best
Jason

Hi,

I have another problem and it is that when starting solr according to the plugin documentation, I get the following error

WARNING: Starting Solr as the root user is a security risk and not considered best practice. Exiting.
         Please consult the Reference Guide. To override this check, start with argument '-force'

This happens when I run

To start the Solr server as a user different from root (recommended) use:

sudo su -p -l -s /bin/bash -c "./start.sh"

Hi,

How can I run the comendo without problems and how can I configure the Lucene plugin to work in my OJS 3.2.1.4 installation.

Hi @asmecher,

I did the installation of the Lucene/Solr plugin with Embedded Server Mode: Installation and Configuration, but when I enter and try the search endpoint http://xxxxxxxxx:8983/solr/ojs/search, it gives me the following error in the browser:

image

Also, when trying to configure the plugin from the plugins section of the OJS platform, it does not open and stays loading:

image

When rebuilding the index php tools/rebuildSearchIndex.php -d shows me the following error:

LucenePlugin: Reset index…done
LucenePlugin: Indexing “Philology. Academic and cultural newsletter”

PHP Warning: Use of undefined constant STATUS_PUBLISHED - assumed 'STATUS_PUBLISHED' (this will throw an Error in a future version of PHP) in /plugins/generic/lucene/classes/SolrWebService.inc.php on line 178

And at the end the indexing crashes and shows the following error:

 PHP Fatal error:  Uncaught Exception: DB Error: MySQL server has gone away Query: UPDATE submission_settings SET setting_value = ? WHERE setting_name = ? AND submission_id = ? in /lib/pkp/classes/db/DAO.inc.php:703
Stack trace:
#0 /lib/pkp/classes/db/DAO.inc.php(231): DAO->handleError(Object(ADODB_mysqli), 'UPDATE submissi...')
#1 /plugins/generic/lucene/classes/SolrWebService.inc.php(292): DAO->update('UPDATE submissi...', Array)
#2 /plugins/generic/lucene/classes/SolrWebService.inc.php(213): SolrWebService->_indexingTransaction(Array, 200, 157)
#3 /plugins/generic/lucene/LucenePlugin.inc.php(1178): SolrWebService->pushChangedArticles(200, 157)
#4 /plugins/generic/lucene/LucenePlugin.inc.php(706): LucenePlugin->_rebuildIndex(true, Object(Journal), true, true, 'LucenePlugin: R...')
#5 /var/www/htm in /lib/pkp/classes/db/DAO.inc.php on line 703
PHP Fatal error:  Uncaught Exception: DB Error: MySQL server has gone away Query: UPDATE sessions
                                SET
                                        user_id = ?,
                                        ip_address = ?,
                                        user_agent = ?,
                                        created = ?,
                                        last_used = ?,
                                        remember = ?,
                                        data = ?,
                                        domain = ?
                                WHERE session_id = ? in /lib/pkp/classes/db/DAO.inc.php:703
Stack trace:
#0 /lib/pkp/classes/db/DAO.inc.php(231): DAO->handleError(Object(ADODB_mysqli), 'UPDATE sessions...')
#1 /lib/pkp/classes/session/SessionDAO.inc.php(109): DAO->update('UPDATE sessions...', Array)
#2 /lib/pkp/classes/session/SessionManager.inc.php(185): SessionDAO->updateObject(Object(Session))
#3 [internal function]: SessionManager->write('5oc1ldi6o93m7uf...', '')
#4 [internal function]: session_write_close()
#5 {main}
  thrown in /lib/pkp/classes/db/DAO.inc.php on line 703

And when this plugin is active, the journals are not displayed, they take a long time to load:

image

Hi @diegomejia07,

The message:

PHP Fatal error:  Uncaught Exception: DB Error: MySQL server has gone away

…suggests that OJS was communicating with MySQL but MySQL closed the connection. I’d suggest checking your MySQL configuration to see if it has a short timeout or something similar.

Beyond that, can you include information on what version of the Lucene plugin you installed, how you installed it, and if you downloaded it outside the Plugin Gallery, where you got it from?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

This is the MySQL timeout setting I have on my server.

image

The plugin version is installed from the platform plugin gallery: The version is v1.2.0.1

And the plugin configuration was done through the official Github documentation whit Embedded Server Mode: Installation and Configuration,

Hi @diegomejia07,

If the indexing task fails after 10 minutes, then the wait_timeout is likely the cause. If you’re seeing a failure before that much time passes, I’m not sure what would cause that.

In any case, PKP doesn’t maintain the Lucene plugin; you might try contacting the maintainer over here:

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

It seems to me that the MySQL wait_timeout is too high since I have other servers and the timeout is even lower, and if this process takes so long as to crash, I think there is something that is not normal, or that there is some error or inconvenience, either with the plugin for this version of
OJS or on the platform.

Hi @diegomejia07,

It may be an interaction between OJS and the Lucene plugin; I don’t think it’s a behaviour of the OJS core, or we’d see it happening elsewhere. The reindexing is an unusually long-running batch job, so that might be an angle to start investigating.

Regards,
Alec Smecher
Public Knowledge Project Team

This topic was automatically closed after 10 days. New replies are no longer allowed.