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

Devices offline after initial discovery #929

Open
4 of 7 tasks
Jennis1408 opened this issue Jan 3, 2025 · 1 comment
Open
4 of 7 tasks

Devices offline after initial discovery #929

Jennis1408 opened this issue Jan 3, 2025 · 1 comment
Labels
bug 🐛 Something isn't working Waiting for reply⏳ Waiting for the original poster to respond, or discussion in progress.

Comments

@Jennis1408
Copy link

Is there an existing issue for this?

The issue occurs in the following browsers. Select at least 2.

  • Firefox
  • Chrome
  • Edge
  • Safari (unsupported) - PRs welcome
  • N/A - This is an issue with the backend

Current Behavior

Devices are scanned and detected, however, they switch to offline after 3 to 5 minutes and I can guarantee most of them (if not all) are actually online.

Expected Behavior

I'd expect the online devices to be shown online.

Steps To Reproduce

NetAlert V24.12.23 deployed on Portainer V 2.21.5

Subnet Scan configured according to my network, initial scan works and detects devices.

app.conf

48b24950b1a43672cc24016257084efdf2bf7983b4de563be0f8b5087f4fbc6d
AppArmorProfile
Args [ ]
Config { AttachStderr: true, AttachStdin: false, AttachStdout: true, Cmd: null, Domainname: , Entrypoint: /init, Env: HOST_USER_GID=1000,TZ=Europe/Berlin,PORT=17811,HOST_USER_ID=1000,PATH=/opt/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin,LISTEN_ADDR=0.0.0.0,S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0, Healthcheck: [object Object], Hostname: docker, Image: jokobsk/netalertx:latest, Labels: [object Object], OnBuild: null, OpenStdin: false, StdinOnce: false, Tty: false, User: , Volumes: null, WorkingDir: / }
Created 2025-01-02T18:39:59.278536018Z
Driver overlay2
ExecIDs
GraphDriver { Data: [object Object], Name: overlay2 }
HostConfig { AutoRemove: false, Binds: /volume1/docker/netalertx/config:/app/config:rw,/volume1/docker/netalertx/db:/app/db:rw,/volume1/docker/netalertx/logs:/app/front/log:rw, BlkioDeviceReadBps: null, BlkioDeviceReadIOps: null, BlkioDeviceWriteBps: null, BlkioDeviceWriteIOps: null, BlkioWeight: 0, BlkioWeightDevice: null, CapAdd: null, CapDrop: null, Cgroup: , CgroupParent: , CgroupnsMode: private, ConsoleSize: 0,0, ContainerIDFile: , CpuCount: 0, CpuPercent: 0, CpuPeriod: 0, CpuQuota: 0, CpuRealtimePeriod: 0, CpuRealtimeRuntime: 0, CpuShares: 768, CpusetCpus: , CpusetMems: , DeviceCgroupRules: null, DeviceRequests: null, Devices: null, Dns: , DnsOptions: , DnsSearch: , ExtraHosts: , GroupAdd: null, IOMaximumBandwidth: 0, IOMaximumIOps: 0, IpcMode: private, Isolation: , Links: null, LogConfig: [object Object], MaskedPaths: /proc/asound,/proc/acpi,/proc/kcore,/proc/keys,/proc/latency_stats,/proc/timer_list,/proc/timer_stats,/proc/sched_debug,/proc/scsi,/sys/firmware,/sys/devices/virtual/powercap, Memory: 0, MemoryReservation: 0, MemorySwap: -1, MemorySwappiness: null, NanoCpus: 0, NetworkMode: host, OomKillDisable: null, OomScoreAdj: 0, PidMode: , PidsLimit: null, PortBindings: [object Object], Privileged: false, PublishAllPorts: false, ReadonlyPaths: /proc/bus,/proc/fs,/proc/irq,/proc/sys,/proc/sysrq-trigger, ReadonlyRootfs: false, RestartPolicy: [object Object], Runtime: runc, SecurityOpt: no-new-privileges:true, ShmSize: 67108864, UTSMode: , Ulimits: null, UsernsMode: , VolumeDriver: , VolumesFrom: null }
HostnamePath /var/lib/docker/containers/48b24950b1a43672cc24016257084efdf2bf7983b4de563be0f8b5087f4fbc6d/hostname
HostsPath /var/lib/docker/containers/48b24950b1a43672cc24016257084efdf2bf7983b4de563be0f8b5087f4fbc6d/hosts
Id 48b24950b1a43672cc24016257084efdf2bf7983b4de563be0f8b5087f4fbc6d
Image sha256:d33249ee39ae4930459740b0638623b47c9151094239eefce6e2eb9bf4e086e7
LogPath /var/lib/docker/containers/48b24950b1a43672cc24016257084efdf2bf7983b4de563be0f8b5087f4fbc6d/48b24950b1a43672cc24016257084efdf2bf7983b4de563be0f8b5087f4fbc6d-json.log
MountLabel
Mounts [ [object Object], [object Object], [object Object] ]
Name /NetAlertX
NetworkSettings { Bridge: , EndpointID: , Gateway: , GlobalIPv6Address: , GlobalIPv6PrefixLen: 0, HairpinMode: false, IPAddress: , IPPrefixLen: 0, IPv6Gateway: , LinkLocalIPv6Address: , LinkLocalIPv6PrefixLen: 0, MacAddress: , Networks: [object Object], Ports: [object Object], SandboxID: 0ce8abd434fdcd0962f05dd03dde637db8ca601cf23cf1fc6d9ec0275e099fa7, SandboxKey: /var/run/docker/netns/default, SecondaryIPAddresses: null, SecondaryIPv6Addresses: null }
Path /init
Platform linux
Portainer { ResourceControl: [object Object] }
ProcessLabel
ResolvConfPath /var/lib/docker/containers/48b24950b1a43672cc24016257084efdf2bf7983b4de563be0f8b5087f4fbc6d/resolv.conf
RestartCount 0
State { Dead: false, Error: , ExitCode: 0, FinishedAt: 2025-01-02T20:14:34.525667895Z, Health: [object Object], OOMKilled: false, Paused: false, Pid: 2764, Restarting: false, Running: true, StartedAt: 2025-01-02T20:14:40.171965113Z, Status: running }

docker-compose.yml

services:
  netalertx:
     container_name: NetAlertX
     healthcheck:
      test: curl -f http://localhost:17811/ || exit 1
     mem_limit: 4g
     cpu_shares: 768
     security_opt:
      - no-new-privileges:true
     volumes:
      - /volume1/docker/netalertx/config:/app/config:rw
      - /volume1/docker/netalertx/db:/app/db:rw
      - /volume1/docker/netalertx/logs:/app/front/log:rw
     environment:
      TZ: Europe/Berlin
      PORT: 17811
      HOST_USER_ID: 1000
      HOST_USER_GID: 1000
     network_mode: host
     restart: on-failure:5
     image: jokobsk/netalertx:latest

What branch are you running?

Production

app.log

16:10:36 [INTRNT] Current internet_IP : 91.44.73.130
16:10:36 [INTRNT] previous_IP : 91.44.73.130
16:10:36 [INTRNT] Finished
16:10:36 [Plugins] Processed and deleted file: /app/log/plugins/last_result.INTRNT.log
16:10:36 [Plugins] SUCCESS, received 1 entries
16:10:37 [Scheduler] run for CSVBCKP: NO
16:10:37 [Scheduler] run for DBCLNP: NO
16:10:37 [Scheduler] run for MAINT: NO
16:10:37 [Scheduler] run for VNDRPDT: NO
16:10:37 [Process Scan] Exclude ignored devices
16:10:37 [Process Scan] Processing scan results
16:10:37 [Process Scan] Print Stats
16:10:37 [Scan Stats] Devices Detected.......: 2
16:10:37 [Scan Stats] New Devices............: 0
16:10:37 [Scan Stats] Down Alerts............: 0
16:10:37 [Scan Stats] New Down Alerts........: 0
16:10:37 [Scan Stats] New Connections........: 31
16:10:37 [Scan Stats] Disconnections.........: 0
16:10:37 [Scan Stats] IP Changes.............: 0
16:10:37 [Scan Stats] Scan Method Statistics:
16:10:37 INTRNT: 1
16:10:37 local_MAC: 1
16:10:37 [Process Scan] Stats end
16:10:37 [Process Scan] Sessions Events (connect / disconnect)
16:10:37 [Process Scan] Creating new devices
16:10:37 [Process Scan] Updating Devices Info
16:10:37 [Process Scan] Voiding false (ghost) disconnections
16:10:37 [Process Scan] Pairing session events (connection / disconnection)
16:10:37 [Process Scan] Creating sessions snapshot
16:10:37 [Process Scan] Inserting scan results into Online_History
16:10:37 [Process Scan] Skipping repeated notifications
16:10:37 [Skip Repeated Notifications] Skip Repeated
16:10:37 [Plugin utils] ---------------------------------------------
16:10:37 [Plugin utils] display_name: AVAHISCAN (Name discovery)
16:10:37 [Plugins] Executing: python3 /app/front/plugins/avahi_scan/avahi_scan.py
16:10:38 [Plugins] Output: Runlevel: sysinit
avahi-daemon [ started ]
Dynamic Runlevel: hotplugged
Dynamic Runlevel: needed/wanted
dbus [ crashed ]
Dynamic Runlevel: manual

  • rc-update: avahi-daemon already installed in runlevel `sysinit'; skipping
  • WARNING: dbus has already been started
    [plugin_helper] reading config file
    16:10:38 [AVAHISCAN] In script
    16:10:38 [Database] Opening DB
    16:10:38 [AVAHISCAN] Unknown devices count: 12
    16:10:38 [AVAHISCAN] Attempt 1 - Ensuring D-Bus and Avahi daemon are running...
    16:10:38 [AVAHISCAN] Avahi Daemon is already running.
    16:10:38 [AVAHISCAN] DEBUG CMD :['avahi-resolve', '-a', '192.168.178.1']
    16:10:38 [AVAHISCAN] ⚠ ERROR - Failed to create client object: Daemon not running
    16:10:38 [AVAHISCAN] Scan: FAIL - check logs
    16:10:38 [AVAHISCAN] DEBUG CMD :['avahi-resolve', '-a', '192.168.178.2']
    16:10:38 [AVAHISCAN] ⚠ ERROR - Failed to create client object: Daemon not running
    16:10:38 [AVAHISCAN] Scan: FAIL - check logs
    16:10:38 [AVAHISCAN] DEBUG CMD :['avahi-resolve', '-a', '192.168.178.15']
    16:10:38 [AVAHISCAN] ⚠ ERROR - Failed to create client object: Daemon not running
    16:10:38 [AVAHISCAN] Scan: FAIL - check logs
    16:10:38 [AVAHISCAN] DEBUG CMD :['avahi-resolve', '-a', '192.168.178.16']
    16:10:38 [AVAHISCAN] ⚠ ERROR - Failed to create client object: Daemon not running
    16:10:38 [AVAHISCAN] Scan: FAIL - check logs
    16:10:38 [AVAHISCAN] DEBUG CMD :['avahi-resolve', '-a', '192.168.178.18']
    16:10:38 [AVAHISCAN] ⚠ ERROR - Failed to create client object: Daemon not running
    16:10:38 [AVAHISCAN] Scan: FAIL - check logs
    16:10:38 [AVAHISCAN] DEBUG CMD :['avahi-resolve', '-a', '192.168.178.17']
    16:10:38 [AVAHISCAN] ⚠ ERROR - Failed to create client object: Daemon not running
    16:10:38 [AVAHISCAN] Scan: FAIL - check logs
    16:10:38 [AVAHISCAN] DEBUG CMD :['avahi-resolve', '-a', '192.168.178.54']
    16:10:38 [AVAHISCAN] ⚠ ERROR - Failed to create client object: Daemon not running
    16:10:38 [AVAHISCAN] Scan: FAIL - check logs
    16:10:38 [AVAHISCAN] DEBUG CMD :['avahi-resolve', '-a', '192.168.178.19']
    16:10:38 [AVAHISCAN] ⚠ ERROR - Failed to create client object: Daemon not running
    16:10:38 [AVAHISCAN] Scan: FAIL - check logs
    16:10:38 [AVAHISCAN] DEBUG CMD :['avahi-resolve', '-a', '192.168.178.27']
    16:10:38 [AVAHISCAN] ⚠ ERROR - Failed to create client object: Daemon not running
    16:10:38 [AVAHISCAN] Scan: FAIL - check logs
    16:10:38 [AVAHISCAN] DEBUG CMD :['avahi-resolve', '-a', '192.168.178.55']
    16:10:38 [AVAHISCAN] ⚠ ERROR - Failed to create client object: Daemon not running
    16:10:38 [AVAHISCAN] Scan: FAIL - check logs
    16:10:38 [AVAHISCAN] DEBUG CMD :['avahi-resolve', '-a', '192.168.178.65']
    16:10:38 [AVAHISCAN] ⚠ ERROR - Failed to create client object: Daemon not running
    16:10:38 [AVAHISCAN] Scan: FAIL - check logs
    16:10:38 [AVAHISCAN] DEBUG CMD :['avahi-resolve', '-a', '192.168.178.57']
    16:10:38 [AVAHISCAN] ⚠ ERROR - Failed to create client object: Daemon not running
    16:10:38 [AVAHISCAN] Scan: FAIL - check logs
    16:10:38 [AVAHISCAN] Script finished

Debug enabled

  • I have read and followed the steps in the wiki link above and provided the required debug logs and the log section covers the time when the issue occurs.
@Jennis1408 Jennis1408 added the bug 🐛 Something isn't working label Jan 3, 2025
@jokob-sk
Copy link
Owner

jokob-sk commented Jan 3, 2025

Hi @Jennis1408 ,

  1. Can you please let me know if your schedules of all scanners are the same?
  2. Which plugins do you have enabled?
  3. Are there any other errors in your Portainer log?

Also please note:

  • the logs folder has changed in the latest release:

OLD:

- /volume1/docker/netalertx/logs:/app/front/log:rw

NEW

- /volume1/docker/netalertx/logs:/app/log:rw

These variables are obsolete:

      HOST_USER_ID: 1000
      HOST_USER_GID: 1000

@jokob-sk jokob-sk added the Waiting for reply⏳ Waiting for the original poster to respond, or discussion in progress. label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working Waiting for reply⏳ Waiting for the original poster to respond, or discussion in progress.
Projects
None yet
Development

No branches or pull requests

2 participants