Skip to content

Error: Operation not permitted while using raw-socket for net-ping module #29762

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

Open
nr-mjuvvadi opened this issue May 6, 2025 · 0 comments

Comments

@nr-mjuvvadi
Copy link

I am using net-ping module in my container which runs on openshift environment as non root user.

I am getting below error when running script in my pod

var ping = require('net-ping')
ping.createSession({
  retries: 2,
  timeout: 1000
});

Error:

Error: Operation not permitted
at new Socket (/app/api-runtime/.yarn/unplugged/raw-socket-npm-1.7.0-8205b5d49b/node_modules/raw-socket/index.js:47:14)
at Object.exports.createSocket (/app/api-runtime/.yarn/unplugged/raw-socket-npm-1.7.0-8205b5d49b/node_modules/raw-socket/index.js:202:9)

I have NET_RAW and NET_ADMIN capabilities added to my custom SCC which I have defined for the user and this is getting reflected in my pod yaml as well as shown. Any way I can fix this.

I have tried adding setcap CAP_NET_RAW+eip /usr/bin/node but it didnt help

Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant