dg9vh / MMDVMHost-Websocketboard

Websocket based MMDVM dashboard
MIT License
22 stars 11 forks source link

logtailer IndexError: list index out of range #36

Closed yo8aiv closed 11 months ago

yo8aiv commented 1 year ago

Hi,
i get this error when i;m trying to start the logtailer

python3 ./logtailer.py 2023-06-15 13:06:21,256 INFO Loading DMR_IDs from file Traceback (most recent call last): File "/opt/MMDVMHost-Websocketboard/./logtailer.py", line 427, in main() File "/opt/MMDVMHost-Websocketboard/./logtailer.py", line 417, in main load_callsign_database() File "/opt/MMDVMHost-Websocketboard/./logtailer.py", line 406, in load_callsign_database dmrids[tokens[0]] = tokens[1] + "$" + tokens[2].replace("\r", "").replace("\n", "") + "$" IndexError: list index out of range

Python 3.10.6

pip show websocket-client Name: websocket-client Version: 1.2.3 Summary: WebSocket client for Python with low level API options Home-page: https://github.com/websocket-client/websocket-client.git Author: liris Author-email: liris.pp@gmail.com License: Apache-2.0 Location: /usr/lib/python3/dist-packages Requires: Required-by:

How should i proceed. ?? Thanks in advance.

dg9vh commented 1 year ago

What script do you use for fetching the callsign-list? It is recommended to use this one: https://github.com/dg9vh/MMDVMHost-Websocketboard/blob/main/scripts/DMRIDUpdate.sh

yo8aiv commented 1 year ago

thx for the fast answer. i use the same script.

dg9vh commented 1 year ago

Could you please add some first lines of the resulting callsign-file fetched via this script you are using?

73 de Kim DG9VH

-- Amateurfunk ist das, was uns verbindet! Bleiben wir in Kontakt! DARC e.V., Ortsverband Q03, Neunkirchen

yo8aiv commented 1 year ago

here .. from file DMRIds.dat situated in etc/MMDVM

1023001 VE3THW Wayne 1023002 VA3ECM Mathieu 1023003 VE3QC Guy 1023007 VA3BOC Hans 1023008 VE3JMR Mark 1023009 VA3AMO Rolando 1023010 VA3AMO Rolando 1023014 VA3DB Diane 1023016 VE3IAO John 1023017 VA3MSV John 1023018 VA3BTQ Jacqualine 1023019 VA3BTQ Jacqualine

yo8aiv commented 1 year ago

in addition to that i have discovered in browser console some websockets errors :

31656,,DMR,2,31555,Wisconsin-DMR 31555,,DMR,2,31010,Alabama Link 31010,,DMR,2,31261,YARC-WX 31261,,DMR,2,31480, Canton Area Radio Emerg. Serv 31480,,DMR,2,31059,Arkansas YSF Reflector 31059,,DMR,2,31290,NA Talk Box 31290,,DMR,2,31299,Kansas City Wide 31299,,DMR,2,748,Uruguay 748,,DMR,2,7487,Uruguay Link 7487,,DMR,2,74800,EMERGENCY 74800,,DMR,2,74801,Montevideo 74801,,DMR,2,74802,Montevideo 74802,,DMR,2,74 (index):438

   WebSocket connection to 'ws://192.168.2.197:5679/SYSINFO' failed: 

(anonymous) @ (index):438 (index):444

   WebSocket connection to 'ws://192.168.2.197:5679/MMDVM' failed: 

(anonymous) @ (index):444 (index):481

   WebSocket connection to 'ws://192.168.2.197:5679/SERVICES' failed: 

(anonymous) @ (index):481

dg9vh commented 1 year ago

5679 is not the standard-port configured for the logtailer.py in logtailer.ini - so if you modified the html-code, you also have to modifiy the configuration also.

dg9vh commented 1 year ago

The DMRIDs.dat delivered is correct. Could you post your logtailer.ini file please with infos where the DMRIDs.dat is stored in your system?

yo8aiv commented 1 year ago

Ok. here it is. found in /opt/MMDVMHost/DMRIds.dat also another ... dmrids file wich seems the right one. according to *.ini file also in this file outputs is as previous posted.

logtailer.ini.txt

dg9vh commented 1 year ago

Ok, now take a look at /opt/MMDVMHost/MMDVM.ini and show me the line where the DMRIDs.dat should resist.. maybe there lies the problem.

yo8aiv commented 1 year ago

ya i think you are right , seems he's looking in the wrong place.

[DMR Id Lookup] File=/opt/data-files/DMRIds.dat Time=8640

... but wait in opt/data-files/ there's also DMRIds.dat wich has the correct format also

dg9vh commented 1 year ago

So just modify your DMRID-Update-script AND the logtailer.ini to this location and I think your problem disappears!

yo8aiv commented 1 year ago

done that still have the same error .

sudo python3 ./logtailer.py 2023-06-16 13:50:08,503 INFO Loading DMR_IDs from file Traceback (most recent call last): File "/opt/MMDVMHost-Websocketboard/./logtailer.py", line 427, in main() File "/opt/MMDVMHost-Websocketboard/./logtailer.py", line 417, in main load_callsign_database() File "/opt/MMDVMHost-Websocketboard/./logtailer.py", line 406, in load_callsign_database dmrids[tokens[0]] = tokens[1] + "$" + tokens[2].replace("\r", "").replace("\n", "") + "$" IndexError: list index out of range

do you have an idea how i could troubleshoot websockets ?! .. i think they aren't running since ai get failed to load :+1:

(index):438

   WebSocket connection to 'ws://192.168.2.197:5679/SYSINFO' failed: 

(anonymous) @ (index):438 (index):444

   WebSocket connection to 'ws://192.168.2.197:5679/MMDVM' failed: 

(anonymous) @ (index):444 (index):481

   WebSocket connection to 'ws://192.168.2.197:5679/SERVICES' failed: 

(anonymous) @ (index):481

Thanks. for the help btw.

dg9vh commented 1 year ago

If setting DMR_ID_Lookup=0 you can disable lookup and the logtailer would start without reading the callsign-database. So you can test the rest but have no callsign resolved.

yo8aiv commented 1 year ago

thanks. did that : python3 ./logtailer.py 2023-06-16 14:50:20,548 INFO Starting Websocketserver /opt/MMDVMHost-Websocketboard/./logtailer.py:384: DeprecationWarning: There is no current event loop asyncio.get_event_loop().run_until_complete(start_server) Traceback (most recent call last): File "/opt/MMDVMHost-Websocketboard/./logtailer.py", line 427, in main() File "/opt/MMDVMHost-Websocketboard/./logtailer.py", line 423, in main websocketserver() File "/opt/MMDVMHost-Websocketboard/./logtailer.py", line 384, in websocketserver asyncio.get_event_loop().run_until_complete(start_server) File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete return future.result() File "/usr/lib/python3.10/asyncio/tasks.py", line 650, in _wrap_awaitable return (yield from awaitable.await()) File "/usr/lib/python3/dist-packages/websockets/legacy/server.py", line 1071, in __await_impl__ server = await self._create_server() File "/usr/lib/python3.10/asyncio/base_events.py", line 1505, in create_server raise OSError(err.errno, 'error while attempting ' OSError: [Errno 98] error while attempting to bind on address ('0.0.0.0', 5679): address already in use

dg9vh commented 1 year ago

This is because there is already something using port 5679 on your system.

==> OSError: [Errno 98] error while attempting to bind on address ('0.0.0.0', 5679): address already in use

yo8aiv commented 1 year ago

netstat -tulpn | grep 5679 tcp 0 0 0.0.0.0:5679 0.0.0.0:* LISTEN 5116/python3

dg9vh commented 1 year ago

Maybe it is a logtailer already running by systemd. You could reboot your system to try out.

yo8aiv commented 1 year ago

already reboot 3 times

dg9vh commented 1 year ago

Sorry, I can't say what process is running and using port 5679 on your system... why don't you use default port 5678 on logtailer and the html-file as it was in the repository?

yo8aiv commented 1 year ago

i identified PID and killed the process .. after netstat -tulpn | grep 5679 tcp 0 0 0.0.0.0:5679 0.0.0.0:* LISTEN 5606/python3

after started python3 ./logtailer.py 2023-06-16 15:07:05,278 INFO Starting Websocketserver /opt/MMDVMHost-Websocketboard/./logtailer.py:384: DeprecationWarning: There is no current event loop asyncio.get_event_loop().run_until_complete(start_server) /opt/MMDVMHost-Websocketboard/./logtailer.py:385: DeprecationWarning: There is no current event loop asyncio.get_event_loop().run_forever()

and it hangs like this ..

dg9vh commented 1 year ago

ok, this is a kind of DeprecationWarning but not an error - so you should try to call the website of the dashboard and take a look at the console what is happening then.

yo8aiv commented 1 year ago

ok .. i found it running as a service under sudo systemctl status logtailer-mmdvmh.service ● logtailer-mmdvmh.service - Python3 logtailer for MMDVMDash Loaded: loaded (/lib/systemd/system/logtailer-mmdvmh.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2023-06-16 15:12:29 EST; 10min ago Process: 5887 ExecStartPre=/bin/sleep 5 (code=exited, status=0/SUCCESS) Main PID: 5888 (python3) Tasks: 1 (limit: 4495) Memory: 9.3M CPU: 1.062s CGroup: /system.slice/logtailer-mmdvmh.service └─5888 /usr/bin/python3 /opt/MMDVMHost-Websocketboard/logtailer.py

giving the same errors : INFO Starting Websocketserver /opt/MMDVMHost-Websocketboard/./logtailer.py:384: DeprecationWarning: There is no current event loop asyncio.get_event_loop().run_until_complete(start_server) /opt/MMDVMHost-Websocketboard/./logtailer.py:385: DeprecationWarning: There is no current event loop asyncio.get_event_loop().run_forever()

dg9vh commented 1 year ago

So what happens now if you call the website in a browser?

yo8aiv commented 1 year ago

on the console its parsing TG's and stuff .. but the webscokets fails still present

"Parsed TGs: DMR,2,91,Worldwide 91,,DMR,2,937,French Language FRANCOPHONIE 937,,DMR,2,973,SOTA 973,,DMR,2,907,JOTA JOTI YOTA 907,,DMR,2,9071,Tac 1 JOTA YOTA 9071,,DMR,2,9072,Tac 2 JOTA YOTA 9072,,DMR,2,9073,Tac 3 JOTA YOTA 9073,,DMR,2,9074,Tac 4 JOTA YOTA 9074,,DMR,2,9075,Tac 5 JOTA YOTA 9075,,DMR,2,9076,Tac 6 JOTA YOTA 9076,,DMR,2,9077,Tac 7 JOTA YOTA 9077,,DMR,2,9078,Tac 8 JOTA YOTA 9078,,DMR,2,969,Worldwide PRIDE (Allstar 56108) 969,,DMR,2,98002,Hamfurs 98002,,DMR,2,16777215,All Call 16777215,,DMR,2,970,POTA 970,,DMR,2,9517,M17-M17 Module C 9517,,DMR,2,452,Vietnam 452,,DMR,2,734,MCC VENEZUELA - YSF 86374 734,,DMR,2,7341,(YV1) Zona 1 7341,,DMR,2,73411,Red Vzlana de Rad.Afic.YV5RVR 73411,,DMR,2,7342,(YV2) Zona 2 7342,,DMR,2,7343,(YV3) Zona 3 7343,,DMR,2,7344,(YV4) Zona 4 7344,,DMR,2,7345,(YV5) Zona 5 7345,,DMR,2,7346,(YV6) Zona 6 7346,,DMR,2,7347,(YV7) Zona 7 7347,,DMR,2,7348,(YV8) Zona 8 7348,,DMR,2,7349,(YV9) Zona 9 7349,,DMR,2,734911,EMCOMM YV 734911,,DMR,2,734400,SAR Venezuela 734400,,DMR,2,73440,Net Dig. Venezuela - TG 73440 TGIF 73440,,DMR,2,541,Vanuatu 541,,DMR,2,434,Uzbekistan 434,,DMR,2,3100,USA Nationwide 3100,,DMR,2,31001,N. A. TAC 1 31001,,DMR,2,31002,N. A. TAC 2 31002,,DMR,2,31003,N. A. TAC 3 31003,,DMR,2,31004,N. A. TAC 4 31004,,DMR,2,31005,N. A. TAC 5 31005,,DMR,2,31006,N. A. TAC 6 31006,,DMR,2,31007,N. A. TAC 7 31007,,DMR,2,31008,N. A. TAC 8 31008,,DMR,2,31009,N. A. TAC 9 31009,,DMR,2,3101,Alabama 3101,,DMR,2,310188,KC2ABV REPEATER SYSTEM 310188,,DMR,2,3102,Alaska 3102,,DMR,2,3104,Arizona 3104,,DMR,2,3105,Arkansas 3105,,DMR,2,3106,California 3106,,DMR,2,31060,California Link 31060,,DMR,2,31061,CA TAC 31061,,DMR,2,31068,NorCal 31068,,DMR,2,3108,Colorado 3108,,DMR,2,3109,Connecticut 3109,,DMR,2,3110,Delaware 3110,,DMR,2,3111,District of Columbia 3111,,DMR,2,3112,Florida 3112,,DMR,2,3113,Georgia 3113,,DMR,2,3115,Hawai 3115,,DMR,2,3116,Idaho 3116,,DMR,2,3117,Illinois 3117,,DMR,2,3118,Indiana 3118,,DMR,2,3119,Iowa 3119,,DMR,2,3120,Kansas 3120,,DMR,2,3121,Kentucky 3121,,DMR,2,3122,Louisiana 3122,,DMR,2,3123,Maine 3123,,DMR,2,3124,Maryland 3124,,DMR,2,3125,Massachusetts 3125,,DMR,2,3126,Michigan 3126,,DMR,2,31260,ZOMBIE Alert USA / XLX240B 31260,,DMR,2,3127,Minnesota 3127,,DMR,2,3128,Mississippi 3128,,DMR,2,3129,Missouri 3129,,DMR,2,3130,Montana 3130,,DMR,2,3131,Nebraska 3131,,DMR,2,3132,Nevada 3132,,DMR,2,3133,New Hampshire 3133,,DMR,2,3134,New Jersey 3134,,DMR,2,3135,New Mexico 3135,,DMR,2,3136,New York 3136,,DMR,2,3137,North Carolina 3137,,DMR,2,31373,East NC 31373,,DMR,2,31377,OBX 31377,,DMR,2,31379,NC TAC 31379,,DMR,2,3138,North Dakota 3138,,DMR,2,3139,Ohio 3139,,DMR,2,3140,Oklahoma 3140,,DMR,2,3141,Oregon 3141,,DMR,2,3142,Pennsylvania 3142,,DMR,2,3143,Puerto Rico 3143,,DMR,2,3144,Rhode Island 3144,,DMR,2,3145,South Carolina 3145,,DMR,2,3146,South Dakota 3146,,DMR,2,3147,Tennessee 3147,,DMR,2,3148,Texas 3148,,DMR,2,3149,Utah 3149,,DMR,2,3150,Vermont 3150,,DMR,2,3151,Virginia 3151,,DMR,2,3152,Virgin Islands 3152,,DMR,2,3153,Washington 3153,,DMR,2,3154,West Virginia 3154,,DMR,2,3155,Wisconsin 3155,,DMR,2,3156,Wyoming 3156,,DMR,2,3160,Crossroads-USA Reflector 3160,,DMR,2,31601,NC4ES Chat 1 31601,,DMR,2,31602,NC4ES Chat 2 31602,,DMR,2,31603,NC4ES AUXCOMM 31603,,DMR,2,31604,NC4ES RF Link 31604,,DMR,2,31605,NC4ES EHPC 31605,,DMR,2,31611,XPR Network 31611,,DMR,2,3162,La Isla 3162,,DMR,2,3165,USA SOUTHEAST 3165,,DMR,2,316501,Worldwide Network 316501,,DMR,2,3166,DVSwitch 3166,,DMR,2,316601,YSF16512 US-WA-PNW 316601,,DMR,2,310001,ECHO EAST 310001,,DMR,2,31120,Florida Keys 31120,,DMR,2,31378,Piedmont Triad 31378,,DMR,2,310441,WNY-DIGITAL.network (PRI) 310441,,DMR,2,31360,NY-NJ-PA TriState 31360,,DMR,2,31361,Upstate-NY 31361,,DMR,2,31362,NY-Metro 31362,,DMR,2,31376,Southern Tier NY 31376,,DMR,2,31369,Monroe County 31369,,DMR,2,31341,South Jersey 31341,,DMR,2,31342,North Jersey 31342,,DMR,2,310040,WNY-DIGITAL.network (TAC2) 310040,,DMR,2,310096,WNY-DIGITAL.network (TAC3) 310096,,DMR,2,310393,WNY-DIGITAL.network (TAC4) 310393,,DMR,2,310784,WNY-DIGITAL.network (TAC5) 310784,,DMR,2,311090,WNY-DIGITAL.network (TAC6) 311090,,DMR,2,311419,WNY-DIGITAL.network (TAC7) 311419,,DMR,2,311421,WNY-DIGITAL.network (TAC8) 311421,,DMR,2,312079,WNY-DIGITAL.network (EMCOMM) 312079,,DMR,2,310014,San Diego 310014,,DMR,2,31177,WESDIG Western US Digital Group 31177,,DMR,2,31069,Bay Area Digital - California 31069,,DMR,2,31138,Georgia Digital 31138,,DMR,2,31050,ArkansasTAC 31050,,DMR,2,31058,NW_Arkansas 31058,,DMR,2,31479,Fayetteville AR 31479,,DMR,2,31501,Little Rock Metro 31501,,DMR,2,31656,America Link 31656,,DMR,2,31555,Wisconsin-DMR 31555,,DMR,2,31010,Alabama Link 31010,,DMR,2,31261,YARC-WX 31261,,DMR,2,31480, Canton Area Radio Emerg. Serv 31480,,DMR,2,31059,Arkansas YSF Reflector 31059,,DMR,2,31290,NA Talk Box 31290,,DMR,2,31299,Kansas City Wide 31299,,DMR,2,748,Uruguay 748,,DMR,2,7487,Uruguay Link 7487,,DMR,2,74800,EMERGENCY 74800,,DMR,2,74801,Montevideo 74801,,DMR,2,74802,Montevideo 74802,,DMR,2,74 (index):438

   WebSocket connection to 'ws://192.168.2.197:5679/SYSINFO' failed: 

(anonymous) @ (index):438 (index):444

   WebSocket connection to 'ws://192.168.2.197:5679/MMDVM' failed: 

(anonymous) @ (index):444 (index):481

   WebSocket connection to 'ws://192.168.2.197:5679/SERVICES' failed: 

(anonymous) @ (index):481

dg9vh commented 1 year ago

What Linux you are using on your system? This would be interresting to get an idea where the problem could be. Also what version of Python is running on this system?

yo8aiv commented 1 year ago

cat /etc/os-release PRETTY_NAME="Armbian 23.02.2 Jammy" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.2 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy

Python 3.10.6

pip show websocket-client Name: websocket-client Version: 1.2.3 Summary: WebSocket client for Python with low level API options Home-page: https://github.com/websocket-client/websocket-client.git Author: liris Author-email: liris.pp@gmail.com License: Apache-2.0 Location: /usr/lib/python3/dist-packages Requires: Required-by:

yo8aiv commented 1 year ago

i can't thank you enough for your help.

i've tryied with latest armbian =>> bookworm Armbian_23.8.0-trunk.53_Orangepiplus_bookworm_edge6.2.16 and i get similar results ..

same on pure debian bookworm ...

dg9vh commented 1 year ago

Well, I have no real idea what's the cause but I think my code is just to old for your top actual systems there. I developed the dashboard on a raspbian buster system at least with Python 3.9.

So I think it's just no longer compatible with new actual variants of OSes and environments.

Sadly I changed my focus in amateur radio to other things so I am not empowered to search for solutions because I still have no development system here for this.

Maybe out there somebody with skills will take this part and file a pull-request solving the problems?

Sadly I will not be the one that's doing that :-(

yo8aiv commented 1 year ago

i understand and i appreciate your help. Thanks. i dont have any top stuff .. its just a few old Opi's and armbian. :) .. actually in a few weeks i learned quite a lot .. knew a bit of linux from before but now i'm challanged in looking for sollutions. i had to extract bootloader from an old os to make this current one even boot.
i have am Opi Zero coming .. so i'll try with that also . .. thing is .. everything works in the backend .. its just the frontend isnt showing .. no dashboards. but mmdvm works .. dvswitch, and so on. so the rest must be a matter of finding the glitches.

Thanks for your contribution and the great software and goodluck.

dg9vh commented 1 year ago

No problem but I actually have no hardware for setting up a system to debug and so on, so I am very sad to let you alone with this but I have no other solution... sorry...

Maybe someone else has an idea and a modification to pull it into the repository here...

yo8aiv commented 1 year ago

did you set up a some links to receive some donations ? .. maibe we can move forward .. i'm shure isn't only me taking the learning curve, most ppl prefer the easy way by buying a raspberry and be done with it.

dg9vh commented 1 year ago

You can use the link in the footer of https://register.ysfreflector.de/ - you will be welcome :-)