canopy-network/canopy · error · PluginError

{query_response.error.msg}

Error message

{query_response.error.msg}

What it means

Raised in query_state when the FSM's query response carries an error field; the FSM-side error message is re-raised locally. It means the state query at the requested height failed on the FSM (e.g. state not found, height not available, or internal FSM error), not that the transport failed.

Source

Thrown at plugin/python/contract/plugin.py:289

        message = PluginToFSM()
        message.id = request_id
        message.query.height = height
        message.query.read.CopyFrom(request)

        try:
            logger.debug(f"0x{request_id:x}: query_state (height={height})")
            await self._send_proto_msg(message)

            # wait for response with timeout
            response = await asyncio.wait_for(future, timeout=10.0)

            if not response.HasField("query"):
                raise err_unexpected_fsm_to_plugin(type(response))

            query_response = response.query
            # surface any FSM-side error attached to the query response
            if query_response.HasField("error"):
                raise PluginError(
                    query_response.error.code,
                    query_response.error.module,
                    query_response.error.msg,
                )
            # return the unwrapped read response
            return query_response.read

        except asyncio.TimeoutError:
            raise err_plugin_timeout()
        finally:
            self._pending.pop(request_id, None)

    async def _listen_for_inbound(self) -> None:
        """ListenForInbound routes inbound requests from the plugin."""
        if not self._reader:
            raise PluginError(1, "plugin", "No reader available")

        try:

View on GitHub (pinned to ee8197d91d)

Solutions

  1. Read the embedded error message to determine the FSM-side cause and fix the query (height, key range) accordingly.
  2. Retry the query if the error indicates a transient condition (e.g. node catching up to the requested height).
  3. Verify the queried state actually exists for the contract before issuing the query.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at plugin/python/contract/plugin.py:289 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of canopy-network/canopy@ee8197d91d (2026-09-06). Data as JSON: /api/errors/2b723a29b659f0a8. Report an issue: GitHub.