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

BUG: dd-trace-java with version 1.33.0 causes InvalidCookieDomainException. In 1.32.0 works fine. #6938

Open
radek-zilch opened this issue Apr 23, 2024 · 3 comments · Fixed by #6973
Assignees
Labels
comp: ci visibility Continuous Integration Visibility
Milestone

Comments

@radek-zilch
Copy link

When dd-tracer-java was upgraded to newer version - 1.33.0 automated tests which using Selenium started throwing following error

org.openqa.selenium.InvalidCookieDomainException: invalid cookie domain (Session info: chrome=121.0.6167.184) Build info: version: '4.17.0', revision: 'e52b1be057*' System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.1.82', java.version: '21.0.2' Driver info: org.openqa.selenium.chrome.ChromeDriver Command: [202e2bc98ae7579358d50f146789017f, addCookie {cookie=datadog-ci-visibility-test-execution-id=4793211965846179478; path=/}] selenide.url: about:blank Capabilities {acceptInsecureCerts: true, browserName: chrome, browserVersion: 121.0.6167.184, chrome: {chromedriverVersion: 121.0.6167.184 (057a8ae7deb..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:35703}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:cdp: ws://localhost:35703/devtoo..., se:cdpVersion: 121.0.6167.184, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: accept, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true} selenide.baseUrl: https://customers-eu-ew1-staging.stage.payzilch.com/ Session ID: 202e2bc98ae7579358d50f146789017f at jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62) ~[?:?] at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502) ~[?:?] at java.lang.reflect.Constructor.newInstance(Constructor.java:486) ~[?:?] at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:185) ~[selenium-remote-driver-4.17.0.jar:?] at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:134) ~[selenium-remote-driver-4.17.0.jar:?] at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:51) ~[selenium-remote-driver-4.17.0.jar:?] at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:190) ~[selenium-remote-driver-4.17.0.jar:?] at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:216) ~[selenium-remote-driver-4.17.0.jar:?] at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:174) ~[selenium-remote-driver-4.17.0.jar:?] at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:519) ~[selenium-remote-driver-4.17.0.jar:?] at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions.addCookie(RemoteWebDriver.java:841) ~[selenium-remote-driver-4.17.0.jar:?] at datadog.trace.instrumentation.selenium.SeleniumUtils.injectRumContext(SeleniumUtils.java:78) ~[?:?] at datadog.trace.instrumentation.selenium.SeleniumUtils.afterPageOpen(SeleniumUtils.java:69) ~[?:?] at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:302) ~[selenium-remote-driver-4.17.0.jar:?] at org.openqa.selenium.remote.RemoteWebDriver$RemoteNavigation.to(RemoteWebDriver.java:1064) ~[selenium-remote-driver-4.17.0.jar:?] at com.codeborne.selenide.drivercommands.Navigator.lambda$navigateTo$0(Navigator.java:72) ~[selenide-core-7.1.0.jar:7.1.0] at com.codeborne.selenide.logevents.SelenideLogger.lambda$run$0(SelenideLogger.java:105) ~[selenide-core-7.1.0.jar:7.1.0] at com.codeborne.selenide.logevents.SelenideLogger.wrap(SelenideLogger.java:133) ~[selenide-core-7.1.0.jar:7.1.0] at com.codeborne.selenide.logevents.SelenideLogger.run(SelenideLogger.java:104) ~[selenide-core-7.1.0.jar:7.1.0] at com.codeborne.selenide.drivercommands.Navigator.navigateTo(Navigator.java:68) ~[selenide-core-7.1.0.jar:7.1.0] at com.codeborne.selenide.drivercommands.Navigator.open(Navigator.java:31) ~[selenide-core-7.1.0.jar:7.1.0] at com.codeborne.selenide.SelenideDriver.open(SelenideDriver.java:92) ~[selenide-core-7.1.0.jar:7.1.0] at com.codeborne.selenide.Selenide.open(Selenide.java:53) ~[selenide-7.1.0.jar:7.1.0]

the code which is invoking this looks as follows:

    public void handleTestCaseStartedEvent(TestCaseStarted event) {
        log.info("Opening new blank browser window.");
        Selenide.open("about:blank");
    }

When older version (1.32.0) was forced to use the error is not happening anymore.

@radek-zilch radek-zilch changed the title dd-trace-java with version 1.33.0 causes InvalidCookieDomainException. In 1.32.0 works fine. BUG: dd-trace-java with version 1.33.0 causes InvalidCookieDomainException. In 1.32.0 works fine. Apr 23, 2024
@nikita-tkachenko-datadog nikita-tkachenko-datadog added the comp: ci visibility Continuous Integration Visibility label Apr 30, 2024
@nikita-tkachenko-datadog
Copy link
Contributor

nikita-tkachenko-datadog commented Apr 30, 2024

This is indeed a bug in the Selenium instrumentation that was added in v1.33.0 of the tracer.
A temporary workaround until this is fixed is to set DD_INTEGRATION_SELENIUM_ENABLED=false environment variable or dd.integration.selenium.enabled=false system property to disable Selenium instrumentation.

@nikita-tkachenko-datadog
Copy link
Contributor

The fix has been merged and will be available in the next release of the tracer.

@nikita-tkachenko-datadog
Copy link
Contributor

The tracer release v1.34.0 was rolled out yesterday. It contains the fix for this issue. Please let me know if the problem persists after updating

@mcculls mcculls added this to the 1.34.0 milestone May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: ci visibility Continuous Integration Visibility
Projects
None yet
3 participants