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

bad pcap data for pcap upload #567

Open
systemcrash opened this issue Sep 20, 2024 · 1 comment
Open

bad pcap data for pcap upload #567

systemcrash opened this issue Sep 20, 2024 · 1 comment

Comments

@systemcrash
Copy link
Contributor

Not sure whether it's meant to be this way, but the default homer-app has no tshark in it. So I added it. And still got bad pcap, even if I upload a single SIP frame uncompressed pcap.

One problem: how dumpcap is installed. By default, on alpine, it is root:wireshark, but no attempt except for root:root seemed to work. So:

apk add tshark
ln -s ./usr/bin/tshark /usr/local/bin/tshark
chown root:root /usr/bin/dumpcap

But, no matter what, I still get a 400 with JSON: {"data":{},"message":"bad pcap data"}.

I set up my webapp_config.json to include:

  "decoder_shark": {
   "bin": "/usr/bin/tshark",
   "active": "true",
   "enable": "true",
   "uid": 0,
   "gid": 0,
   "protocols": "sip,rtp,rtcp"
  }

Checked the logs and..

{"level":"error","msg":"Bad decoding: tshark has been not enabled","time":"2024-09-20T17:54:13Z"}
{"level":"error","msg":"Bad decoding: tshark has been not enabled","time":"2024-09-20T17:57:44Z"}

Changed the webapp_config.json to:

  "decoder_shark": {
   "bin": "/usr/bin/tshark",
   "enable": true,
   "uid": 0,
   "gid": 0,
   "protocols": "sip,rtp,rtcp"
  }

Restart. Check the logs and...

{"level":"error","msg":"Bad decoding: tshark has been not enabled","time":"2024-09-20T18:14:33Z"}

But apparently my external config doesn't propagate to the docker container. The startup scripts don't configure for tshark. So I manually edited the config in the image.

Then I got the following if I tried 65535 (nobody):

{"level":"info","msg":"running under root/wheel: UID: [0], GID: [0] - [65534] - [65534]. Changing to user...","time":"2024-09-20T18:29:36Z"}
{"level":"info","msg":"Changing to: UID: [0], GID: [0]","time":"2024-09-20T18:29:36Z"}
{"level":"error","msg":"Bad combined output: signal: segmentation fault (core dumped)","time":"2024-09-20T18:29:38Z"}
{"level":"error","msg":"Bad decoding: signal: segmentation fault (core dumped)","time":"2024-09-20T18:29:38Z"}

So at least a bug in that info line.

And the following if I use 0 (root):

{"level":"info","msg":"running under root/wheel: UID: [0], GID: [0] - [0] - [0]. Changing to user...","time":"2024-09-20T18:42:25Z"}
{"level":"error","msg":"You run external decoder under root! Please set UID/GID in the config","time":"2024-09-20T18:42:25Z"}

But.... no response. I got NS_ERROR_NET_RESET.

🤷

Maybe it's broken.

@systemcrash
Copy link
Contributor Author

Some fixes included in #568

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

No branches or pull requests

1 participant