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..

Hello everyone, I have faced the error "*throw* *new* SuspiciousOperationException*(*sprintf*(*'Unt

U01HX2U4NLQ
U01HX2U4NLQ Posts: 67 🧑🏻‍🚀 - Cadet
edited January 2021 in Help

Hello everyone,

I have faced the error "throw new SuspiciousOperationException(sprintf('Untrusted Host "%s".', $host));" after changing the custom domain name with Spryker B2C shop system with the virtual machine. I have followed the steps in the steps https://documentation.spryker.com/docs/post-installation-steps-and-additional-info#setting-a-domain-name-for-the-shop. I have also configured the domain inside the vagrant host files.

Anyone, please let me know if need any additional steps required to reflect.

Thanks in advance.

Comments

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    Did u tried already to configure the \Spryker\Shared\Http\HttpConstants::ZED_TRUSTED_HOSTS and \Spryker\Shared\Http\HttpConstants::YVES_TRUSTED_HOSTS properly?

  • U01HX2U4NLQ
    U01HX2U4NLQ Posts: 67 🧑🏻‍🚀 - Cadet
    edited January 2021

    @UL65CH0MC Thanks. Yes, I have already tried the mentioned configuration with config_default.php. But When I debug (below code) the "$hostPatterns" variable it's only returned the old domains instead of new ones.

    Class Symfony\Component\HttpFoundation\Request

    public static function setTrustedHosts(array $hostPatterns)

    Is there any URL information needs to update in the database? or not necessary?

  • U01HX2U4NLQ
    U01HX2U4NLQ Posts: 67 🧑🏻‍🚀 - Cadet

    @UL65CH0MC Thanks. Now it's working after updating the changes with "config_default-development.php" instead of "config_default.php".

  • U01HX2U4NLQ
    U01HX2U4NLQ Posts: 67 🧑🏻‍🚀 - Cadet

    @UL65CH0MC I have faced the issue(An internal server error occurred. Please try again later.) with "HTTPS" on Spryker B2C demo shop every page. I have added the following in "config_default-development.php".

    $config[SessionConstants::ZED_SSL_ENABLED]
    = $config[SessionConstants::YVES_SSL_ENABLED]
    = $config[RouterConstants::YVES_IS_SSL_ENABLED]
    = $config[RouterConstants::ZED_IS_SSL_ENABLED]
    = $config[HttpConstants::ZED_HTTP_STRICT_TRANSPORT_SECURITY_ENABLED]
    = $config[HttpConstants::YVES_HTTP_STRICT_TRANSPORT_SECURITY_ENABLED]
    = $config[ApplicationConstants::ZED_SSL_ENABLED]
    = $config[ApplicationConstants::YVES_SSL_ENABLED]
    = true;

    Please let me know to resolve this case. Site with "HTTP" working fine without any issues.

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    Do u use docker or vagrant?

  • U01HX2U4NLQ
    U01HX2U4NLQ Posts: 67 🧑🏻‍🚀 - Cadet
    edited January 2021

    @UL65CH0MC using vagrant. error "An internal server error occurred. Please try again later."

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    I don't use Vagrant now since ca. 1,5 year and i don't remember how it is configured.
    Maybe @valerii.trots can help u.

    Did u check the nginx configuration?

  • U01HX2U4NLQ
    U01HX2U4NLQ Posts: 67 🧑🏻‍🚀 - Cadet

    @UL65CH0MC Yes, based on some forums I have increased the timeout for Nginx host files like below but still faced the error.

    proxy_connect_timeout 1300;
    proxy_send_timeout 1300;
    proxy_read_timeout 1300;
    send_timeout 1300;

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    edited January 2021

    Sorry, was not working with ssl in vagrant, can't help here.

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    But in my old project it was running on my vagrant. Maybe I have the nginx conf self changed to allow this. I don’t remember