sentry-symfony
sentry-symfony copied to clipboard
non-existent parameter "kernel.build_dir"
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
- 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"?
kernel.build_dir
has been added in 5.2, we need to make that optional, depending on the SF version.
@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.
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 🥀
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...
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"
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 🤔
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.
If you could prepare a little repo that reproduces the problem consistently it would be extremely useful 🙏
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!
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 🥀
I got this too; with the debug:config sentry
command the configuration is extrapolated and parsed without invoking our workaround at all.
Fixed in 4.8.0