Saillogger reporting issue with ais name in logs
-
Saillogger was logging errors on ship names, probably because someone has a misconfigured AIS. When the error was encountered, it would not send any AIS data. Here is the log snippet:
Sep 13 21:36:27 2026-09-13T21:36:27.751Z signalk-saillogger Updating AIS vessel 367302540 details Sep 13 21:36:27 Uncaught exception: TypeError: Cannot read properties of undefined (reading 'name') at refreshAisData (/home/node/.signalk/node_modules/signalk-saillogger/index.js:448:55) at sendAisTargets (/home/node/.signalk/node_modules/signalk-saillogger/index.js:676:5) at Timeout._onTimeout (/home/node/.signalk/node_modules/signalk-saillogger/index.js:199:7) at listOnTimeout (node:internal/timers:685:17) at processTimers (node:internal/timers:618:7) Sep 13 21:36:27 TypeError: Cannot read properties of undefined (reading 'name') at refreshAisData (/home/node/.signalk/node_modules/signalk-saillogger/index.js:448:55) at sendAisTargets (/home/node/.signalk/node_modules/signalk-saillogger/index.js:676:5) at Timeout._onTimeout (/home/node/.signalk/node_modules/signalk-saillogger/index.js:199:7) at listOnTimeout (node:internal/timers:685:17) at processTimers (node:internal/timers:618:7)I fixed the issue (I think) with this code snippet:
cd ~/.signalk/node_modules/signalk-saillogger cp index.js index.js.bak sed -i "s/aisShipType?\.value\.name/aisShipType?.value?.name/; s/aisShipType?\.value\.id/aisShipType?.value?.id/" index.js grep -n "aisShipType" index.js 'It would be nice if this were merged into the source so my fix persists, or tell me I've done something terrible?
-
Thanks @jimholthaus , good catch and good fix! We just published a v5.3.2 of the plugin that fixes this.
Thanks for the report.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login