Skip to content

Fix serve registration crash on 0.7.61: node_hmac_key is a property, not a method#11

Open
shaal wants to merge 1 commit into
RobLe3:mainfrom
shaal:fix/node-hmac-key-property-call
Open

Fix serve registration crash on 0.7.61: node_hmac_key is a property, not a method#11
shaal wants to merge 1 commit into
RobLe3:mainfrom
shaal:fix/node-hmac-key-property-call

Conversation

@shaal

@shaal shaal commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Fixes #10.

cli.py:1232 (the #456 / TC-9c token/HMAC cache block) calls
node.node_hmac_key(), but node_hmac_key is a @property (node.py:674)
that returns a str. Invoking it raises TypeError: 'str' object is not callable.

Because that call sits inside the registration try/except, the error is
caught and logged as Registration attempt failed; all 3 retries hit the same
deterministic error, and the node never reaches a registered client state. Its
heartbeats then stop refreshing the directory and it is marked offline
(available:false, health:0) within ~30s — even though the process is still
running and the HTTP registration succeeded server-side (token returned,
operator delegation accepted). 0.7.48 is unaffected.

Fix

Read the property instead of calling it:

-                        hmac_key = node.node_hmac_key()
+                        hmac_key = node.node_hmac_key

Test

pipx install --force 'iicp-client[nat]==0.7.61'   # repro: serve logs the crash, node goes offline
# with this patch applied, serve registers cleanly and the node stays available

Follow-up (not in this PR)

This cache step is described in-code as "best-effort", but it runs inside the
registration try/except, so any error here aborts an otherwise-successful
registration. Wrapping just the cache step in its own try/except Exception: pass would make a future caching bug non-fatal to registration.

cli.py:1232 called node.node_hmac_key() but node_hmac_key is a @Property
(node.py:674), so it raised "TypeError: 'str' object is not callable". That
exception is caught by the registration try/except and logged as
"Registration attempt failed"; all 3 retries hit the same deterministic error
and the node never reaches a registered client state, so heartbeats stop
landing and the directory marks it offline (available:false, health:0) within
~30s even though the process is still running and the HTTP register succeeded
server-side.

Drop the call parens so the property value is read instead of invoked.

Fixes RobLe3#10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

serve registration crashes on 0.7.61 ('str' object is not callable) → node goes offline; cli.py:1232 calls node_hmac_key property as a method

1 participant