Skip to content

[BUG]: datadog-2.31.0 monkey-patches Process.spawn and interferes with Ferrum #5621

Description

@alexdeng-mp

Tracer Version(s)

2.31.0

Ruby Version(s)

3.4.8

Relevent Library and Version(s)

No response

Bug Report

Looks like 2.31.0 patches Process.spawn in spawn_monkey_patch.rb which is interfering with Ferum.

Summary of the issue by Claude

The new datadog gem (introduced by this dependabot bump) patches Process.spawn in spawn_monkey_patch.rb. Ferrum calls Process.spawn with a Hash as one of its arguments (for environment variables or browser options when launching Chrome). The
  patched version rejects that with TypeError: no implicit conversion of Hash into String, so Ferrum::Browser.new(...) raises before browser is ever assigned.

- The TypeError: no implicit conversion of Hash into String originates inside datadog-2.31.0's Process.spawn monkey patch at line 17 (super)
  - This causes Ferrum::Browser.new to fail before browser is assigned
  - browser is therefore nil in the ensure block → NoMethodError on .close

We are currently on 2.30.0 which does not have this issue

Reproduction Code

No response

Configuration Block

No response

Error Logs

No response

Operating System

No response

How does Datadog help you?

No response

Metadata

Metadata

Assignees

Labels

bugInvolves a bugcommunityWas opened by a community member

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions