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

Hi at all! I am trying to disable debug output in case of an error for the GlueApi to hide stacktrac

UPPB2H525
UPPB2H525 Posts: 51 πŸ§‘πŸ»β€πŸš€ - Cadet
edited August 2021 in Docker

Hi at all! I am trying to disable debug output in case of an error for the GlueApi to hide stacktrace and other sensible information for productive environments.
If i set

docker:
 debug:
   enabled:false

followed by booting the env and restarting it, it still shows the stacktrace in case of a 500 internal server error for example.
Whats the trick?

Comments

  • UKHR9UN00
    UKHR9UN00 Posts: 70 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited August 2021
  • UPPB2H525
    UPPB2H525 Posts: 51 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thank you @UKHR9UN00! I already set this to false (to be sure in each and every config) but i still see debug output in case of an error. I tested it with requesting a glue endpoint via postman.

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

    This debug setting isn't about exceptions vs rendered error page.

    Please check these settings:

    FailWhale
    $config[ErrorHandlerConstants::ERROR_RENDERER] = WebHtmlErrorRenderer::class;
    
    
    
    
    Exception
    $config[ErrorHandlerConstants::DISPLAY_ERRORS] = true;
    $config[ErrorHandlerConstants::ERROR_RENDERER] = WebExceptionErrorRenderer::class;
    
  • UPPB2H525
    UPPB2H525 Posts: 51 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hey @valerii.trots! Thank you. Yes, it works for Zed and Yves, but not for Glue

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

    What would you expect in return for glue if backend fails with 500?

  • UPPB2H525
    UPPB2H525 Posts: 51 πŸ§‘πŸ»β€πŸš€ - Cadet

    Something without information about the underlying system

  • UPPB2H525
    UPPB2H525 Posts: 51 πŸ§‘πŸ»β€πŸš€ - Cadet

    I am fine with "an error occured". Or a json with a hint that an error occured

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

    Is it reproducible in the demo shop? I would then create an internal ticket for glue team.

    PS. Sorry, misread the start post and missed that this is about glue.

  • UPPB2H525
    UPPB2H525 Posts: 51 πŸ§‘πŸ»β€πŸš€ - Cadet

    I will check it in the demo shop and drop you a message later πŸ™‚ Thank you!

  • UPPB2H525
    UPPB2H525 Posts: 51 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hey @valerii.trots!
    I did a fresh setup of the b2c demoshop (https://github.com/spryker-shop/b2c-demo-shop)
    and it seems not to behave different.

    What I did:

    in config/Shared/config_default-docker.dev.php I set the following values

    $config[ApplicationConstants::ENABLE_APPLICATION_DEBUG]
        = $config[ShopApplicationConstants::ENABLE_APPLICATION_DEBUG]
        = false;
    
    $config[GlueApplicationConstants::GLUE_APPLICATION_REST_DEBUG] = false;
    
    $config[ErrorHandlerConstants::DISPLAY_ERRORS] = false;
    $config[ErrorHandlerConstants::ERROR_RENDERER] = WebHtmlErrorRenderer::class;
    $config[ErrorHandlerConstants::IS_PRETTY_ERROR_HANDLER_ENABLED] = false;
    

    and I forced an error in both GlueBootstrap.php and YvesBootstrap.php by instantiating a not existing class new Foo();

    What Yves (correctly) did:
    β€’ showing the FailWhale
    What Glue did:

    Error - Exception: Class 'Spryker\Glue\GlueApplication\Bootstrap\Foo' not found 
    in /data/vendor/spryker/glue-application/src/Spryker/Glue/GlueApplication/Bootstrap/AbstractGlueBootstrap.php (48)
    
    Request URI: /return-reasons
    
    Trace: 
    #0 /data/public/Glue/index.php(17): Spryker\Glue\GlueApplication\Bootstrap\AbstractGlueBootstrap->__construct()
    #1 {main}
    

    What I expect Glue has to do:
    β€’ showing some information that an error occured
    β€’ not showing information about the underlying system

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

    Thanks! I'll clarify internally and create a ticket for them when I have time, not immidiately.
    In case you want to be notified once it's done, please create a support request as well so we have an official communication about it.

  • UPPB2H525
    UPPB2H525 Posts: 51 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thank you Valerii!

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

    Hi @UPPB2H525! The problem should have been fixed. Please check this release group and pay attention to poject level changes - https://api.release.spryker.com/release-group/3796.

  • UPPB2H525
    UPPB2H525 Posts: 51 πŸ§‘πŸ»β€πŸš€ - Cadet

    Awesome! Thank you @valerii.trots! I will test it!

  • UPPB2H525
    UPPB2H525 Posts: 51 πŸ§‘πŸ»β€πŸš€ - Cadet

    Works! Thx!