Mapping module generating error messages

I’m using Omeka 4.04 and Mapping module 1.10.

I have item pages with a map block showing. Everything seems to work fine.

But, I have the Log module installed. I have noticed that there are error messages in the Log that seem to be produced by the Mapping module.

If a user is not logged in then viewing an item page with a map generates an error message:

Omeka\Api\Exception\PermissionDeniedException: Permission denied for the current user to read the Mapping\Entity\Mapping resource

If a user is logged in and goes to the same page, then an error message is not produced.

Is there some setting somewhere that I have missed?
Is there some

Does the logged error have any more information, like a stack trace or line number? It would be helpful for me to troubleshoot.

Sorry, should have included that. (In the trace, I’ve replaced the local path with ‘xxx’ for brevity.)

Omeka\Api\Exception\PermissionDeniedException: Permission denied for the current user to read the Mapping\Entity\Mapping resource. in xxx/application/src/Api/Adapter/AbstractEntityAdapter.php:671
Stack trace:
#0 xxx/application/src/Api/Adapter/AbstractEntityAdapter.php(433): Omeka\Api\Adapter\AbstractEntityAdapter->authorize(Object(Mapping\Entity\Mapping), ‘read’)
#1 xxx/application/src/Api/Manager.php(230): Omeka\Api\Adapter\AbstractEntityAdapter->read(Object(Omeka\Api\Request))
#2 xxx/application/src/Api/Manager.php(115): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#3 xxx/application/src/Controller/ApiController.php(53): Omeka\Api\Manager->read(‘mappings’, ‘3985’)
#4 xxx/vendor/laminas/laminas-mvc/src/Controller/AbstractRestfulController.php(373): Omeka\Controller\ApiController->get(‘3985’)
#5 xxx/application/src/Controller/ApiController.php(168): Laminas\Mvc\Controller\AbstractRestfulController->onDispatch(Object(Laminas\Mvc\MvcEvent))
#6 xxx/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Omeka\Controller\ApiController->onDispatch(Object(Laminas\Mvc\MvcEvent))
#7 xxx/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#8 xxx/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#9 xxx/vendor/laminas/laminas-mvc/src/Controller/AbstractRestfulController.php(307): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))
#10 xxx/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractRestfulController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))
#11 xxx/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))
#12 xxx/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#13 xxx/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#14 xxx/index.php(21): Laminas\Mvc\Application->run()
#15 {main}

On what page do you see this error? According to the trace, the error occurs when accessing the mappings resource via the REST API, which is not what you’re describing.

Nonetheless, it does expose a minor bug in access control which will be fixed in the next version.

Thanks for the response. I’ve done more testing, and indeed the errors do not seem to be being generally triggered on visiting an item page with a mapping block. Sorry for the misdirection.

I’m still trying to find out what is triggering them. The stack trace includes a line e.g.

…/application/src/Controller/ApiController.php(53): Omeka\Api\Manager->read(‘mappings’, ‘6283’)

To help me try and figure out what’s going on, please could you tell me what is that ‘6283’ - is that an item ID, or an id from the mapping_marker table or the mapping table?

Something (likely a bot) is requesting the mappings resource via the REST API. The “6283” is the mappings resource ID, which you can find in the mapping table in the database. The table contains map bounds, which are set by users when editing a item’s map.

I think the errors will go away after you upgrade to the next version, which we plan on releasing in May.

1 Like

Thanks a lot for the clarification and the help with this - much appreciated.