pimcore / generic-data-index-bundle

Other
3 stars 2 forks source link

[Bug] Saving asset is not possible #108

Closed mattamon closed 6 months ago

mattamon commented 6 months ago

Tried to call data-index commands, but could not fix the problem.

Steps to reproduce:

  1. Open asset on http://dev-portalengine4.pimcore.app/admin/login/deeplink?asset_289_image
  2. Try to save the asset.

Same behavior on freshly installed platform server: https://platform.pimcore.app/

Expected behavior: Asset should be saved and indexed without an error.

Actual behavior: When saving asset the following error occurs:

 Timestamp: Thu Mar 14 2024 15:29:22 GMT+0100 (Central European Standard Time)
Status: 500 | Internal Server Error
URL: /admin/asset/save
Method: PUT
Message: {"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index [datahub_restindex__ci-hub-endpoint__asset]","index":"datahub_restindex__ci-hub-endpoint__asset","resource.id":"datahub_restindex__ci-hub-endpoint__asset","resource.type":"index_or_alias","index_uuid":"_na_"}],"type":"index_not_found_exception","reason":"no such index [datahub_restindex__ci-hub-endpoint__asset]","index":"datahub_restindex__ci-hub-endpoint__asset","resource.id":"datahub_restindex__ci-hub-endpoint__asset","resource.type":"index_or_alias","index_uuid":"_na_"},"status":404}
Trace: 
in /var/www/html/vendor/opensearch-project/opensearch-php/src/OpenSearch/Connections/Connection.php:656
#0 /var/www/html/vendor/opensearch-project/opensearch-php/src/OpenSearch/Connections/Connection.php(328): OpenSearch\Connections\Connection->process4xxError(Array, Array, Array)
#1 /var/www/html/vendor/react/promise/src/FulfilledPromise.php(28): OpenSearch\Connections\Connection->OpenSearch\Connections\{closure}(Array)
#2 /var/www/html/vendor/ezimuel/ringphp/src/Future/CompletedFutureValue.php(65): React\Promise\FulfilledPromise->then(Object(Closure), NULL, NULL)
#3 /var/www/html/vendor/ezimuel/ringphp/src/Core.php(341): GuzzleHttp\Ring\Future\CompletedFutureValue->then(Object(Closure), NULL, NULL)
#4 /var/www/html/vendor/opensearch-project/opensearch-php/src/OpenSearch/Connections/Connection.php(260): GuzzleHttp\Ring\Core::proxy(Object(GuzzleHttp\Ring\Future\CompletedFutureArray), Object(Closure))
#5 /var/www/html/vendor/opensearch-project/opensearch-php/src/OpenSearch/Connections/Connection.php(238): OpenSearch\Connections\Connection->OpenSearch\Connections\{closure}(Array, Object(OpenSearch\Connections\Connection), Object(OpenSearch\Transport), Array)
#6 /var/www/html/vendor/opensearch-project/opensearch-php/src/OpenSearch/Transport.php(112): OpenSearch\Connections\Connection->performRequest('POST', '/datahub_restin...', Array, '{"search_after"...', Array, Object(OpenSearch\Transport))
#7 /var/www/html/vendor/opensearch-project/opensearch-php/src/OpenSearch/Client.php(1387): OpenSearch\Transport->performRequest('POST', '/datahub_restin...', Array, Array, Array)
#8 /var/www/html/vendor/opensearch-project/opensearch-php/src/OpenSearch/Client.php(1048): OpenSearch\Client->performRequest(Object(OpenSearch\Endpoints\Search))
#9 /var/www/html/vendor/pimcore/data-hub-simple-rest/src/Service/IndexHandler.php(355): OpenSearch\Client->search(Array)
#10 /var/www/html/vendor/pimcore/data-hub-simple-rest/src/Service/IndexHandler.php(336): Pimcore\Bundle\DataHubSimpleRestBundle\Service\IndexHandler->doLoadAllIds('datahub_restind...', Array)
#11 /var/www/html/vendor/pimcore/data-hub-simple-rest/src/Service/IndexService.php(318): Pimcore\Bundle\DataHubSimpleRestBundle\Service\IndexHandler->getAllIdsFromIndexByOriginalPath('datahub_restind...', '/Brand Logos/AC...')
#12 /var/www/html/vendor/pimcore/data-hub-simple-rest/src/EventSubscriber/ChangedEventSubscriber.php(67): Pimcore\Bundle\DataHubSimpleRestBundle\Service\IndexService->invalidateIndexByOriginalPath('/Brand Logos/AC...', '_asset')
#13 /var/www/html/vendor/symfony/event-dispatcher/Debug/WrappedListener.php(116): Pimcore\Bundle\DataHubSimpleRestBundle\EventSubscriber\ChangedEventSubscriber->updateElement(Object(Pimcore\Event\Model\AssetEvent), 'pimcore.asset.p...', Object(Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher))
#14 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(220): Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke(Object(Pimcore\Event\Model\AssetEvent), 'pimcore.asset.p...', Object(Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher))
#15 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'pimcore.asset.p...', Object(Pimcore\Event\Model\AssetEvent))
#16 /var/www/html/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php(139): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Pimcore\Event\Model\AssetEvent), 'pimcore.asset.p...')
#17 /var/www/html/vendor/pimcore/pimcore/lib/Event/Traits/RecursionBlockingEventDispatchHelperTrait.php(36): Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch(Object(Pimcore\Event\Model\AssetEvent), 'pimcore.asset.p...')
#18 /var/www/html/vendor/pimcore/pimcore/models/Asset.php(597): Pimcore\Model\Element\AbstractElement->dispatchEvent(Object(Pimcore\Event\Model\AssetEvent), 'pimcore.asset.p...')
#19 /var/www/html/vendor/pimcore/admin-ui-classic-bundle/src/Controller/Admin/Asset/AssetController.php(869): Pimcore\Model\Asset->save()
#20 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): Pimcore\Bundle\AdminBundle\Controller\Admin\Asset\AssetController->saveAction(Object(Symfony\Component\HttpFoundation\Request), Object(Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher))
#21 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#22 /var/www/html/vendor/symfony/http-kernel/Kernel.php(197): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /var/www/html/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php(35): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#24 /var/www/html/vendor/autoload_runtime.php(29): Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
#25 /var/www/html/public/index.php(19): require_once('/var/www/html/v...')
#26 {main}
fashxp commented 6 months ago

has nothing to do with generic data index ... is, as the index name says datahub rest ... calling command datahub:simple-rest:create-or-update-mapping should fix it

mattamon commented 6 months ago

has nothing to do with generic data index ... is, as the index name says datahub rest ... calling command datahub:simple-rest:create-or-update-mapping should fix it

Fixed it! Thank you!