Calling Developers!
We are reenergizing our code contribution process! Learn More

What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Getting below error which trying to generate the access token for the b2c-demo-shop which is setup v

Options
U04P7B9C813
U04P7B9C813 Posts: 9 🧑🏻‍🚀 - Cadet
edited February 2023 in Help

Getting below error which trying to generate the access token for the b2c-demo-shop which is setup via docker using deploy.dev.yml. Can someone please help me on this issue.
curl -H 'accept-language: de' -H 'accept: application/json' -H 'content-type: application/json' -H 'user-agent: OpenAPI-Generator/1.0.0/xxxxx --compressed -X POST <https://url/access-tokens> -d '{"data":{"attributes":{"password":"xxxxxxx","username":"xxxxxx"},"type":"access-tokens"}}'

Spryker\Glue\RestRequestValidator\Processor\Exception\CacheFileNotFoundException - Exception: Validation cache is enabled, but cache file is not found. 
in /data/vendor/spryker/rest-request-validator/src/Spryker/Glue/RestRequestValidator/Processor/Validator/Configuration/RestRequestValidatorConfigReader.php (78)

Request URI: /access-tokens

Trace: 
#0 /data/vendor/spryker/rest-request-validator/src/Spryker/Glue/RestRequestValidator/Processor/Validator/Constraint/RestRequestValidatorConstraintResolver.php(88): Spryker\Glue\RestRequestValidator\Processor\Validator\Configuration\RestRequestValidatorConfigReader->findValideader->findValidationConfiguration(Object(Spryker\Glue\GlueApplication\Rest\Request\Data\RestRequest))
#1 /data/vendor/spryker/rest-request-validator/src/Spryker/Glue/RestRequestValidator/Processor/Validator/Constraint/RestRequestValidatorConstraintResolver.php(68): Spryker\Glue\RestRequestValidator\Processor\Validator\Constraint\RestRequestValidatorConstraintResolver->getConResolver->getConstraintFromConfig(Object(Spryker\Glue\GlueApplication\Rest\Request\Data\RestRequest))
#2 /data/vendor/spryker/rest-request-validator/src/Spryker/Glue/RestRequestValidator/Processor/Validator/RestRequestValidator.php(77): Spryker\Glue\RestRequestValidator\Processor\Validator\Constraint\RestRequestValidatorConstraintResolver->getConstraintCollection(Object(Sprytion(Object(Spryker\Glue\GlueApplication\Rest\Request\Data\RestRequest))
#3 /data/vendor/spryker/rest-request-validator/src/Spryker/Glue/RestRequestValidator/Plugin/ValidateRestRequestAttributesPlugin.php(36): Spryker\Glue\RestRequestValidator\Processor\Validator\RestRequestValidator->validate(Object(Symfony\Component\HttpFoundation\Request), Objon\Request), Object(Spryker\Glue\GlueApplication\Rest\Request\Data\RestRequest))
#4 /data/vendor/spryker/glue-application/src/Spryker/Glue/GlueApplication/Rest/Request/RestRequestValidator.php(170): Spryker\Glue\RestRequestValidator\Plugin\ValidateRestRequestAttributesPlugin->validate(Object(Symfony\Component\HttpFoundation\Request), Object(Spryker\Glue\ct(Spryker\Glue\GlueApplication\Rest\Request\Data\RestRequest))
#5 /data/vendor/spryker/glue-application/src/Spryker/Glue/GlueApplication/Rest/Request/RestRequestValidator.php(72): Spryker\Glue\GlueApplication\Rest\Request\RestRequestValidator->executeRestRequestValidatorPlugins(Object(Symfony\Component\HttpFoundation\Request), Object(Spuest), Object(Spryker\Glue\GlueApplication\Rest\Request\Data\RestRequest))
#6 /data/vendor/spryker/glue-application/src/Spryker/Glue/GlueApplication/Rest/ControllerFilter.php(287): Spryker\Glue\GlueApplication\Rest\Request\RestRequestValidator->validate(Object(Symfony\Component\HttpFoundation\Request), Object(Spryker\Glue\GlueApplication\Rest\Requeation\Rest\Request\Data\RestRequest))
#7 /data/vendor/spryker/glue-application/src/Spryker/Glue/GlueApplication/Rest/ControllerFilter.php(157): Spryker\Glue\GlueApplication\Rest\ControllerFilter->validateRequest(Object(Spryker\Glue\AuthRestApi\Controller\AccessTokensResourceController), Object(Symfony\Component\mfony\Component\HttpFoundation\Request), Object(Spryker\Glue\GlueApplication\Rest\Request\Data\RestRequest))
#8 /data/vendor/spryker/glue-application/src/Spryker/Glue/GlueApplication/Plugin/EventDispatcher/GlueRestControllerListenerEventDispatcherPlugin.php(71): Spryker\Glue\GlueApplication\Rest\ControllerFilter->filter(Object(Spryker\Glue\AuthRestApi\Controller\AccessTokensResourcessTokensResourceController), 'postAction', Object(Symfony\Component\HttpFoundation\Request))
#9 /data/vendor/spryker/glue-application/src/Spryker/Glue/GlueApplication/Plugin/EventDispatcher/GlueRestControllerListenerEventDispatcherPlugin.php(56): Spryker\Glue\GlueApplication\Plugin\EventDispatcher\GlueRestControllerListenerEventDispatcherPlugin->filter(Object(Sprykeer(Object(Spryker\Glue\AuthRestApi\Controller\AccessTokensResourceController), 'postAction', Object(Symfony\Component\HttpFoundation\Request))
#10 /data/vendor/symfony/http-kernel/HttpKernel.php(163): Spryker\Glue\GlueApplication\Plugin\EventDispatcher\GlueRestControllerListenerEventDispatcherPlugin->Spryker\Glue\GlueApplication\Plugin\EventDispatcher\{closure}()
#11 /data/vendor/symfony/http-kernel/HttpKernel.php(75): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#12 /data/vendor/spryker/application/src/Spryker/Shared/Application/Application.php(138): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#13 /data/vendor/spryker/application/src/Spryker/Shared/Application/Application.php(116): Spryker\Shared\Application\Application->handle(Object(Symfony\Component\HttpFoundation\Request))
#14 /data/vendor/spryker/glue-application/src/Spryker/Glue/GlueApplication/ApiApplication/ApiApplicationProxy.php(107): Spryker\Shared\Application\Application->run()
#15 /data/public/Glue/index.php(20): Spryker\Glue\GlueApplication\ApiApplication\ApiApplicationProxy->run()
#16 {main}<br />
<b>Fatal error</b>:  Uncaught ValueError: Path cannot be empty in [no active file]:0
Stack trace:
#0 {main}
  thrown in <b>[no active file]</b> on line <b>0</b><br />

Comments

  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer
    Options

    docker/sdk console rest-api:build-request-validation-cache

  • U04P7B9C813
    U04P7B9C813 Posts: 9 🧑🏻‍🚀 - Cadet
    edited February 2023
    Options

    @UL6DGRULR
    Still have the same error.

  • U04P7B9C813
    U04P7B9C813 Posts: 9 🧑🏻‍🚀 - Cadet
    Options

    Output for the command you have shared.

    root@test:/srv/spryker# docker/sdk console rest-api:build-request-validation-cache
    Warning: Neither SSH agent or COMPOSER_AUTH is configured. Private repositories would not be accessible.
    -->  DEVELOPMENT MODE
    Store: DE | Environment: docker.dev
    
  • U04P7B9C813
    U04P7B9C813 Posts: 9 🧑🏻‍🚀 - Cadet
    Options

    worked for de . But still have the above error for at and us

  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer
    Options

    docker/sdk cli APPLICATION_STORE=AT console rest-api:build-request-validation-cache

  • U04P7B9C813
    U04P7B9C813 Posts: 9 🧑🏻‍🚀 - Cadet
    Options

    Fixed for AT also.
    When used the same command for US.
    docker/sdk cli APPLICATION_STORE=US console rest-api:build-request-validation-cache
    Getting below error.

    root@test:/srv/spryker# docker/sdk cli APPLICATION_STORE=US console rest-api:build-request-validation-cache
    Warning: Neither SSH agent or COMPOSER_AUTH is configured. Private repositories would not be accessible. 
    -->  DEVELOPMENT MODE   
    [13-Feb-2023 12:09:03 UTC] PHP Fatal error:  Uncaught Exception: Missing setup for store: US in /data/vendor/spryker/kernel/src/Spryker/Shared/Kernel/Store.php:182
    Stack trace:
    #0 /data/vendor/spryker/kernel/src/Spryker/Shared/Kernel/Store.php(209): Spryker\Shared\Kernel\Store->getStoreSetup('US')
    #1 /data/vendor/spryker/kernel/src/Spryker/Shared/Kernel/Store.php(159): Spryker\Shared\Kernel\Store->initializeSetup('US')
    #2 /data/vendor/spryker/kernel/src/Spryker/Shared/Kernel/Store.php(126): Spryker\Shared\Kernel\Store->__construct()
    #3 /data/vendor/spryker/config/src/Spryker/Shared/Config/Application/Environment.php(33): Spryker\Shared\Kernel\Store::getInstance()
    #4 /data/vendor/spryker/console/src/Spryker/Zed/Console/Business/Model/Environment.php(32): Spryker\Shared\Config\Application\Environment::initialize()
    #5 /data/vendor/spryker/console/src/Spryker/Zed/Console/Communication/ConsoleBootstrapElector.php(24): Spryker\Zed\Console\Business\Model\Environment::initialize()
    #6 /data/vendor/spryker/console/bin/console(23): Spryker\Zed\Console\Communication\ConsoleBootstrapElector->__construct()
    #7 /data/vendor/bin/console(120): include('/data/vendor/sp...')
    #8 {main}
      thrown in /data/vendor/spryker/kernel/src/Spryker/Shared/Kernel/Store.php on line 182
    
    Fatal error: Uncaught Exception: Missing setup for store: US in /data/vendor/spryker/kernel/src/Spryker/Shared/Kernel/Store.php:182
    Stack trace:
    #0 /data/vendor/spryker/kernel/src/Spryker/Shared/Kernel/Store.php(209): Spryker\Shared\Kernel\Store->getStoreSetup('US')
    #1 /data/vendor/spryker/kernel/src/Spryker/Shared/Kernel/Store.php(159): Spryker\Shared\Kernel\Store->initializeSetup('US')
    #2 /data/vendor/spryker/kernel/src/Spryker/Shared/Kernel/Store.php(126): Spryker\Shared\Kernel\Store->__construct()
    #3 /data/vendor/spryker/config/src/Spryker/Shared/Config/Application/Environment.php(33): Spryker\Shared\Kernel\Store::getInstance()
    #4 /data/vendor/spryker/console/src/Spryker/Zed/Console/Business/Model/Environment.php(32): Spryker\Shared\Config\Application\Environment::initialize()
    #5 /data/vendor/spryker/console/src/Spryker/Zed/Console/Communication/ConsoleBootstrapElector.php(24): Spryker\Zed\Console\Business\Model\Environment::initialize()
    #6 /data/vendor/spryker/console/bin/console(23): Spryker\Zed\Console\Communication\ConsoleBootstrapElector->__construct()
    #7 /data/vendor/bin/console(120): include('/data/vendor/sp...')
    #8 {main}
      thrown in /data/vendor/spryker/kernel/src/Spryker/Shared/Kernel/Store.php on line 182
    
  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer
    Options

    You probably either don't have a US store configured in stores.php or lack one in the DB

  • U04P7B9C813
    U04P7B9C813 Posts: 9 🧑🏻‍🚀 - Cadet
    edited February 2023
    Options

    Hi @UL6DGRULR
    Thanks for the quick support.
    I have the US store and it's accessible. Suspecting issue at code level.