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] Weird interface name causes crash #118

Closed
timschneeb opened this issue Jun 15, 2022 · 6 comments
Closed

[Bug] Weird interface name causes crash #118

timschneeb opened this issue Jun 15, 2022 · 6 comments

Comments

@timschneeb
Copy link

timschneeb commented Jun 15, 2022

Description of the bug

Hey,

I'm trying to set up dashdot using Docker Compose on my server.
For some reason, dashdot looks for a network interface named enp0s31f6\nwlan0 with a line break that shouldn't be there and crashes after it attempts to retrieve information about it from the system.

How to reproduce

  1. Set up a new docker stack using this Docker compose config:
version: '3.5'
services:
  dash:
    image: mauricenino/dashdot:latest
    restart: unless-stopped
    privileged: true
    ports:
      - '3001:3001'
    volumes:
      - /etc/os-release:/etc/os-release:ro
      - /proc/1/ns/net:/mnt/host_ns_net:ro
      - /export:/mnt/host_media:ro
      - /mnt:/mnt/host_mnt:ro
    environment:
      DASHDOT_ENABLE_CPU_TEMPS: "true"
  1. Attempt to launch it

Relevant log output

listening on *:3001
Using network interface "enp0s31f6
wlan0"
node:internal/errors:845
  const err = new Error(message);
              ^

Error: Command failed: cat /internal_mnt/host_sys/class/net/enp0s31f6
wlan0/speed
cat: read error: Is a directory
/bin/sh: wlan0/speed: not found

    at ChildProcess.exithandler (node:child_process:387:12)
    at ChildProcess.emit (node:events:527:28)
    at maybeClose (node:internal/child_process:1090:16)
    at Socket.<anonymous> (node:internal/child_process:449:11)
    at Socket.emit (node:events:527:28)
    at Pipe.<anonymous> (node:net:740:14) {
�
  code: 127,
  killed: false,
  signal: null,
  cmd: 'cat /internal_mnt/host_sys/class/net/enp0s31f6\nwlan0/speed',
  stdout: '',
  stderr: 'cat: read error: Is a directory\n/bin/sh: wlan0/speed: not found\n'
}

Node.js v18.3.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
yarn run v1.22.19
$ node .
(node:28) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

Info output of dashdot cli

yarn run v1.22.19
$ node dist/apps/cli/main.js info
INFO
=========
Yarn: 1.22.19
Node: v18.3.0
Dash: 3.3.3

Cwd: /app
Hash: fe040a86f58934194d1f33793fb14b84896ff737
In Docker: true
In Podman: false
Done in 0.41s.

What browsers are you seeing the problem on?

Chrome

Where is your instance running?

Linux Server

Additional context

Here's the output of ifconfig as it probably is relevant (unrelated virtual network devices omitted):

enp0s31f6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.178.74  netmask 255.255.255.0  broadcast 192.168.178.255
        inet6 fe80::66a5:b53d:d810:f60  prefixlen 64  scopeid 0x20<link>
        ether 00:01:2e:81:dc:45  txqueuelen 1000  (Ethernet)
        RX packets 473465317  bytes 676790155893 (630.3 GiB)
        RX errors 0  dropped 434284  overruns 0  frame 0
        TX packets 128253829  bytes 55531476452 (51.7 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xdc300000-dc320000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 8241329  bytes 13071192069 (12.1 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8241329  bytes 13071192069 (12.1 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.178.81  netmask 255.255.255.0  broadcast 192.168.178.255
        inet6 fe80::24b2:bd0a:6d8c:f8  prefixlen 64  scopeid 0x20<link>
        ether 44:03:2c:93:29:57  txqueuelen 1000  (Ethernet)
        RX packets 897139  bytes 115915057 (110.5 MiB)
        RX errors 0  dropped 432383  overruns 0  frame 0
        TX packets 26550  bytes 3420898 (3.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
@timschneeb
Copy link
Author

When taking the wlan0 network interface down, dashdot works correctly:

sudo ifconfig wlan0 down

@MauriceNino
Copy link
Owner

Hi there, thanks for creating an issue. Can you please execute the following on your system and paste the output:

docker exec CONTAINER nsenter --net=/mnt/host_ns_net route

@timschneeb
Copy link
Author

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.178.1   0.0.0.0         UG    100    0        0 enp0s31f6
default         192.168.178.1   0.0.0.0         UG    20600  0        0 wlan0
172.17.0.0      *               255.255.0.0     U     0      0        0 docker0
172.18.0.0      *               255.255.0.0     U     0      0        0 br-394ccb4bb76e
172.19.0.0      *               255.255.0.0     U     0      0        0 br-736e450fb021
172.20.0.0      *               255.255.0.0     U     0      0        0 br-e51ed80d8b2a
172.21.0.0      *               255.255.0.0     U     0      0        0 br-817fd570a4ef
172.22.0.0      *               255.255.0.0     U     0      0        0 br-14cac5eb42b9
172.23.0.0      *               255.255.0.0     U     0      0        0 br-bd1245941fbd
172.28.0.0      *               255.255.0.0     U     0      0        0 br-8d6e053124b5
192.168.144.0   *               255.255.240.0   U     0      0        0 br-51da871b8313
192.168.178.0   *               255.255.255.0   U     100    0        0 enp0s31f6
192.168.178.0   *               255.255.255.0   U     600    0        0 wlan0

@MauriceNino
Copy link
Owner

Ah okay, thanks, so you got two default gateways somehow. I would say, I just choose the first one and if that is incorrect, you can use the flag that will be introduced in the next release (#117) to change it.

@timschneeb
Copy link
Author

Thanks! The changes on the dashdot:dev docker image work great for me now.

MauriceNino added a commit that referenced this issue Jun 15, 2022
# [3.4.0](v3.3.3...v3.4.0) (2022-06-15)

### Bug Fixes

* **api:** error on multiple default network interfaces ([3cf8774](3cf8774)), closes [#118](#118)

### Features

* **api, view:** add raid information to storage widget ([ba84d34](ba84d34)), closes [#40](#40)
* **api:** add option to select the used network interface ([8b6a78d](8b6a78d)), closes [#117](#117)
* **view:** add option to show in imperial units ([d4b1f69](d4b1f69))
@MauriceNino
Copy link
Owner

🎉 This issue has been resolved in version 3.4.0

Please check the changelog for more details.

alan-caio added a commit to alan-caio/healthcare-dshboard-react-node that referenced this issue Jul 28, 2022
# [3.4.0](MauriceNino/dashdot@v3.3.3...v3.4.0) (2022-06-15)

### Bug Fixes

* **api:** error on multiple default network interfaces ([3cf8774](MauriceNino/dashdot@3cf8774)), closes [#118](MauriceNino/dashdot#118)

### Features

* **api, view:** add raid information to storage widget ([ba84d34](MauriceNino/dashdot@ba84d34)), closes [#40](MauriceNino/dashdot#40)
* **api:** add option to select the used network interface ([8b6a78d](MauriceNino/dashdot@8b6a78d)), closes [#117](MauriceNino/dashdot#117)
* **view:** add option to show in imperial units ([d4b1f69](MauriceNino/dashdot@d4b1f69))
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

2 participants