Aiida Daemon timing out

Hello,

I am using Aiida to run some quantum espresso calculations.
Today I am running into an issue with the Aiida daemon which seems to be unresponsive. I had not encountered these issues previously with the same type of calculations.

I have tried to restart the daemon with verdi daemon restart and with verdi daemon stop, verdi daemon start. In all of these attempts I always get the error Critical: Connection to the daemon timed out. I get the same error when trying verdi daemon status.
Everything else seems to be running correctly :
`
:heavy_check_mark: version: AiiDA v2.6.3
:heavy_check_mark: config: /home/zoe/.aiida
:heavy_check_mark: profile: presto-1
:heavy_check_mark: storage: SqliteDosStorage[/home/zoe/.aiida/repository/sqlite_dos_3ca4aad38b0746e49b75a8466de4efb5]: open,
:heavy_check_mark: broker: RabbitMQ v3.12.1 @ amqp://guest:guest@127.0.0.1:5672?heartbeat=600
✘ daemon: Connection to the daemon timed out.

`

I have looked into the log file for the Aiida daemon and found the following error :

Task exception was never retrieved future: <Task finished name='Task-894' coro=<ensure_future.<locals>._wrap_awaitable() done, defined at /home/zoe/anaconda3/lib/python3.12/asyncio/tasks.py:683> exception=RuntimeError('Writer is None')> Traceback (most recent call last): File "/home/zoe/anaconda3/lib/python3.12/asyncio/tasks.py", line 314, in __step_run_and_handle_result result = coro.send(None) ^^^^^^^^^^^^^^^ File "/home/zoe/anaconda3/lib/python3.12/asyncio/tasks.py", line 684, in _wrap_awaitable return await awaitable ^^^^^^^^^^^^^^^ File "/home/zoe/anaconda3/lib/python3.12/site-packages/aiormq/tools.py", line 86, in __await__ return (yield from self().__await__()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/zoe/anaconda3/lib/python3.12/site-packages/aiormq/connection.py", line 138, in drain raise RuntimeError("Writer is %r" % self.writer) RuntimeError: Writer is None
What should I do to try to resolve this error with the daemon?

Many thanks for your help,

Hi, I’ll give you my two cents on what I would do in this case. My understanding is that circus, which is the process running indefinitely the daemon, somehow gets stuck. So, what I do in this case is to look in the $AIIDA_PATH/daemon/log/circus-*.log and look for the associated PID. In my case it looks like the following:

2025-01-09 09:59:04 circus[2253051] [INFO] aiida-bastonero stopped
2025-01-09 09:59:04 circus[2253051] [INFO] aiida-bastonero started
2025-01-09 10:17:02 circus[604419] [INFO] Starting master on pid 604419
2025-01-09 10:17:02 circus[604419] [INFO] Arbiter now waiting for commands
2025-01-09 10:17:02 circus[604419] [INFO] aiida-bastonero started
2025-01-09 10:17:02 circus[604419] [INFO] circusd-stats started
2025-01-09 10:17:03 circus[604428] [INFO] Starting the stats streamer

In my case, I would simply do in the terminal kill -9 604419. You can even find it by using ps -ef | grep circus, but it is better to double check in the log file. At this point, you can do verdi daemon start, and aiida will remove the stale daemon and start smoothly again.

Overall this procedure is close to switching off your computer without having stopped the daemon. This is in general safe, as aiida is designed to be robust in this scenario.

3 Likes

Thanks for the suggestion, I tried this and it solved my issues