Incorrect host config error


#1

Hello,

i am playing a little bit around with yves controller to get better understanding. My basic idea was to fetch a customer with help of the customer client and render its name to the frontend. My first naive approach in controller is this:

    /** @var CustomerClient $client */
    $client =  $this->getFactory()->getCustomerClient();
    $customer = $client->getCustomerById(1);

The getCustomerById call results after 1 minute in the following error

Incorrect HOST_ZED config, expected www.de.suite.local, got zed.de.suite.local. Set the URLs in your Shared/config_default_DE.php or env specific config files.

My Dependencyprovider

class TableDependencyProvider extends AbstractBundleDependencyProvider
{
    public function provideDependencies(Container $container)
    {
        $container['CUSTOMER'] = function (Container $container) {
            return $container->getLocator()->customer()->client();
        };

        return $container;
    }

}

Factory

class TableFactory extends AbstractFactory
{
    public function getCustomerClient() 
    {
        return $this->getProvidedDependency("CUSTOMER");
    }

}

What is wrong here? With this error message I cant figure out whats the problem, because other tutorial examples are working with similar clients.

Thanks


#2

Hi @JimPanse,

your error looks like https://github.com/spryker/support/issues/224. But it was fixed. Please make sure that you’ve updated/have the latest module that is mentioned in the ticket.

Sorry, I can’t say anything from code perspective. Maybe someone else will help here.

Best regards,
Valerii


#3

Hi @tvalerii,

indeed I was on 3.5.0 with this package and I downgraded to 3.4.4 since the merge of the fix was just 6 days ago.

Now i get another error :thinking:

Spryker\Shared\ZedRequest\Client\Exception\RequestException: Failed to complete request with server authority http://zed.de.suite.local.
Configured with (SSL Disabled) zed.de.suite.local:80 in /data/shop/development/current/config/Shared/config_default.php. Error: Stacktrace: in /data/shop/development/current/vendor/spryker/zed-request/src/Spryker/Shared/ZedRequest/Client/AbstractHttpClient.php on line 224

Call Stack:
0.1065 905376 1. {main}() /data/shop/development/current/public/Yves/index.php:0
1.7509 3319192 2. Spryker\Yves\Kernel\Application->run(???) /data/shop/development/current/public/Yves/index.php:22
1.7513 3326176 3. Spryker\Yves\Kernel\Application->handle(???, ???, ???) /data/shop/development/current/vendor/silex/silex/src/Silex/Application.php:563
2.8293 4413536 4. Symfony\Component\HttpKernel\HttpKernel->handle(???, ???, ???) /data/shop/development/current/vendor/silex/silex/src/Silex/Application.php:586
2.8294 4413952 5. Symfony\Component\HttpKernel\HttpKernel->handleRaw(???, ???) /data/shop/development/current/vendor/symfony/http-kernel/HttpKernel.php:64
3.1748 4979008 6. call_user_func_array:{/data/shop/development/current/vendor/symfony/http-kernel/HttpKernel.php:144}(???, ???) /data/shop/development/current/vendor/symfony/http-kernel/HttpKernel.php:144
3.1748 4979072 7. Pyz\Yves\Table\Controller\TableController->indexAction() /data/shop/development/current/vendor/symfony/http-kernel/HttpKernel.php:144
5.8549 4988224 8. Spryker\Client\Customer\CustomerClient->getCustomerById(???) /data/shop/development/current/src/Pyz/Yves/Table/Controller/TableController.php:28
5.8993 5088160 9. Spryker\Client\Customer\Zed\CustomerStub->get(???) /data/shop/development/current/vendor/spryker/customer/src/Spryker/Client/Customer/CustomerClient.php:152
5.8993 5088160 10. Spryker\Client\ZedRequest\ZedRequestClient->call(???, ???, ???) /data/shop/development/current/vendor/spryker/customer/src/Spryker/Client/Customer/Zed/CustomerStub.php:103
6.1074 5643680 11. Spryker\Client\ZedRequest\Client\ZedClient->call(???, ???, ???) /data/shop/development/current/vendor/spryker/zed-request/src/Spryker/Client/ZedRequest/ZedRequestClient.php:50
6.1074 5643680 12. Spryker\Client\ZedRequest\Client\HttpClient->request(???, ???, ???, ???) /data/shop/development/current/vendor/spryker/zed-request/src/Spryker/Shared/ZedRequest/Client/AbstractZedClient.php:80


#4

Ok i think i got it.

This was an error most likely caused by xdebug. The guzzle client runs in timeout cause the gatewaycontroller on the zed side was probably blocked by xdebug while i was waiting for return on the client side. So when the client timeout reached (and i end up now in the catch block) i pressed on resume and just now the gateway controller method on the zed side was called (when the calling guzzle client already ran into timeout).

I switched several times from “listen to debug connections” to “stop listen to debug connections” in IntelliJ and the error is now gone magically.

First i suspected the “max simultaneous connections” setting, but this is already set to “2”.

Thanks anyway :slight_smile: