Error in MPRester

I am intermittently getting an error when I call MPRester. Unfortunately, it’s hard for me to say exactly why because I don’t get this error every time I call MPRester. The error says:

Traceback (most recent call last):
File “/home/ubuntu/foo/”, line 410, in foobar
with MPRester(param.MP_KEY) as m:
File “/home/ubuntu/.local/lib/python3.8/site-packages/pymatgen/ext/”, line 205, in init
if “MAPI_DB_VERSION” not in d:
TypeError: argument of type ‘NoneType’ is not iterable

The only thing I can think of is that it might have to do with the fact that I am using multithreading/multiprocessing to call MPRester multiple times in parallel to speed up my database querying.

Hi @paulneves77

Please use the query syntax in MAPI to try and grab all the data you need in fewer calls. Generally, this means you’re overloading our servers. The resulting slowdown is failing to return a result. This also causes performance issues for others.