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'm using a custom client to consume the Glue API. While developing, I sometimes run

U01FMCD8EN4
U01FMCD8EN4 Posts: 27 πŸ§‘πŸ»β€πŸš€ - Cadet

Hello everyone,
I'm using a custom client to consume the Glue API. While developing, I sometimes run into exceptions in Spryker. This means that Glue responds with a 500 response, which is fine, but gives no further information on the error.
Can you please explain or point me to the documentation on how to change my config to get an exception message and stack trace in my Glue responses?

Comments

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

    Don't you have an access to the backend of the Spryker's Glue instance?

    I'm not sure if it's possible to get an exception in the response.

    @UQKSAARKN am I right?

  • Eugenia Poidenko
    Eugenia Poidenko Sprykee Posts: 145 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hi! In a development environment it should be possible to show errors, it’s a server configuration. Are you running docker?

  • U01FMCD8EN4
    U01FMCD8EN4 Posts: 27 πŸ§‘πŸ»β€πŸš€ - Cadet

    I do have access to the backend, and I can search through the logs, but I would prefer to get the error information directly in Glue's response so my client can display them.

    I am indeed running docker

  • Eugenia Poidenko
    Eugenia Poidenko Sprykee Posts: 145 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hi JΓΆrn!

    I think you can run docker in dev mode to make errors show up in plain text in the Glue responses. The following setting in the deploy.yml should do it:

    docker:
        debug:
            enabled: true
    
  • U01FMCD8EN4
    U01FMCD8EN4 Posts: 27 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hi there!
    I tried that configuration, but sadly, it doesn't work. The 500 response from Glue is still empty.

  • U01FMCD8EN4
    U01FMCD8EN4 Posts: 27 πŸ§‘πŸ»β€πŸš€ - Cadet

    Anything else I can try?

  • Eugenia Poidenko
    Eugenia Poidenko Sprykee Posts: 145 πŸ§‘πŸ»β€πŸš€ - Cadet

    Just to confirm: you ran in dev mode or tried changing one setting?

  • U01FMCD8EN4
    U01FMCD8EN4 Posts: 27 πŸ§‘πŸ»β€πŸš€ - Cadet

    I bootstrapped my application with the modified deploy file

  • U01FMCD8EN4
    U01FMCD8EN4 Posts: 27 πŸ§‘πŸ»β€πŸš€ - Cadet

    And restarted

  • Eugenia Poidenko
    Eugenia Poidenko Sprykee Posts: 145 πŸ§‘πŸ»β€πŸš€ - Cadet

    @ULYHPR789 can you please help? I’m not sure the setting I mention is the only one blocking the errors

  • sprymiker
    sprymiker Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    @UQKSAARKN What configuration parameter should be set for having error stack trace of the response?

  • sprymiker
    sprymiker Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    @U01FMCD8EN4 You can use docker logs to tail the error messages.

    docker logs spryker_b2c_dev_glue_eu_1 -f 
    

    (container name can be different, use docker/sdk ps to get the right one)

  • U01FMCD8EN4
    U01FMCD8EN4 Posts: 27 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thank you for the reply, but the error message does not show up in either glue or zed logs, I double checked the container names.
    If I look at spryker.local/logs and view glue and zed errors, it shows up. Also, reading the log files is great, but I would love to have Glue output the error message directly

  • U01FMCD8EN4
    U01FMCD8EN4 Posts: 27 πŸ§‘πŸ»β€πŸš€ - Cadet

    Any advice on this, guys?

  • jochen.gartner
    jochen.gartner Posts: 42 πŸ§‘πŸ»β€πŸš€ - Cadet

    maybe a dumb question - but did you try to set GlueApplicationConstants::GLUE_APPLICATION_REST_DEBUG to true?

  • Eugenia Poidenko
    Eugenia Poidenko Sprykee Posts: 145 πŸ§‘πŸ»β€πŸš€ - Cadet

    I found this in the code: https://github.com/spryker/glue-application/blob/b54539ab0cf48827747ce8da67dc0af69e8127e1/src/Spryker/Glue/GlueApplication/Rest/ControllerFilter.php

    So the GlueApplicationConstants::GLUE_APPLICATION_REST_DEBUG should be true for the exception to show up.

    then I see in suite the config above depends on the https://github.com/spryker-shop/suite/blob/master/config/Shared/config_default-docker.dev.php#L50 the SPRYKER_DEBUG_ENABLED defined in the docker.

    Can you check the chain works? maybe your suite is not taking the env where it should be and the chain is broken