myspeed icon indicating copy to clipboard operation
myspeed copied to clipboard

[Bug] Interface eth0 not found. Falling back to default.

Open Snake16547 opened this issue 1 year ago • 11 comments

General

  • [X] I have updated to the latest version of MySpeed.
  • [X] My bug has not been reported yet.

The Bug

Working with myspeed with an Raspberry Pi 4 + Dockge and for a couple weeks it worked flawless and suddenly stopped with following error message:

Interface eth0 not found. Falling back to default.

Working with following compose setup:

services:
  myspeed:
    ports:
      - 5216:5216
    volumes:
      - myspeed:/myspeed/data
    restart: unless-stopped
    container_name: MySpeed
    image: germannewsmaker/myspeed
volumes:
  myspeed: {}
networks:
  dockge_default:
    external: true

What device are you using to access the page?

In the browser

Which operating system is your MySpeed instance running on?

Linux

Snake16547 avatar Sep 07 '24 20:09 Snake16547

same problem here, use casa os. breaks after full os restart

towermom9 avatar Sep 27 '24 13:09 towermom9

Same problem here when running in Arch.

It looks like myspeed is looking for eth0 but as my interface is enp1s0 myspeed will not connect.

Is this correct?

jason4bury avatar Oct 11 '24 09:10 jason4bury

Same issue.

NorthernScott avatar Oct 18 '24 03:10 NorthernScott

I believe that the issue is found in server/util/loadInterfaces.js but I'm not sure why. Apologies, I am not a JS dev and not familiar with node. However, I can see that it is using the os.networkInterfaces() method to get an array of available interfaces. If I exec into my container, start the node interpreter, and execute something like i = os.networkInterfaces(), I get the following output:

> i = os.networkInterfaces()
{
  lo: [
    {
      address: '127.0.0.1',
      netmask: '255.0.0.0',
      family: 'IPv4',
      mac: '00:00:00:00:00:00',
      internal: true,
      cidr: '127.0.0.1/8'
    },
    {
      address: '::1',
      netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
      family: 'IPv6',
      mac: '00:00:00:00:00:00',
      internal: true,
      cidr: '::1/128',
      scopeid: 0
    }
  ],
  eth0: [
    {
      address: '172.100.0.3',
      netmask: '255.255.255.0',
      family: 'IPv4',
      mac: 'bc:24:11:ec:f1:3a',
      internal: false,
      cidr: '172.100.0.3/24'
    }
  ]
}

As you can see, the first object has two child objects which are the local loopback interfaces, but the second object is the eth0 interface showing the correct ip address for the container.

I can see that the function skips over any interfaces marked as "internal," and so it should ignore those first two and proceed on to the eth0 interface, but for some reason it's bailing out of the loop and "falling back to the default." Apologies again, I get a bit lost in the code at this point and I'm not sure what it's trying to use as the default.

As a point of comparison, this issue is only occuring when I bootstrap a container using docker compose. I tried installing it using the install script and it builds the container on the same host and works just fine. Unfortunately, I want to use Docker Compose so that the container is attached to my Portainer stack and is assigned the correct IP address.

For reference, here are the relevant bits of my compose:

  myspeed:
    image: germannewsmaker/myspeed:latest
    restart: unless-stopped
    container_name: myspeed
    hostname: myspeed
    privileged: false
    ports:
      - 5216:5216
    volumes:
      - myspeed:/myspeed/data
    networks:
      tradewinds:
        ipv4_address: 172.100.0.3

networks:
  tradewinds:
    name: tradewinds
    attachable: true
    driver: ipvlan
    driver_opts:
      parent: eth0
      ipvlan_mode: l3
      ipvlan_flag: bridge
    ipam:
      config:
        - subnet: 172.100.0.0/24
          gateway: 172.100.0.1
          ip_range: 172.100.0.0/24

Hoping that this helps.

NorthernScott avatar Oct 22 '24 05:10 NorthernScott

Same problem after restarting my raspberry pi 4 that runs CasaOS, sharing the traces I collected from the container.

An error occurred: getaddrinfo EAI_AGAIN github.com
Successfully connected to the database file
Integration "discord" loaded successfully
Integration "gotify" loaded successfully
Integration "healthChecks" loaded successfully
Integration "pushover" loaded successfully
Integration "telegram" loaded successfully
Integration "webhook" loaded successfully
Looking for network interfaces...
Interface eth0 not found. Falling back to default.
An error occurred: getaddrinfo EAI_AGAIN github.com

elulcao avatar Dec 30 '24 03:12 elulcao

I found a WA for those using CasaOS and bridge network. The bridge IPV4 IPAM Gateway needs to be used, so the container can communicate with the external network: 172.17.0.1 In my case the IP is 172.17.0.1 so please check what IP has been assigned to the bridge network. The myspeed container worked as it should be after re-creating the container with the new DNS.

Screenshot 2024-12-30 at 13 07 57

elulcao avatar Dec 30 '24 20:12 elulcao

For me this compose works:

version: '3.9'
services:
  myspeed:
    image: germannewsmaker/myspeed
    container_name: MySpeed
    network_mode: 'host'
    dns:
      - 9.9.9.9
      - 2a07:e340::2
    volumes:
      - '/home/******/.config/MySpeed:/myspeed/data'

Jogai avatar Jan 16 '25 20:01 Jogai

Same here:

Image

Abraka avatar Jan 20 '25 00:01 Abraka

I have the same problem. Here is my docker compose

services:
    myspeed:
        image: "germannewsmaker/myspeed:latest"
        container_name: myspeed
        restart: always
        environment:
            - PUID=1000 
            - PGID=10 
            - TZ=Asia/Shanghai
        ports:
            - 5216:5216
        volumes:
            - ./data:/myspeed/data 
        network_mode: bridge

ghostdavid avatar Jul 23 '25 06:07 ghostdavid

I have the same problem. Here is my docker compose

services:
    myspeed:
        image: "germannewsmaker/myspeed:latest"
        container_name: myspeed
        restart: always
        environment:
            - PUID=1000 
            - PGID=10 
            - TZ=Asia/Shanghai
        ports:
            - 5216:5216
        volumes:
            - ./data:/myspeed/data 
        network_mode: bridge

You should try deploying with your docker-compose file but configure by hand the network, it's my understanding that network needs manual configuration since the container engine set default values.

elulcao avatar Jul 23 '25 15:07 elulcao

The problem is in server/tilt/loadInterfaces.js, which records whether the interface is available based on whether this interface can access speed.cloudflare.com/__down?bytes=1 Those that can be accessed will be recorded in useableInterfaces, which can override the detection logic inside to skip network checks Try this modified version, which removes network connection detection, adds CLI download skip, and fixes the issue of SQLite initialization failure myspeed-1.0.9-mod.zip

chencu5958 avatar Jul 27 '25 14:07 chencu5958