Hello,
While running a workflow which calls sub-workflows (in particular PwBaseWorkChain), the calculation excepts due to a very weird behaviour (see error below).
Here the versions:
Python 3.9.18
aiida-core 2.4.2
aiida-hyperqueue 0.1.1
aiida-pseudo 1.4.0
aiida-quantumespresso 4.4.0
kiwipy 0.7.8
plumpy 0.21.10
RabbitMQ 3.7.28
Also looking at the workflow, something stranged happens for the PwBaseWorkChain, where to WorkChains have been called at the same time (?).
βββ PwBaseWorkChain<3345273> Excepted [2:while_(should_run_process)(1:run_process)]
βββ create_kpoints_from_distance<3345274> Finished [0]
βββ PwCalculation<3345278> Finished [410]
βββ PwCalculation<3345356> Waiting
βββ PwCalculation<3345369> Created
2023-12-08 17:00:53 [842570 | REPORT]: [3345273|PwBaseWorkChain|inspect_process]: PwCalculation<3345278> failed but a handler dealt with the problem, restarting
2023-12-08 17:00:53 [842571 | WARNING]: Process<3345273>: no connection available to broadcast state change from running to running
2023-12-08 17:00:53 [842572 | WARNING]: Process<3345273>: no connection available to broadcast state change from running to running
2023-12-08 17:00:53 [842573 | REPORT]: [3345273|PwBaseWorkChain|on_except]: Traceback (most recent call last):
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/plumpy/process_states.py", line 228, in execute
result = self.run_fn(*self.args, **self.kwargs)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aiida/engine/processes/workchains/workchain.py", line 314, in _do_step
finished, stepper_result = self._stepper.step()
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/plumpy/workchains.py", line 295, in step
finished, result = self._child_stepper.step()
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/plumpy/workchains.py", line 538, in step
finished, result = self._child_stepper.step()
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/plumpy/workchains.py", line 295, in step
finished, result = self._child_stepper.step()
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/plumpy/workchains.py", line 246, in step
return True, self._fn(self._workchain)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aiida/engine/processes/workchains/restart.py", line 197, in run_process
node = self.submit(self.process_class, **inputs)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aiida/engine/processes/process.py", line 544, in submit
return self.runner.submit(process, **kwargs)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aiida/engine/runners.py", line 183, in submit
process_inited = self.instantiate_process(process, **inputs)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aiida/engine/runners.py", line 169, in instantiate_process
return instantiate_process(self, process, **inputs)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aiida/engine/utils.py", line 64, in instantiate_process
process = process_class(runner=runner, inputs=inputs)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/plumpy/base/state_machine.py", line 195, in __call__
call_with_super_check(inst.init)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/plumpy/base/utils.py", line 31, in call_with_super_check
wrapped(*args, **kwargs)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aiida/engine/processes/process.py", line 188, in init
super().init()
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/plumpy/base/utils.py", line 16, in wrapper
wrapped(self, *args, **kwargs)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/plumpy/processes.py", line 309, in init
identifier = self._communicator.add_rpc_subscriber(self.message_receive, identifier=str(self.pid))
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/plumpy/communications.py", line 141, in add_rpc_subscriber
return self._communicator.add_rpc_subscriber(converted, identifier)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/kiwipy/rmq/threadcomms.py", line 215, in add_rpc_subscriber
return self._loop_scheduler.await_(
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/pytray/aiothreads.py", line 164, in await_
return self.await_submit(awaitable).result(timeout=self.task_timeout)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/concurrent/futures/_base.py", line 446, in result
return self.__get_result()
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
raise self._exception
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/asyncio/tasks.py", line 258, in __step
result = coro.throw(exc)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/pytray/aiothreads.py", line 178, in coro
res = await awaitable
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/kiwipy/rmq/communicator.py", line 483, in add_rpc_subscriber
identifier = await msg_subscriber.add_rpc_subscriber(subscriber, identifier)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/kiwipy/rmq/communicator.py", line 124, in add_rpc_subscriber
rpc_queue = await self._channel.declare_queue(exclusive=True, arguments=self._rmq_queue_arguments)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aio_pika/robust_channel.py", line 173, in declare_queue
queue = await super().declare_queue(
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aio_pika/channel.py", line 325, in declare_queue
await queue.declare(timeout=timeout)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aio_pika/queue.py", line 92, in declare
self.declaration_result = await asyncio.wait_for(
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/asyncio/tasks.py", line 442, in wait_for
return await fut
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aiormq/channel.py", line 703, in queue_declare
return await self.rpc(
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aiormq/base.py", line 168, in wrap
return await self.create_task(func(self, *args, **kwargs))
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aiormq/base.py", line 25, in __inner
return await self.task
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/asyncio/futures.py", line 284, in __await__
yield self # This tells Task to wait for completion.
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/asyncio/tasks.py", line 328, in __wakeup
future.result()
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/asyncio/futures.py", line 201, in result
raise self._exception
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/asyncio/tasks.py", line 256, in __step
result = coro.send(None)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aiormq/channel.py", line 121, in rpc
raise ChannelInvalidStateError("writer is None")
aiormq.exceptions.ChannelInvalidStateError: writer is None
2023-12-08 17:00:53 [842574 | WARNING]: Process<3345273>: no connection available to broadcast state change from running to excepted
2023-12-08 17:00:53 [842575 | ERROR]: Traceback (most recent call last):
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/plumpy/processes.py", line 888, in on_close
cleanup()
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/plumpy/communications.py", line 144, in remove_rpc_subscriber
return self._communicator.remove_rpc_subscriber(identifier)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/kiwipy/rmq/threadcomms.py", line 221, in remove_rpc_subscriber
return self._loop_scheduler.await_(self._communicator.remove_rpc_subscriber(identifier))
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/pytray/aiothreads.py", line 164, in await_
return self.await_submit(awaitable).result(timeout=self.task_timeout)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/concurrent/futures/_base.py", line 446, in result
return self.__get_result()
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
raise self._exception
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/asyncio/tasks.py", line 258, in __step
result = coro.throw(exc)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/pytray/aiothreads.py", line 178, in coro
res = await awaitable
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/kiwipy/rmq/communicator.py", line 488, in remove_rpc_subscriber
await msg_subscriber.remove_rpc_subscriber(identifier)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/kiwipy/rmq/communicator.py", line 141, in remove_rpc_subscriber
await rpc_queue.cancel(identifier)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aio_pika/robust_queue.py", line 140, in cancel
result = await super().cancel(consumer_tag, timeout, nowait)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aio_pika/queue.py", line 264, in cancel
return await asyncio.wait_for(
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/asyncio/tasks.py", line 442, in wait_for
return await fut
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aiormq/channel.py", line 395, in basic_cancel
return await self.rpc(
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aiormq/base.py", line 168, in wrap
return await self.create_task(func(self, *args, **kwargs))
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aiormq/base.py", line 25, in __inner
return await self.task
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/asyncio/futures.py", line 284, in __await__
yield self # This tells Task to wait for completion.
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/asyncio/tasks.py", line 328, in __wakeup
future.result()
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/asyncio/futures.py", line 201, in result
raise self._exception
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/asyncio/tasks.py", line 256, in __step
result = coro.send(None)
File "/home/bastonero/.conda/envs/aiida/lib/python3.9/site-packages/aiormq/channel.py", line 121, in rpc
raise ChannelInvalidStateError("writer is None")
aiormq.exceptions.ChannelInvalidStateError: writer is None