DataDog / libddwaf-rb

Bindings to libddwaf for Ruby
Other
0 stars 1 forks source link

Heroku deployment is missing libddwaf.so #32

Closed nertzy closed 1 year ago

nertzy commented 1 year ago

In our Gemfile we have:

group :test, :production do
  gem "ddtrace", require: "ddtrace/auto_instrument"
  gem "dogstatsd-ruby"
end

We are deploying to Heroku and using the datadog buildpack.

When our application boots up, it is unable to find libddwaf.so.

E, [2023-06-06T22:21:11.909212 #2] ERROR -- ddtrace: [ddtrace] (/app/vendor/bundle/ruby/3.2.0/gems/ddtrace-1.12.0/lib/datadog/appsec/processor.rb:121:in `rescue in require_libddwaf') libddwaf failed to load,installed platform: ruby ruby platforms: ["ruby", "x86_64-linux"] error: #<LoadError: Could not open library '/app/vendor/bundle/ruby/3.2.0/gems/libddwaf-1.9.0.0.0/lib/datadog/appsec/../../../vendor/libddwaf/libddwaf-1.9.0-linux-gnu-x86_64/lib/libddwaf.so': /app/vendor/bundle/ruby/3.2.0/gems/libddwaf-1.9.0.0.0/lib/datadog/appsec/../../../vendor/libddwaf/libddwaf-1.9.0-linux-gnu-x86_64/lib/libddwaf.so: cannot open shared object file: No such file or directory>

I am not sure why the Heroku build process is failing to get the .so to the right location.

I can heroku ps:exec into one of our dynos and see that the /app/vendor/bundle/ruby/3.2.0/gems/libddwaf-1.9.0.0.0/lib/datadog/appsec/../../../vendor/libddwaf directory is not present.

GustavoCaso commented 1 year ago

Good morning @nertzy. Thanks for opening the issue.

Have you tried running bundle lock --add-platform x86_64-linux. There is a more detailed explanation of the subject matter on the issue you linked. https://github.com/DataDog/dd-trace-rb/issues/2652#issuecomment-1450154874

nertzy commented 1 year ago

Yes, that worked for me. Thanks!