Jobs not working, fix doesn't work with solr/search

Out of the box, on my host, jobs are not launching in Omeka S.

I have no error but a job such as a batch modification will be in starting mode forever with no modification to the items.

Solution 1 : Synchronous strategy


A workaround could be to set the job strategy to “synchronous” with:

'service_manager' => [ 
       'aliases' => [
       'Omeka\Job\DispatchStrategy' => 'Omeka\Job\DispatchStrategy\Synchronous',

in local.config.php.

However, it is not a good solution for me. I have too many items (~22000) and some jobs could require more time than the timeout of the page. For example, I cannot index all my items with solr with this configuration.

Solution two - set php cli path without options

(works for batch jobs but only when Solr and Search are disabled - does not work for solr indexing process)

I tried to set the php cli path in local.config.php.
which php gives me /shared/php/7.0/current/bin/php -c /sites/user/resource/wrapper/php70/php.ini

So I set the php cli path without options (Omeka S does not find php if I add the “-c …” part (user options))

    'cli' => [
	'phpcli_path' => '/shared/php/7.0/current/bin/php'

After that a batch job fails with the error:

2018-06-12T09:42:58+00:00 INFO (6): Indexing resource #48569 (items)
Fatal error: Uncaught Error: Class ‘SolrClient’ not found in /sites/user/www/www_alpha/afas/modules/Solr/src/Indexer.php:189

I think Search/Solr are trying to index the change and fail. Solr indexing (launched by the Search module) does not work with the same error.

If I disable Search and Solr, batch job are working fine.

Third solution - script

(not working at all)

Maybe the user options are necessary to work with Solr. I tried to set as php cli path a script containing:

/shared/php/7.0/current/bin/php -c /sites/user/resource/wrapper/php70/php.ini $1

and then, in local.config.php, the path to this script.

Jobs are are in starting stade but never end and do nothing.

As you can see, there is no complete solution. Do someone has a idea are some thoughts I can share to my web host to fix jobs management in Omeka S?

In the second solution, it says Class ‘SolrClient’ not found: it means you didn’t install the php-solr package. See the documentation about the module Solr (and use the version on, the same for Search, they are not yet updated upstream for last version of Omeka S).

Since the error appears only with CLI SAPI, I think php-solr is installed, but configured in a specific INI file (/sites/user/resource/wrapper/php70/php.ini), which should be indicated to php through -c parameter.

This is very server related. php-solr should be loaded via the config. You may find more help on a php forum to define how to make solr available in cli via a special config.

You are right pols12. The file /sites/user/resource/wrapper/php70/php.ini contains a line to launch solr.

I don’t know how to tell Omeka S to launch php with this configuration considering the script does not work.

I was using your version for the Solr module and the one from biblibre for the Search module.

I updated the Search module with your version but now I have an error when visiting the solr page:

Page not found.

Raison : error-controller-cannot-dispatch

The configuration both in Search and Solr are exactly the same than before. I tried the version fetched with “git clone” and “download zip” for the search module.

You may have to check the slug of the search index pages and the main settings, and the settings of each site.

Indeed! I had to play with Enable / disable page settings in Search module.