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

[fixed in 24.2.17] tab devices is empty #568

Closed
2 tasks done
iklo92 opened this issue Feb 16, 2024 · 16 comments
Closed
2 tasks done

[fixed in 24.2.17] tab devices is empty #568

iklo92 opened this issue Feb 16, 2024 · 16 comments
Labels
bug 🐛 Something isn't working next release/in dev image🚀 This is coming in the next release or was already released if the issue is Closed.

Comments

@iklo92
Copy link

iklo92 commented Feb 16, 2024

Is there an existing issue for this?

Current Behavior

I have upgrade with the last version, yesterday. Tab devices is empty, I have check and setup "my devices" option with the new version

Expected Behavior

to see all devices on "my devices"

Steps To Reproduce

No response

pialert.conf

#-----------------AUTOGENERATED FILE-----------------#
#                                                    #
#         Generated:  2024-02-16_15-05-19            #
#                                                    #
#   Config file for the LAN intruder detection app:  #
#      https://github.com/jokob-sk/Pi.Alert          #
#                                                    #
#-----------------AUTOGENERATED FILE-----------------#


# General
#---------------------------
LOG_LEVEL='verbose'
LOG_LEVEL__metadata="{}"
TIMEZONE='Europe/Paris'
TIMEZONE__metadata="{}"
PLUGINS_KEEP_HIST=250
PLUGINS_KEEP_HIST__metadata="{}"
PIALERT_WEB_PROTECTION=False
PIALERT_WEB_PROTECTION__metadata="{}"
PIALERT_WEB_PASSWORD='8d969eef6ecad3c29a3a629280e686xxxxxxxxxxxxxxxxxx'
PIALERT_WEB_PASSWORD__metadata="{}"
REPORT_DASHBOARD_URL='http://pi.alert'
REPORT_DASHBOARD_URL__metadata="{}"
UI_LANG='English'
UI_LANG__metadata="{}"
UI_PRESENCE=['online','offline','archived']
UI_PRESENCE__metadata="{}"
UI_MY_DEVICES=['online','offline','new','down']
UI_MY_DEVICES__metadata="{}"
UI_NOT_RANDOM_MAC=[]
UI_NOT_RANDOM_MAC__metadata="{}"
DAYS_TO_KEEP_EVENTS=90
DAYS_TO_KEEP_EVENTS__metadata="{}"
HRS_TO_KEEP_NEWDEV=0
HRS_TO_KEEP_NEWDEV__metadata="{}"
API_CUSTOM_SQL='SELECT * FROM Devices WHERE dev_PresentLastScan = 0'
API_CUSTOM_SQL__metadata="{}"
NETWORK_DEVICE_TYPES=['AP','Gateway','Firewall','Hypervisor','Powerline','Switch','WLAN','PLC','Router','USB LAN Adapter','USB WIFI Adapter','Internet']
NETWORK_DEVICE_TYPES__metadata="{}"

docker-compose.yml

version: "3"
services:
  pialert:
    container_name: pialert
    image: "jokobsk/pi.alert:latest"      
    network_mode: "host"
    restart: unless-stopped
    volumes:
      - ./pialert/config:/home/pi/pialert/config
      - ./pialert/db:/home/pi/pialert/db      
      - ./pialert/log:/home/pi/pialert/front/log
    environment:
      - TZ=Europe/Paris     
      - HOST_USER_ID=1000
      - HOST_USER_GID=1000
      - USER_HOME=xxxx
      - PORT=20211

What branch are you running?

Production

pialert.log

15:10:31 [Process Scan] Processing scan results
15:10:31 [Process Scan] Print Stats
15:10:31 [Scan Stats] Devices Detected.......: 28
15:10:31 [Scan Stats] New Devices............: 0
15:10:31 [Scan Stats] Down Alerts............: 0
15:10:31 [Scan Stats] New Down Alerts........: 0
15:10:31 [Scan Stats] New Connections........: 10
15:10:31 [Scan Stats] Disconnections.........: 0
15:10:31 [Scan Stats] IP Changes.............: 0
15:10:31 [Scan Stats] Scan Method Statistics:
15:10:31 INTRNT: 1
15:10:31 arp-scan: 26
15:10:31 local_MAC: 1
15:10:31 [Process Scan] Stats end
15:10:31 [Process Scan] Sessions Events (connect / discconnect)
15:10:31 [Process Scan] Creating new devices
15:10:31 [Process Scan] Updating Devices Info
15:10:31 [Process Scan] Voiding false (ghost) disconnections
15:10:31 [Process Scan] Pairing session events (connection / disconnection)
15:10:31 [Process Scan] Creating sessions snapshot
15:10:31 [Process Scan] Inserting scan results into Online_History
15:10:31 [Process Scan] Skipping repeated notifications
15:10:31 [Skip Repeated Notifications] Skip Repeated
15:10:31 [Update Device Name] Trying to resolve devices without name. Unknown devices count: 5
15:10:31 [Update Device Name] Pholus entries from prev scans: 241
15:10:31 [Update Device Name] Names Found (DiG/NSLOOKUP/Pholus): 0 (0/0/0)
15:10:31 [Update Device Name] Names Not Found : 5
15:10:31 [Notification] Check if something to report
15:10:31 [Notification] Included sections: ['new_devices', 'down_devices', 'events']
15:10:31 [Notification] No changes to report
15:10:31 [MAIN] Process: Wait
15:10:36 [API] Updating table_appevents.json file in /front/api
15:11:12 [Update Device Name] Trying to resolve devices without name. Unknown devices count: 5
15:11:12 [Update Device Name] Pholus entries from prev scans: 241
15:11:12 [Update Device Name] Names Found (DiG/NSLOOKUP/Pholus): 0 (0/0/0)
15:11:12 [Update Device Name] Names Not Found : 5
15:11:12 [Notification] Check if something to report
15:11:12 [Notification] Included sections: ['new_devices', 'down_devices', 'events']
15:11:12 [Notification] No changes to report
15:11:12 [MAIN] Process: Wait
15:12:13 [Update Device Name] Trying to resolve devices without name. Unknown devices count: 5
15:12:13 [Update Device Name] Pholus entries from prev scans: 241
15:12:13 [Update Device Name] Names Found (DiG/NSLOOKUP/Pholus): 0 (0/0/0)
15:12:13 [Update Device Name] Names Not Found : 5
15:12:13 [Notification] Check if something to report
15:12:13 [Notification] Included sections: ['new_devices', 'down_devices', 'events']
15:12:13 [Notification] No changes to report
15:12:13 [MAIN] Process: Wait
15:13:14 [Update Device Name] Trying to resolve devices without name. Unknown devices count: 5
15:13:14 [Update Device Name] Pholus entries from prev scans: 241
15:13:14 [Update Device Name] Names Found (DiG/NSLOOKUP/Pholus): 0 (0/0/0)
15:13:14 [Update Device Name] Names Not Found : 5
15:13:14 [Notification] Check if something to report
15:13:14 [Notification] Included sections: ['new_devices', 'down_devices', 'events']
15:13:14 [Notification] No changes to report
15:13:14 [MAIN] Process: Wait
15:14:15 [Update Device Name] Trying to resolve devices without name. Unknown devices count: 5
15:14:15 [Update Device Name] Pholus entries from prev scans: 241
15:14:16 [Update Device Name] Names Found (DiG/NSLOOKUP/Pholus): 0 (0/0/0)
15:14:16 [Update Device Name] Names Not Found : 5
15:14:16 [Notification] Check if something to report
15:14:16 [Notification] Included sections: ['new_devices', 'down_devices', 'events']
15:14:16 [Notification] No changes to report
15:14:16 [MAIN] Process: Wait

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.
@iklo92 iklo92 added the bug 🐛 Something isn't working label Feb 16, 2024
@iklo92 iklo92 changed the title tab onglet is empty tab devices is empty Feb 16, 2024
@iklo92
Copy link
Author

iklo92 commented Feb 16, 2024

The presence tab is correctly filled in, I can see all my devices clearly.
I of course tried several browsers and even cleared the caches

@anarkia47
Copy link

anarkia47 commented Feb 16, 2024

Can confirm have the same issue, was working fine a few days ago. Will try to post logs when I can.

@pax0707
Copy link

pax0707 commented Feb 16, 2024

I just did a fresh install and was wondering if I did anything wrong.

2024/02/16 16:26:10 [error] 149#149: *3 FastCGI sent in stderr: "PHP message: PHP Warning:  file_get_contents(./log/pialert.php_errors.log): Failed to open stream: No such file or directory in /home/pi/pialert/front/maintenance.php on line 442; PHP message: PHP Warning:  filesize(): stat failed for ./log/pialert.php_errors.log in /home/pi/pialert/front/maintenance.php on line 447; PHP message: PHP Warning:  file_get_contents(./log/stdout.log): Failed to open stream: No such file or directory in /home/pi/pialert/front/maintenance.php on line 469" while reading upstream, client: 172.16.1.9, server: , request: "GET /maintenance.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "172.16.1.3:20211", referrer: "http://172.16.1.3:20211/plugins.php"
2024/02/16 16:26:10 [error] 149#149: *3 FastCGI sent in stderr: "; PHP message: PHP Warning:  filesize(): stat failed for ./log/stdout.log in /home/pi/pialert/front/maintenance.php on line 474; PHP message: PHP Warning:  file_get_contents(./log/stderr.log): Failed to open stream: No such file or directory in /home/pi/pialert/front/maintenance.php on line 486; PHP message: PHP Warning:  filesize(): stat failed for ./log/stderr.log in /home/pi/pialert/front/maintenance.php on line 491" while reading upstream, client: 172.16.1.9, server: , request: "GET /maintenance.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "172.16.1.3:20211", referrer: "http://172.16.1.3:20211/plugins.php"
2024/02/16 16:26:19 [error] 149#149: *4 FastCGI sent in stderr: "PHP message: PHP Warning:  file_get_contents(./log/pialert.php_errors.log): Failed to open stream: No such file or directory in /home/pi/pialert/front/maintenance.php on line 442; PHP message: PHP Warning:  filesize(): stat failed for ./log/pialert.php_errors.log in /home/pi/pialert/front/maintenance.php on line 447" while reading upstream, client: 172.16.1.9, server: , request: "GET /maintenance.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "172.16.1.3:20211", referrer: "http://172.16.1.3:20211/systeminfo.php"
2024/02/16 16:26:19 [error] 149#149: *4 FastCGI sent in stderr: "; PHP message: PHP Warning:  file_get_contents(./log/stdout.log): Failed to open stream: No such file or directory in /home/pi/pialert/front/maintenance.php on line 469; PHP message: PHP Warning:  filesize(): stat failed for ./log/stdout.log in /home/pi/pialert/front/maintenance.php on line 474; PHP message: PHP Warning:  file_get_contents(./log/stderr.log): Failed to open stream: No such file or directory in /home/pi/pialert/front/maintenance.php on line 486; PHP message: PHP Warning:  filesize(): stat failed for ./log/stderr.log in /home/pi/pialert/front/maintenance.php on line 491" while reading upstream, client: 172.16.1.9, server: , request: "GET /maintenance.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "172.16.1.3:20211", referrer: "http://172.16.1.3:20211/systeminfo.php"
2024/02/16 16:33:36 [error] 150#150: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  file_get_contents(./log/pialert.php_errors.log): Failed to open stream: No such file or directory in /home/pi/pialert/front/maintenance.php on line 442; PHP message: PHP Warning:  filesize(): stat failed for ./log/pialert.php_errors.log in /home/pi/pialert/front/maintenance.php on line 447" while reading upstream, client: 172.16.1.9, server: , request: "GET /maintenance.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "172.16.1.3:20211", referrer: "http://172.16.1.3:20211/devices.php"
2024/02/16 16:33:36 [error] 150#150: *1 FastCGI sent in stderr: "; PHP message: PHP Warning:  file_get_contents(./log/stdout.log): Failed to open stream: No such file or directory in /home/pi/pialert/front/maintenance.php on line 469; PHP message: PHP Warning:  filesize(): stat failed for ./log/stdout.log in /home/pi/pialert/front/maintenance.php on line 474; PHP message: PHP Warning:  file_get_contents(./log/stderr.log): Failed to open stream: No such file or directory in /home/pi/pialert/front/maintenance.php on line 486; PHP message: PHP Warning:  filesize(): stat failed for ./log/stderr.log in /home/pi/pialert/front/maintenance.php on line 491" while reading upstream, client: 172.16.1.9, server: , request: "GET /maintenance.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "172.16.1.3:20211", referrer: "http://172.16.1.3:20211/devices.php"
2024/02/16 16:35:32 [error] 151#151: *44 FastCGI sent in stderr: "PHP message: PHP Warning:  file_get_contents(./log/pialert.php_errors.log): Failed to open stream: No such file or directory in /home/pi/pialert/front/maintenance.php on line 442; PHP message: PHP Warning:  filesize(): stat failed for ./log/pialert.php_errors.log in /home/pi/pialert/front/maintenance.php on line 447" while reading upstream, client: 172.16.1.9, server: , request: "GET /maintenance.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "172.16.1.3:20211", referrer: "http://172.16.1.3:20211/devices.php"
2024/02/16 16:35:32 [error] 151#151: *44 FastCGI sent in stderr: "; PHP me" while reading upstream, client: 172.16.1.9, server: , request: "GET /maintenance.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "172.16.1.3:20211", referrer: "http://172.16.1.3:20211/devices.php"
2024/02/16 16:35:32 [error] 151#151: *44 FastCGI sent in stderr: "ssage: PHP Warning:  file_get_contents(./log/stdout.log): Failed to open stream: No such file or directory in /home/pi/pialert/front/maintenance.php on line 469; PHP message: PHP Warning:  filesize(): stat failed for ./log/stdout.log in /home/pi/pialert/front/maintenance.php on line 474; PHP message: PHP Warning:  file_get_contents(./log/stderr.log): Failed to open stream: No such file or directory in /home/pi/pialert/front/maintenance.php on line 486; PHP message: PHP Warning:  filesize(): stat failed for ./log/stderr.log in /home/pi/pialert/front/maintenance.php on line 491" while reading upstream, client: 172.16.1.9, server: , request: "GET /maintenance.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "172.16.1.3:20211", referrer: "http://172.16.1.3:20211/devices.php"
2024/02/16 16:36:10 [error] 151#151: *44 FastCGI sent in stderr: "PHP message: PHP Warning:  file_get_contents(./log/pialert.php_errors.log): Failed to open stream: No such file or directory in /home/pi/pialert/front/maintenance.php on line 442; PHP message: PHP Warning:  filesize(): stat failed for ./log/pialert.php_errors.log in /home/pi/pialert/front/maintenance.php on line 447" while reading upstream, client: 172.16.1.9, server: , request: "GET /maintenance.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "172.16.1.3:20211", referrer: "http://172.16.1.3:20211/devices.php"
2024/02/16 16:36:11 [error] 151#151: *44 FastCGI sent in stderr: "; PHP message: PHP Warning:  file_get_contents(./log/stdout.log): Failed to open stream: No such file or directory in /home/pi/pialert/front/maintenance.php on line 469; PHP message: PHP Warning:  filesize(): stat failed for ./log/stdout.log in /home/pi/pialert/front/maintenance.php on line 474; PHP message: PHP Warning:  file_get_contents(./log/stderr.log): Failed to open stream: No such file or directory in /home/pi/pialert/front/maintenance.php on line 486; PHP message: PHP Warning:  filesize(): stat failed for ./log/stderr.log in /home/pi/pialert/front/maintenance.php on line 491" while reading upstream, client: 172.16.1.9, server: , request: "GET /maintenance.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.2-fpm.sock:", host: "172.16.1.3:20211", referrer: "http://172.16.1.3:20211/devices.php"
                              

@diogovalentte
Copy link

diogovalentte commented Feb 16, 2024

I installed pi-alert today for the first time using the docker image and I'm having the same issue.

Looking at the console on my web browser, the only error I see is:

devices.php:1035 Uncaught TypeError: Cannot read properties of null (reading 'trim')
    at Object.<anonymous> (devices.php:1035:38)
    at Function.each (jquery.min.js:2:2777)
    at getNumberOfChildren (devices.php:1033:5)
    at devices.php:816:17
    at Array.map (<anonymous>)
    at Object.success (devices.php:798:28)
    at c (jquery.min.js:2:27742)
    at Object.fireWith [as resolveWith] (jquery.min.js:2:28487)
    at l (jquery.min.js:2:78789)
    at XMLHttpRequest.<anonymous> (jquery.min.js:2:81117)

Reading the code front/devices.php, probably the error occurs at line 700, one the getNumberOfChildren function:

function getNumberOfChildren(mac, devices)
{
  childrenCount = 0;

  $.each(devices, function(index, dev) {

    if(dev.dev_Network_Node_MAC_ADDR.trim() == mac.trim()) <- RIGHT HERE
    {
      childrenCount++;        
    }      

  });

  return childrenCount;
}

Also, on the console on my browser, it's printed three times an array of all the devices, the first device being:

{
    "rowid": 1,
    "dev_MAC": "Internet",
    "dev_Name": "Internet",
    "dev_Owner": "House",
    "dev_DeviceType": "Router",
    "dev_Vendor": "<REMOVED>",
    "dev_Favorite": 0,
    "dev_Group": "Always on",
    "dev_Comments": null,
    "dev_FirstConnection": "2021-01-01 00:00:00",
    "dev_LastConnection": "2021-01-01 00:00:00",
    "dev_LastIP": "<REMOVED>",
    "dev_StaticIP": 0,
    "dev_ScanCycle": 1,
    "dev_LogEvents": 1,
    "dev_AlertEvents": 1,
    "dev_AlertDeviceDown": 1,
    "dev_SkipRepeated": 0,
    "dev_LastNotification": "2024-02-16 12:40:19-03:00",
    "dev_PresentLastScan": 1,
    "dev_NewDevice": 0,
    "dev_Location": null,
    "dev_Archived": 0,
    "dev_Network_Node_MAC_ADDR": null,
    "dev_Network_Node_port": null,
    "dev_Icon": null
}

The property dev_Network_Node_MAC_ADDR is null, probably this is the device that is causing the error.


Update: renaming this device changed the dev_Network_Node_MAC_ADDR to "undefined" instead of null and solved my issue, now everything is fine.

@electro7
Copy link

Same here after pull new docker image. Device list is empty.
Also, the Settings page don't show any option, only section titles.

@Unr3aL
Copy link

Unr3aL commented Feb 16, 2024

Same here after pull new docker image. Device list is empty. Also, the Settings page don't show any option, only section titles.

Same here for me...

jokob-sk added a commit that referenced this issue Feb 16, 2024
@jokob-sk
Copy link
Owner

jokob-sk commented Feb 16, 2024

Thank you everyone for the report!

I'm building an updated image which should finish in about 15 minutes that I hope fixes this:

https://github.com/jokob-sk/Pi.Alert/actions/runs/7935983248 (v24.2.17)

@jokob-sk
Copy link
Owner

Update: The new image is deployed: https://hub.docker.com/r/jokobsk/pi.alert

@pax0707
Copy link

pax0707 commented Feb 16, 2024

Working now.

@jokob-sk
Copy link
Owner

Thanks for the confirmation @pax0707 !

@jokob-sk jokob-sk added the next release/in dev image🚀 This is coming in the next release or was already released if the issue is Closed. label Feb 16, 2024
@Unr3aL
Copy link

Unr3aL commented Feb 16, 2024

Not working for me, still no devices in device list, no access to any settings (all the sections are empty). Everything shows up in device presence and network tab though.
Also the columns customization tab under maintenance is empty which could be why there aren't any devices in the list but i don't want to save anything there in case it might be restorable because it was a pain to set it up like i want it. Let me know if you need any logs...

@iklo92
Copy link
Author

iklo92 commented Feb 16, 2024

It's works for me, thx

@jokob-sk
Copy link
Owner

@Unr3aL Try refreshing your browser cache / opening the page in a different browser. 99% of the configuration (except of a couple of settings under Maintenance) is saved in 2 files:

config/pialert.conf
config/devices.csv (read more)

or

db/pialert.db
db/pialert.conf

@Unr3aL
Copy link

Unr3aL commented Feb 16, 2024

God i am so embarrassed. I though I had already done that. Everything back to normal. Thanks alot!

@jokob-sk
Copy link
Owner

@Unr3aL - I'm embarrassed by the bug - so it's two of us lol 😅

@jokob-sk jokob-sk changed the title tab devices is empty [fixed in 24.2.17] tab devices is empty Feb 16, 2024
@jokob-sk
Copy link
Owner

released in 24.2.17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working next release/in dev image🚀 This is coming in the next release or was already released if the issue is Closed.
Projects
None yet
Development

No branches or pull requests

7 participants