sentry-symfony icon indicating copy to clipboard operation
sentry-symfony copied to clipboard

non-existent parameter "kernel.build_dir"

Open garak opened this issue 3 years ago • 9 comments

Environment

How do you use Sentry? SaaS

Which SDK and version? sentry/sentry 3.3.2 sentry/sentry-symfony 4.2.2

Steps to Reproduce

  1. Running bin/console de:conf sentry

Expected Result

No errors

Actual Result

You have requested a non-existent parameter "kernel.build_dir". Did you mean one of these: "kernel.root_dir", "kernel.cache_dir", "kernel.logs_dir"?

garak avatar Dec 20 '21 14:12 garak

kernel.build_dir has been added in 5.2, we need to make that optional, depending on the SF version.

Jean85 avatar Dec 20 '21 14:12 Jean85

@ste93cry sent me this:

https://github.com/getsentry/sentry-symfony/blob/master/src/DependencyInjection/SentryExtension.php#L88

We already have a safeguard for this situation, but it's probably not working in your case.

Jean85 avatar Dec 20 '21 14:12 Jean85

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Mar 11 '22 00:03 github-actions[bot]

I was wondering if you solved the problem or if you can reproduce it on a fresh project to help us debug the issue. Otherwise, I will close this issue...

ste93cry avatar Mar 13 '22 17:03 ste93cry

I ran into the same issue with Symfony 4.4.40. As a workaround I made the in_app_exclude Sentry option explicit and left out %kernel.build_dir%.

#app/config/config.yml

sentry:
    options:
        in_app_exclude:
            - "%kernel.cache_dir%"
            - "%kernel.project_dir%/vendor"

bramcordie avatar Apr 05 '22 13:04 bramcordie

Were you able to understand the root cause? As written above, we have a safeguard in place at container's compilation time, so I don't understand how it can happen 🤔

ste93cry avatar Apr 05 '22 14:04 ste93cry

No, the in_app_exclude option gets overridden AFTER the safeguard removes the kernel.build_dir reference. I step debugged up to the point where it filters the build_dir reference out.

I tried inverting the safeguard by removing the problematic reference here: https://github.com/getsentry/sentry-symfony/blob/master/src/DependencyInjection/Configuration.php#L108 and then adding it back in where the current safeguard now conditionally removes it. The options where always reverted back to what was defined in the Configuration.php file. Everything you add or remove, like the safeguard does, is ignored this way.

bramcordie avatar Apr 05 '22 14:04 bramcordie

If you could prepare a little repo that reproduces the problem consistently it would be extremely useful 🙏

ste93cry avatar Apr 05 '22 15:04 ste93cry

As far as I can tell, this only happens when running the bin/console debug:config sentry Symfony Console command. Just running the app does not seem to cause any problems without the workaround.

I'll try to get back to you with an example once I get Sentry fully working!

bramcordie avatar Apr 05 '22 18:04 bramcordie

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Sep 27 '22 00:09 github-actions[bot]

I got this too; with the debug:config sentry command the configuration is extrapolated and parsed without invoking our workaround at all.

Jean85 avatar Mar 31 '23 14:03 Jean85

Fixed in 4.8.0

cleptric avatar May 02 '23 09:05 cleptric