Omeka S3.0.1 module Ark error

I am currently using Omeka S 3.0.1 and I encountered a problem during the installation of version 3.5.8.3 of the Ark module :

Warning: require_once(/applis/omekas/home/www/omeka-s/modules/Ark/vendor/autoload.php): failed to open stream: No such file or directory in /applis/omekas/home/www/omeka-s/modules/Ark/Module.php on line 36 Fatal error: require_once(): Failed opening required ‘/applis/omekas/home/www/omeka-s/modules/Ark/vendor/autoload.php’ (include_path=’.:/usr/share/php5:/usr/share/php5/PEAR’) in /applis/omekas/home/www/omeka-s/modules/Ark/Module.php on line 36

To create the “vendor” directory which contains, among other things, the autoload.php file indicated in the error message, I launched under the directory containing the file “composer.json” (…/modules/Ark), the following command:

composer install

And I get the following information:

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.

Package operations: 2 installs, 0 updates, 0 removals
- Installing daniel-km/noid4php (1.1.0): Downloading (0%)
Downloading (0%)
Downloading (0%)
In RemoteFilesystem.php line 398:

The “https://gitlab.com/users/sign_in” file could not be downloaded (HTTP/1**.1 503 Service Temporarily Unavailable)**

install [–prefer-source] [–prefer-dist] [–dry-run] [–dev] [–no-dev] [–no-custom-installers] [–no-autoloader] [–no-scripts] [–no-progress] [–no-suggest] [-v|vv|vvv|–verbose] [-o|–optimize-autoloader] [-a|–classmap-authoritative] [–apcu-autoloader] [–ignore-platform-reqs] [–] []…

Does anyone have any ideas ?

Thank you in advance

It’s definitely a situation where you have to run composer install, like you did.

The error you got when trying to install, I’m not sure what’s going on with that… I think you’d have to check with @Daniel_KM, the author of the module.

It uses the new composer that doesn’t allow uppercase in names. It is fixed in version 3.5.9.3.

I downloaded the new version 3.5.9.3 and was able to install it.
But when I modify a resource, when it should generate an Ark for it, I get the following error:

Doctrine\DBAL\Exception\DriverException
An exception occurred while executing ‘SELECT value.resource_id, resource.resource_type FROM value value INNER JOIN resource resource ON resource.id = value.resource_id WHERE (value.property_id = 10) AND (value.type = “literal”) AND (value.value = ?) GROUP BY value.resource_id ORDER BY value.resource_id ASC, value.id ASC LIMIT 1’ with params [“ark:/67375/CG291Xd4bN3H”]: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column ‘omekas_db.value.id’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Détails :

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column ‘omekas_db.value.id’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by in /applis/omekas/home/www/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117
Stack trace:
#0 /applis/omekas/home/www/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(117): PDOStatement->execute(NULL)
#1 /applis/omekas/home/www/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(905): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 /applis/omekas/home/www/omeka-s/modules/Ark/src/ArkManager.php(565): Doctrine\DBAL\Connection->executeQuery(‘SELECT value.re…’, Array)
#3 /applis/omekas/home/www/omeka-s/modules/Ark/src/ArkManager.php(526): Ark\ArkManager->findStatic(‘ark:/67375/CG29…’)
#4 /applis/omekas/home/www/omeka-s/modules/Ark/src/ArkManager.php(380): Ark\ArkManager->arkExists(‘ark:/67375/CG29…’)
#5 /applis/omekas/home/www/omeka-s/modules/Ark/Module.php(254): Ark\ArkManager->createName(Object(Omeka\Api\Representation\ItemRepresentation))
#6 /applis/omekas/home/www/omeka-s/modules/Ark/Module.php(215): Ark\Module->addArk(Object(Omeka\Entity\Item))
#7 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Ark\Module->handleSaveResource(Object(Laminas\EventManager\Event))
#8 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(170): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\EventManager\Event))
#9 /applis/omekas/home/www/omeka-s/application/src/Api/Manager.php(323): Laminas\EventManager\EventManager->triggerEvent(Object(Laminas\EventManager\Event))
#10 /applis/omekas/home/www/omeka-s/application/src/Api/Manager.php(269): Omeka\Api\Manager->finalize(Object(Omeka\Api\Adapter\ItemAdapter), Object(Omeka\Api\Request), Object(Omeka\Api\Response))
#11 /applis/omekas/home/www/omeka-s/application/src/Api/Manager.php(136): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#12 /applis/omekas/home/www/omeka-s/application/src/Mvc/Controller/Plugin/Api.php(152): Omeka\Api\Manager->update(‘items’, ‘1230’, Array, Array, Array)
#13 /applis/omekas/home/www/omeka-s/application/src/Controller/Admin/ItemController.php(245): Omeka\Mvc\Controller\Plugin\Api->update(‘items’, ‘1230’, Array, Array)
#14 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(77): Omeka\Controller\Admin\ItemController->editAction()
#15 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))
#16 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#17 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(105): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#18 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-mvc/src/DispatchListener.php(139): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))
#19 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))
#20 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#21 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-mvc/src/Application.php(331): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#22 /applis/omekas/home/www/omeka-s/index.php(21): Laminas\Mvc\Application->run()
#23 {main}

Next Doctrine\DBAL\Driver\PDOException: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column ‘omekas_db.value.id’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by in /applis/omekas/home/www/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:119
Stack trace:
#0 /applis/omekas/home/www/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(905): Doctrine\DBAL\Driver\PDOStatement->execute()
#1 /applis/omekas/home/www/omeka-s/modules/Ark/src/ArkManager.php(565): Doctrine\DBAL\Connection->executeQuery(‘SELECT value.re…’, Array)
#2 /applis/omekas/home/www/omeka-s/modules/Ark/src/ArkManager.php(526): Ark\ArkManager->findStatic(‘ark:/67375/CG29…’)
#3 /applis/omekas/home/www/omeka-s/modules/Ark/src/ArkManager.php(380): Ark\ArkManager->arkExists(‘ark:/67375/CG29…’)
#4 /applis/omekas/home/www/omeka-s/modules/Ark/Module.php(254): Ark\ArkManager->createName(Object(Omeka\Api\Representation\ItemRepresentation))
#5 /applis/omekas/home/www/omeka-s/modules/Ark/Module.php(215): Ark\Module->addArk(Object(Omeka\Entity\Item))
#6 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Ark\Module->handleSaveResource(Object(Laminas\EventManager\Event))
#7 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(170): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\EventManager\Event))
#8 /applis/omekas/home/www/omeka-s/application/src/Api/Manager.php(323): Laminas\EventManager\EventManager->triggerEvent(Object(Laminas\EventManager\Event))
#9 /applis/omekas/home/www/omeka-s/application/src/Api/Manager.php(269): Omeka\Api\Manager->finalize(Object(Omeka\Api\Adapter\ItemAdapter), Object(Omeka\Api\Request), Object(Omeka\Api\Response))
#10 /applis/omekas/home/www/omeka-s/application/src/Api/Manager.php(136): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#11 /applis/omekas/home/www/omeka-s/application/src/Mvc/Controller/Plugin/Api.php(152): Omeka\Api\Manager->update(‘items’, ‘1230’, Array, Array, Array)
#12 /applis/omekas/home/www/omeka-s/application/src/Controller/Admin/ItemController.php(245): Omeka\Mvc\Controller\Plugin\Api->update(‘items’, ‘1230’, Array, Array)
#13 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(77): Omeka\Controller\Admin\ItemController->editAction()
#14 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))
#15 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#16 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(105): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#17 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-mvc/src/DispatchListener.php(139): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))
#18 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))
#19 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#20 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-mvc/src/Application.php(331): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#21 /applis/omekas/home/www/omeka-s/index.php(21): Laminas\Mvc\Application->run()
#22 {main}

Next Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ‘SELECT value.resource_id, resource.resource_type FROM value value INNER JOIN resource resource ON resource.id = value.resource_id WHERE (value.property_id = 10) AND (value.type = “literal”) AND (value.value = ?) GROUP BY value.resource_id ORDER BY value.resource_id ASC, value.id ASC LIMIT 1’ with params [“ark:/67375/CG291Xd4bN3H”]:

SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column ‘omekas_db.value.id’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by in /applis/omekas/home/www/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:106
Stack trace:
#0 /applis/omekas/home/www/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(169): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException(‘An exception oc…’, Object(Doctrine\DBAL\Driver\PDOException))
#1 /applis/omekas/home/www/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(145): Doctrine\DBAL\DBALException::wrapException(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), ‘An exception oc…’)
#2 /applis/omekas/home/www/omeka-s/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(913): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), ‘SELECT value.re…’, Array)
#3 /applis/omekas/home/www/omeka-s/modules/Ark/src/ArkManager.php(565): Doctrine\DBAL\Connection->executeQuery(‘SELECT value.re…’, Array)
#4 /applis/omekas/home/www/omeka-s/modules/Ark/src/ArkManager.php(526): Ark\ArkManager->findStatic(‘ark:/67375/CG29…’)
#5 /applis/omekas/home/www/omeka-s/modules/Ark/src/ArkManager.php(380): Ark\ArkManager->arkExists(‘ark:/67375/CG29…’)
#6 /applis/omekas/home/www/omeka-s/modules/Ark/Module.php(254): Ark\ArkManager->createName(Object(Omeka\Api\Representation\ItemRepresentation))
#7 /applis/omekas/home/www/omeka-s/modules/Ark/Module.php(215): Ark\Module->addArk(Object(Omeka\Entity\Item))
#8 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Ark\Module->handleSaveResource(Object(Laminas\EventManager\Event))
#9 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(170): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\EventManager\Event))
#10 /applis/omekas/home/www/omeka-s/application/src/Api/Manager.php(323): Laminas\EventManager\EventManager->triggerEvent(Object(Laminas\EventManager\Event))
#11 /applis/omekas/home/www/omeka-s/application/src/Api/Manager.php(269): Omeka\Api\Manager->finalize(Object(Omeka\Api\Adapter\ItemAdapter), Object(Omeka\Api\Request), Object(Omeka\Api\Response))
#12 /applis/omekas/home/www/omeka-s/application/src/Api/Manager.php(136): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#13 /applis/omekas/home/www/omeka-s/application/src/Mvc/Controller/Plugin/Api.php(152): Omeka\Api\Manager->update(‘items’, ‘1230’, Array, Array, Array)
#14 /applis/omekas/home/www/omeka-s/application/src/Controller/Admin/ItemController.php(245): Omeka\Mvc\Controller\Plugin\Api->update(‘items’, ‘1230’, Array, Array)
#15 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(77): Omeka\Controller\Admin\ItemController->editAction()
#16 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))
#17 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#18 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(105): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#19 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-mvc/src/DispatchListener.php(139): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))
#20 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(321): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))
#21 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-eventmanager/src/EventManager.php(178): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#22 /applis/omekas/home/www/omeka-s/vendor/laminas/laminas-mvc/src/Application.php(331): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#23 /applis/omekas/home/www/omeka-s/index.php(21): Laminas\Mvc\Application->run()
#24 {main}

You use a database that does not support the old behavior of “group by” (probably a new mysql database). I’m checking if I can fix it directly in the sql queries.

I updated the module, can you check if it is fixed? Thanks.

I got the latest version from your site and I launched under the directory containing the file “composer.json” (…/modules/Ark), the following command:

composer installI

Unfortunately I get the same error as before

I got the same error message with ARK module. I use MySQL version 14.4, Dist. 5.7

Doctrine\DBAL\Exception\DriverException
An exception occurred while executing ‘SELECT value.resource_id, resource.resource_type FROM value value INNER JOIN resource resource ON resource.id = value.resource_id WHERE (value.property_id = 10) AND (value.type = “literal”) AND (value.value = ?) GROUP BY value.resource_id ORDER BY value.resource_id ASC, value.id ASC LIMIT 1’ with params [“ark:/36256/23”]: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column ‘omeka-s.value.id’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Thanks in advance.

Hello again.
I found this provisional solution:

in src/ArkManager.php, I commented 561-563 lines

    ->groupBy('value.resource_id','resource.resource_type')
        /* ->addOrderBy('value.resource_id', 'ASC')
        ->addOrderBy('value.id', 'ASC') */
        // Only one identifier by resource.
1 Like

Hi,
I have applied this temporary solution. Thank you for your help.
Waiting for the version that will bring a fix.

In addition, the indication of the ‘value.id’ property in the Group By clause may be missing, a property that appears in the Select list.

in src/ArkManager.php

->groupBy(['value.resource_id','resource.resource_type','value.id'])
 ->addOrderBy('value.resource_id', 'ASC')
  ->addOrderBy('value.id', 'ASC')

Ok, thanks.
The point is that I develop on mariadb, not mysql, and the last versions manage differently the option “group by”.

I downloaded the new version 3.5.10.3 which should fix support of “group by” by mysql.

ButI have the same problem as with the previous version 3.5.9.3.

Doctrine\DBAL\Exception\DriverException
An exception occurred while executing ‘SELECT value.resource_id, resource.resource_type, value.id FROM value value INNER JOIN resource resource ON resource.id = value.resource_id WHERE (value.property_id = 10) AND (value.type = “literal”) AND (value.value = ?) GROUP BY value.resource_id ORDER BY value.resource_id ASC, value.id ASC LIMIT 1’ with params [“ark:/67375/CG22Vs7pxN6h”]: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘omekas_db.value.id’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

The ‘Group By’ statement is not correct when using MySQL.

And when I look at the source of src/ArkManager.php, I don’t see any difference with version 3.

5.9.3

For example :

3.5.10.3 :

->select([

‘value.value’,

‘value.resource_id’,

‘resource.resource_type’,

// Only needed to support group by on mysql.

‘value.id’,

])

->from(‘value’, ‘value’)

->innerJoin(‘value’, ‘resource’, ‘resource’, ‘resource.id = value.resource_id’)

// Property 10 = dcterms:identifier.

->where(‘value.property_id = 10’)

->andWhere(‘value.type = “literal”’)

->groupBy([‘value.resource_id’])

->addOrderBy(‘value.resource_id’, ‘ASC’)

->addOrderBy(‘value.id’, ‘ASC’);

Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘omekas_db.value.value’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

For the query to work, the ‘group by’ statement should contain the properties of the table value in the select statement

->groupBy([‘value.resource_id’, ‘value.value’, ‘value.id’])

You can try to use 'ANY_VALUE(value.resource_id)',, it will fix the issue. I’m updating the module in that way in a few days, there may be some places for that. Nevertheless, any_value is not supported by all databases (omeka s requires compatibility with very old version of mysql).

or MIN(), because it returns the first value with the ark.

I tried to use ‘ANY_VALUE’ and it works…but only if you also use it for properties that are in the ‘order by’ clause and not in the ‘group by’ clause.

For example :

        ->select([
            'ANY_VALUE(value.value)',
       	'value.resource_id',
            'ANY_VALUE(resource.resource_type)',
            // Only needed to support group by on mysql.
            'ANY_VALUE(value.id)',
        ])
        ->from('value', 'value')
        ...
        ->groupBy(['value.resource_id'])
        ->addOrderBy('value.resource_id', 'ASC')
        ->addOrderBy('ANY_VALUE(value.id)', 'ASC');

I will wait until you have modified the module.

I published version Ark-3.5.11.3 with the first fix above. Is it working ?