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, I’m currently working on the developer bootcamp. I’m currently stuck trying to solve “Conten

ULW0Z4150
ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet

Hello,

I’m currently working on the developer bootcamp. I’m currently stuck trying to solve “Content and Search-Hands-On”. I created the module and can access the generated page. After I added the functionality to get the query from elasticsearch im getting a 500 internal server error.

My question is, how can I see the actual error message that leads to this response? Furthermore, when I make changes to the twig templates the changes are only shown after I clear the cache is this intended behaviour?

Comments

  • i assume you are using the docker environment?

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet

    Yes i am

  • for the exception you have to swap out the WebHtmlRenderer (or so, can’t check since i am on train atm) with the WebExceptionRenderer(or so 🙂 ) in config_default-docker.php

  • somewhere there you can also disable the twig cache

  • UQ958DA4U
    UQ958DA4U Posts: 232 🧑🏻‍🚀 - Cadet

    ...another good option is to setup debugging using the Docker environment so you can step through the process. When working on this module I initially had a mistake in the naming of my DependencyProvider which meant a Container could not be found for my module.

  • UQ958DA4U
    UQ958DA4U Posts: 232 🧑🏻‍🚀 - Cadet

    Also, don't be fooled by your Browser. Using Safari I've had instances where the Twig cache was refreshed but my Browser kept serving me static content.

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet

    @UJN2JRU4F Thanks changing the option to WebExceptionRenderer worked. I didn’t find the option to change the twig chache yet, but I will take a closer look at the config

  • glad to help. can look it up in about 2h! let me know what you find

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet

    @UQ958DA4U can you elaborate on what you mean by enabling debugging in the docker environment? I’m using chrome at the moment and am refreshing the pages with cache disabled

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet

    @UJN2JRU4F I’ll let you know when I find something

  • UQ958DA4U
    UQ958DA4U Posts: 232 🧑🏻‍🚀 - Cadet

    The link above will allow you to set breakpoints in your code and watching for variable changes etc. Words of caution though: ... run -x never worked for me. I needed to use ... up -x, even when my other containers were already running.

  • UQ958DA4U
    UQ958DA4U Posts: 232 🧑🏻‍🚀 - Cadet

    This also requires an Xdebug browser plugin in order to activate the breakpoints.

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet

    @UQ958DA4U ok thanks I’ll have a look at it

  • UQ958DA4U
    UQ958DA4U Posts: 232 🧑🏻‍🚀 - Cadet

    This finally lead me to the path where I could see that NULL was returned for the Container instance. Otherwise yes, twig caches seem to be needed to be refreshed often. If you find a disabling option I'd be interested, too!

  • it should actually be fairly straight forward, let me see what my train wifi allows me to do atm

  • UQ958DA4U
    UQ958DA4U Posts: 232 🧑🏻‍🚀 - Cadet

    from the devtest config, this seems to do the trick:


  • in docker there is a bit of duplication, so basically every config value is again in config_default-docker.pph

  • for me on line ~104

  • UQ958DA4U
    UQ958DA4U Posts: 232 🧑🏻‍🚀 - Cadet

    dito

  • and line 360 for yves. setting 'cache' => false, as @UQ958DA4U showed above for those two should disable the cache

  • ULW0Z4150
    ULW0Z4150 Posts: 69 🧑🏻‍🚀 - Cadet

    That worked perfectly. Thanks again for the help