UnboundLocalError: cannot access local variable 'playingGame' where it is not associated with a value #52

Closed
opened 2026-10-05 01:18:08 +02:00 by adam · 1 comment
Owner

Maybe a transient bug, and certainly didn't cause a crash or a problem but just wanted to report this traceback I saw while tailing the bot logs:

2025-02-26 20:05:44,185 | INFO | Device:1 Channel: 0 Received DM: bbslist From: KM4WQB - Mini 1
2025-02-26 20:05:44,185 | DEBUG | System: Bot detected Commands:[{'cmd': 'bbslist', 'index': 0}] From: KM4WQB - Mini 1
2025-02-26 20:05:45,386 | INFO | Device:1 Sending DM: Msg #1 Welcome to meshBBS Msg #2 LoRA Msg #3 a cool place... Msg #4 Started an infusion tonight To: KM4WQB - Mini 1
2025-02-26 20:07:04,335 | INFO | Device:1 Channel:0 Ignoring Message: Anyone play with NCMesh Bot? There's a bulletin board on it From: KM4WQB - Mini 1
2025-02-26 20:07:28,953 | WARNING | Device:1 Ignoring DM: Hello From: Cruso NC f882
2025-02-26 20:07:28,954 | INFO | Device:1 Sending DM: To start type: cmd - from here you interact back and forth with the bot with simple commands To: Cruso NC f882
2025-02-26 20:08:48,101 | WARNING | Device:1 Ignoring Request to Play Game: Connect From: Cruso NC f882 with hop count: 5 hops
2025-02-26 20:08:48,102 | INFO | Device:1 Sending DM: Your hop count exceeds safe playable distance at 5 hops To: Cruso NC f882

**ERROR:root:Unexpected error in deferred execution <class 'UnboundLocalError'>
Traceback (most recent call last):
File "/opt/meshing-around/venv/lib/python3.11/site-packages/meshtastic/util.py", line 309, in _run
o()
File "/opt/meshing-around/venv/lib/python3.11/site-packages/meshtastic/mesh_interface.py", line 1542, in
lambda: pub.sendMessage(topic, packet=asDict, interface=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/meshing-around/venv/lib/python3.11/site-packages/pubsub/core/publisher.py", line 216, in sendMessage
topicObj.publish(**msgData)
File "/opt/meshing-around/venv/lib/python3.11/site-packages/pubsub/core/topicobj.py", line 452, in publish
self.__sendMessage(msgData, topicObj, msgDataSubset)
File "/opt/meshing-around/venv/lib/python3.11/site-packages/pubsub/core/topicobj.py", line 482, in __sendMessage
listener(data, self, allData)
File "/opt/meshing-around/venv/lib/python3.11/site-packages/pubsub/core/listener.py", line 237, in call
cb(kwargs)
File "/opt/meshing-around/mesh_bot.py", line 1167, in onReceive
if not playingGame:
^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'playingGame' where it is not associated with a value

I'm running version 1.7.0 on a Raspberry Pi (Debian 12/Bookworm:

bot@bot-pi:/opt/meshing-around $ git describe --tags --always
v1.7.0
bot@bot-pi:/opt/meshing-around $ git log -1 --oneline
ff390cf (HEAD -> main, tag: v1.7.0, origin/main, origin/HEAD) fixLog

Maybe a transient bug, and certainly didn't cause a crash or a problem but just wanted to report this traceback I saw while tailing the bot logs: _2025-02-26 20:05:44,185 | INFO | Device:1 Channel: 0 Received DM: bbslist From: KM4WQB - Mini 1 2025-02-26 20:05:44,185 | DEBUG | System: Bot detected Commands:[{'cmd': 'bbslist', 'index': 0}] From: KM4WQB - Mini 1 2025-02-26 20:05:45,386 | INFO | Device:1 Sending DM: Msg #1 Welcome to meshBBS Msg #2 LoRA Msg #3 a cool place... Msg #4 Started an infusion tonight To: KM4WQB - Mini 1 2025-02-26 20:07:04,335 | INFO | Device:1 Channel:0 Ignoring Message: Anyone play with NCMesh Bot? There's a bulletin board on it From: KM4WQB - Mini 1 2025-02-26 20:07:28,953 | WARNING | Device:1 Ignoring DM: Hello From: Cruso NC f882 2025-02-26 20:07:28,954 | INFO | Device:1 Sending DM: To start type: cmd - from here you interact back and forth with the bot with simple commands To: Cruso NC f882 2025-02-26 20:08:48,101 | WARNING | Device:1 Ignoring Request to Play Game: Connect From: Cruso NC f882 with hop count: 5 hops 2025-02-26 20:08:48,102 | INFO | Device:1 Sending DM: Your hop count exceeds safe playable distance at 5 hops To: Cruso NC f882_ **ERROR:root:Unexpected error in deferred execution <class 'UnboundLocalError'> Traceback (most recent call last): File "/opt/meshing-around/venv/lib/python3.11/site-packages/meshtastic/util.py", line 309, in _run o() File "/opt/meshing-around/venv/lib/python3.11/site-packages/meshtastic/mesh_interface.py", line 1542, in <lambda> lambda: pub.sendMessage(topic, packet=asDict, interface=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/meshing-around/venv/lib/python3.11/site-packages/pubsub/core/publisher.py", line 216, in sendMessage topicObj.publish(**msgData) File "/opt/meshing-around/venv/lib/python3.11/site-packages/pubsub/core/topicobj.py", line 452, in publish self.__sendMessage(msgData, topicObj, msgDataSubset) File "/opt/meshing-around/venv/lib/python3.11/site-packages/pubsub/core/topicobj.py", line 482, in __sendMessage listener(data, self, allData) File "/opt/meshing-around/venv/lib/python3.11/site-packages/pubsub/core/listener.py", line 237, in __call__ cb(**kwargs) File "/opt/meshing-around/mesh_bot.py", line 1167, in onReceive if not playingGame: ^^^^^^^^^^^ UnboundLocalError: cannot access local variable 'playingGame' where it is not associated with a value** I'm running version 1.7.0 on a Raspberry Pi (Debian 12/Bookworm: bot@bot-pi:/opt/meshing-around $ git describe --tags --always v1.7.0 bot@bot-pi:/opt/meshing-around $ git log -1 --oneline ff390cf (HEAD -> main, tag: v1.7.0, origin/main, origin/HEAD) fixLog <!-- github-sync-id:2884533253 -->
adam closed this issue 2026-10-05 01:18:08 +02:00
Author
Owner

Thanks Should be resolved!

Thanks Should be resolved! <!-- github-comment-id:2698865728 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/meshing-around#52