Generating backend Glue documentation fails when dynamic-entity installed

mikko.ropanen
mikko.ropanen Spryker Solution Partner Posts: 29 ✨ - Novice

Running
docker/sdk cli vendor/bin/glue api:generate:documentation --application backend

fails when dynamic-entity is installed:
Propel\Runtime\Exception\PropelException - Exception: Database map was not initialized. Please check the database loader script included by your conf. Visit https://github.com/propelorm/Propel2/wiki/Exception-Target:-Loading-the-database for information on how to fix this.
in /data/vendor/propel/propel/src/Propel/Runtime/ServiceContainer/StandardServiceContainer.php (328)

Request URI: n/a

Trace:
#0 /data/vendor/propel/propel/src/Propel/Runtime/ActiveQuery/BaseModelCriteria.php(216): Propel\Runtime\ServiceContainer\StandardServiceContainer->getDatabaseMap('zed')
#1 /data/vendor/propel/propel/src/Propel/Runtime/ActiveQuery/BaseModelCriteria.php(80): Propel\Runtime\ActiveQuery\BaseModelCriteria->setModelName('Orm\Zed\Dynamic...')
#2 /data/src/Orm/Zed/DynamicEntity/Persistence/Base/SpyDynamicEntityConfigurationQuery.php(247): Propel\Runtime\ActiveQuery\BaseModelCriteria->__construct('zed', '\Orm\Zed\Dynami...', NULL)
#3 /data/src/Orm/Zed/DynamicEntity/Persistence/Base/SpyDynamicEntityConfigurationQuery.php(263): Orm\Zed\DynamicEntity\Persistence\Base\SpyDynamicEntityConfigurationQuery->__construct()
#4 /data/vendor/spryker/dynamic-entity/src/Spryker/Zed/DynamicEntity/Persistence/DynamicEntityPersistenceFactory.php(46): Orm\Zed\DynamicEntity\Persistence\Base\SpyDynamicEntityConfigurationQuery::create()
#5 /data/vendor/spryker/dynamic-entity/src/Spryker/Zed/DynamicEntity/Persistence/DynamicEntityRepository.php(141): Spryker\Zed\DynamicEntity\Persistence\DynamicEntityPersistenceFactory->createDynamicEntityConfigurationQuery()
#6 /data/vendor/spryker/dynamic-entity/src/Spryker/Zed/DynamicEntity/Business/DynamicEntityFacade.php(84): Spryker\Zed\DynamicEntity\Persistence\DynamicEntityRepository->getDynamicEntityConfigurationCollection(Object(Generated\Shared\Transfer\DynamicEntityConfigurationCriteriaTransfer))
#7 /data/vendor/spryker/dynamic-entity-backend-api/src/Spryker/Glue/DynamicEntityBackendApi/Dependency/Facade/DynamicEntityBackendApiToDynamicEntityFacadeBridge.php(41): Spryker\Zed\DynamicEntity\Business\DynamicEntityFacade->getDynamicEntityConfigurationCollection(Object(Generated\Shared\Transfer\DynamicEntityConfigurationCriteriaTransfer))
#8 /data/vendor/spryker/dynamic-entity-backend-api/src/Spryker/Glue/DynamicEntityBackendApi/Builder/Route/RouteBuilder.php(123): Spryker\Glue\DynamicEntityBackendApi\Dependency\Facade\DynamicEntityBackendApiToDynamicEntityFacadeBridge->getDynamicEntityConfigurationCollection(Object(Generated\Shared\Transfer\DynamicEntityConfigurationCriteriaTransfer))
#9 /data/vendor/spryker/dynamic-entity-backend-api/src/Spryker/Glue/DynamicEntityBackendApi/Plugin/GlueApplication/DynamicEntityRouteProviderPlugin.php(32): Spryker\Glue\DynamicEntityBackendApi\Builder\Route\RouteBuilder->buildRouteCollection(Object(Symfony\Component\Routing\RouteCollection))
#10 /data/vendor/spryker/glue-backend-api-application/src/Spryker/Glue/GlueBackendApiApplication/Expander/CustomRoutesContextExpander.php(110): Spryker\Glue\DynamicEntityBackendApi\Plugin\GlueApplication\DynamicEntityRouteProviderPlugin->addRoutes(Object(Symfony\Component\Routing\RouteCollection))
#11 /data/vendor/spryker/glue-backend-api-application/src/Spryker/Glue/GlueBackendApiApplication/Expander/CustomRoutesContextExpander.php(51): Spryker\Glue\GlueBackendApiApplication\Expander\CustomRoutesContextExpander->getRouteCollection()
#12 /data/vendor/spryker/glue-backend-api-application/src/Spryker/Glue/GlueBackendApiApplication/Plugin/DocumentationGeneratorApi/BackendCustomRoutesContextExpanderPlugin.php(31): Spryker\Glue\GlueBackendApiApplication\Expander\CustomRoutesContextExpander->expand(Object(Generated\Shared\Transfer\ApiApplicationSchemaContextTransfer))
#13 /data/vendor/spryker/documentation-generator-api/src/Spryker/Glue/DocumentationGeneratorApi/Generator/DocumentationGenerator.php(163): Spryker\Glue\GlueBackendApiApplication\Plugin\DocumentationGeneratorApi\BackendCustomRoutesContextExpanderPlugin->expand(Object(Generated\Shared\Transfer\ApiApplicationSchemaContextTransfer))
#14 /data/vendor/spryker/documentation-generator-api/src/Spryker/Glue/DocumentationGeneratorApi/Generator/DocumentationGenerator.php(111): Spryker\Glue\DocumentationGeneratorApi\Generator\DocumentationGenerator->expandContext(Object(Spryker\Glue\GlueBackendApiApplication\Plugin\DocumentationGeneratorApi\BackendApiApplicationProviderPlugin), Object(Generated\Shared\Transfer\ApiApplicationSchemaContextTransfer))
#15 /data/vendor/spryker/documentation-generator-api/src/Spryker/Glue/DocumentationGeneratorApi/Plugin/Console/ApiGenerateDocumentationConsole.php(87): Spryker\Glue\DocumentationGeneratorApi\Generator\DocumentationGenerator->generateDocumentation(Array)
#16 /data/vendor/symfony/console/Command/Command.php(326): Spryker\Glue\DocumentationGeneratorApi\Plugin\Console\ApiGenerateDocumentationConsole->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /data/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /data/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(Spryker\Glue\DocumentationGeneratorApi\Plugin\Console\ApiGenerateDocumentationConsole), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /data/vendor/spryker/console/src/Spryker/Glue/Console/ConsoleBootstrap.php(197): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /data/vendor/symfony/console/Application.php(175): Spryker\Glue\Console\ConsoleBootstrap->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /data/vendor/spryker/console/bin/glue(23): Symfony\Component\Console\Application->run()
#22 /data/vendor/bin/glue(119): include('/data/vendor/sp...')

Tagged:

Comments

  • Serhii Chepela
    Serhii Chepela Application Architect @ Spryker Sprykee Posts: 49 🧑🏻‍🚀 - Cadet

    Hey! Thank you for reaching us.

    Dynamic Entity API is a part of the Glue Backend API. But in order to generate an OpenAPI documentation it requires to get data from database as we don't have any other source for Dynamic Entity API resources.

    I can assume that mb container, where you run this command, has no access to it.

    Please ping me if it's not the case