Common Errors & Sanity Checks - ramirezfranciscof/aiida-core GitHub Wiki
Getting info about process failing
First of all try submit instead of run. Then, check the log of the daemon using verdi process report [PK].
Getting the location of the current aiida program in the virtual env
Load a verdi whell and do:
import aiida; aiida.__file__
Also this might be relevant: https://docs.python-guide.org/dev/virtualenvs/
When creating a new plugin
You need to first add it to a/the setup.json, then re-install and run reentry scan (on the correct env) and restart the daemon.
Configuration file contains invalid JSON
Critical: configuration file /home/framirez/.aiida/config.json contains invalid JSON
Problem and Solution: There was a problem with the config.json, no idea how it got there, but to look for it we opened an ipython terminal ($ ipython), imported the json module (In [1]: import json) and tried opening the file (first In [2]: handle = open('/home/framirez/.aiida/config.json', 'r'), then In [3]: json.load(handle)). It mentioned the location of the error.
Problems with rabbitmq
pika.exceptions.ConnectionClosedByBroker: (541, 'INTERNAL_ERROR')
Check the status of rabbitmq using verdi status. If it has an unidentified problem, maybe try restarting the service (sudo service rabbitmq-server restart in ubuntu, brew services restart rabbitmq with brew on mac)
Limit on number of open files
If this happens try running ulimit to show the limit, and this can be changed running ulimit -n 65535 (check source).
Check that you have the right pip environment
Re install your packages to make sure the environment is indeed correct (you can check versions with pip freeze).
Run the re-entry scan
(aiida-env)$ reentry scan
Restart the daemon
The method prepare_for_submission is only called once the daemon picks it up, so anything that is printed there will only show up in the daemon log. Therefore make sure to restart the daemon each time you apply a change to the code. If not, you will see the old code in the daemon log, because that is the code the daemon will be running.
(aiida-env)$ verdi daemon restart --reset
(aiida-env)$ verdi daemon stop
(aiida-env)$ verdi daemon
Check the AiiDA FAQ
https://aiida-core.readthedocs.io/en/latest/howto/faq.html
User permission
Problem that comes out when trying to run some of the tests...
# in PSQL
ALTER USER username CREATEDB;
Check Daemon interferences
$ ps aux | grep circus
framirez 9149 0.0 0.0 14764 1040 pts/0 S+ 14:45 0:00 grep --color=auto circus
framirez 30765 0.0 0.1 937664 85488 ? Sl 12:17 0:07 /home/framirez/.virtualenvs/aiida-main/bin/python3.9 /home/framirez/.virtualenvs/aiida-main/bin/verdi -p charge_density daemon start-circus 1
framirez 30770 1.2 0.0 244848 37116 ? Ssl 12:17 1:54 /home/framirez/.virtualenvs/aiida-main/bin/python3.9 -c from circus import stats; stats.main() --endpoint ipc:///tmp/tmpmbok9wvn/circus.c.sock --pubsub ipc:///tmp/tmpmbok9wvncircus.p.sock --statspoint ipc:///tmp/tmpmbok9wvn/circus.s.sock --log-level INFO --log-output /home/framirez/.aiida/daemon/log/circus-charge_density.log
$ ps aux | grep run_daemon
framirez 4103 0.0 0.1 1677032 106564 ? Ssl Feb19 0:07 /home/framirez/.virtualenvs/aiida-prod/bin/python3.9 /home/framirez/.virtualenvs/aiida-prod/bin/verdi -p charge_density devel run_daemon
framirez 9237 0.0 0.1 971256 92004 ? Ssl Feb19 0:02 /home/framirez/.virtualenvs/aiida-prod/bin/python3.9 /home/framirez/.virtualenvs/aiida-prod/bin/verdi -p charge_density devel run_daemon
framirez 9296 0.0 0.0 14764 1012 pts/0 S+ 14:45 0:00 grep --color=auto run_daemon
framirez 16989 0.0 0.1 1713016 110316 ? Ssl 09:51 0:05 /home/framirez/.virtualenvs/aiida-main/bin/python3.9 /home/framirez/.virtualenvs/aiida-main/bin/verdi -p charge_density devel run_daemon
$ kill -9 4103 9237
Problem with bad entries
USER
I just did pip install -e . && reentry scan in my aiida-common-workflows folder and beside installing the changes, it also updated the aiida-quantumespresso , aiida-fleur, and aiida-pseudo. However, it broke my installation and reentry scan raises exception:
(...)
File "/home/pzp22/.local/software/anaconda3/envs/dev7/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 102, in __init__
requirement_string[e.loc : e.loc + 8], e.msg
pkg_resources.extern.packaging.requirements.InvalidRequirement: Parse error at "'-iida-ps'": Expected W:(abcd...)
DEV
Reentry keeps a cache in ~/.config/reentry (some may be ~/.local/reentry?), maybe that contains the corrupt mapping.
Simply delete them and then run reentry scan to recreate it. Maybe that works
USER I found out the source of issue. The following directory has been sitting in the distribution folder below. I deleted it and I could run reentry scan and fix it. But how it has been created? I have no clue...
/home/pzp22/.local/software/anaconda3/envs/dev7/lib/python3.7/site-packages/~iida_pseudo-0.3.0.dist-info
Check correct correspondence between DB - Profile - Repo
Use verdi profile list and verdi profile show to make sure the right things are being associated...