cello icon indicating copy to clipboard operation
cello copied to clipboard

There is a logical loophole that can lead to a deadlock

Open dodo920306 opened this issue 6 months ago • 0 comments

Expected Behavior

I'm here to figure out what is truly wanted.

Current Behavior

Let’s assume an organization admin creates an agent, then based on that agent, creates an orderer and a network.

Later, the admin finds out that the agent’s URL is incorrect and they are unable to create a channel because of it. They try to update the agent URL but find that it's not editable.

Then they try to delete the agent, but it fails because the agent is still in use by the orderer.

They try to delete the orderer, but that fails too because the orderer is still in use by the network.

They delete the network successfully.

However, when they try to delete the orderer again, it gets stuck because the referenced network no longer exists.

Now the user is stuck — they can’t delete or update the agent, and the orderer is stuck in a broken state. Since only one agent can be associated with an organization, the entire organization becomes unusable.

Possible Solution

Thus, I suggest the user should be able to either update the agent URL or delete all associated components in order to remove or replace the agent.

Steps to Reproduce

  1. Create an agent with an unreachable URL for an organization.
  2. Create an orderer and a network using that agent.
  3. Try to update the agent URL → cannot update.
  4. Try to delete the agent → fails due to being used by orderer.
  5. Try to delete the orderer → fails due to being used by network.
  6. Delete the network successfully.
  7. Try to delete the orderer again → Network Not Found.
  8. Now unable to delete or update agent.

Context (Environment)

  • OS: Ubuntu 25.04
  • Architecture: amd64
  • Docker version: 28.2.2
  • Docker compose version: 2.36.2

Detailed Description and log

WARNING Bad Request: /api/v1/nodes/5e3bae8d-b745-472d-9760-d0e0cceea230
ERROR Failed To Get Node Params
Traceback (most recent call last):
  File "/var/www/server/api/routes/node/views.py", line 469, in _agent_params
    raise ResourceNotFound("Network Not Found")
api.exceptions.ResourceNotFound: Network Not Found

Possible Implementation

dodo920306 avatar Jun 14 '25 12:06 dodo920306