Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor misconfiguration causes errors to be thrown #241

Open
NickStallman opened this issue Apr 10, 2023 · 1 comment
Open

Minor misconfiguration causes errors to be thrown #241

NickStallman opened this issue Apr 10, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@NickStallman
Copy link

Description

It's possible to have a misconfiguration that throws some errors visibly on the website.

Warning: Unknown: [ddappsec] Failed to add tag _dd.appsec.event_rules.version in Unknown on line 0
Warning: Unknown: [ddappsec] Expecting an object from \ddtrace\root_span in Unknown on line 0
Warning: Unknown: [ddappsec] Expecting an object from \ddtrace\root_span in Unknown on line 0
Warning: Unknown: [ddappsec] Failed to add _dd.runtime_family to root span in Unknown on line 0
Warning: Unknown: [ddappsec] Expecting an object from \ddtrace\root_span in Unknown on line 0

You get this when you have:

datadog.trace.enabled = Off
datadog.appsec.enabled = On

It's a silly configuration, however I'd expect it to throw a warning in the PHP log file when the module is loaded, and reset appsec.enabled to Off if it doesn't detect trace.enabled is On.
I wouldn't expect that kind of error to be thrown on page loads.

Tested on the latest versions of ddtrace and appsec.

@NickStallman NickStallman added the bug Something isn't working label Apr 10, 2023
@edsrzf
Copy link

edsrzf commented Apr 11, 2023

I'm seeing this behavior with what I believe is a reasonable configuration.

I have:

  • DD_TRACE_ENABLED=0 in the environment, which should be equivalent to datadog.trace.enabled = Off
  • Defaults in the configuration. According to the documentation, the default is supposed to be datadog.appsec.enabled = Off, but this is not exactly true.

The default for datadog.appsec.enabled depends on datadog.remote_config_enabled, which defaults to On. I've created a separate issue for this default in #242.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants