CasperWA / voila-optimade-client

Import structures in AiiDA lab using OPTIMADE
MIT License
3 stars 6 forks source link

[BUG] Unable to select the Materials Cloud database provider #334

Closed csadorf closed 3 years ago

csadorf commented 3 years ago

Bug description

Tried to select the Materials Cloud database provider and the application crashes with a Error(s) during querying. Message(s) from server: - "'child' is not a known or searchable quantity" error.

Expected behaviour (optional)

The Materials Cloud database should have been selected.

For developers (do not alter this section)

Log dump ``` ... [DEBUG 09:16:49 utils.py:428] Base URL found to be None for provider: id='jarvis' type='links' links=None meta=None attributes=LinksResourceAttributes(name='Joint Automated Repository for Various Integrated Simulations (JARVIS)', description='JARVIS is a repository designed to automate materials discovery using classical force-field, density functional theory, machine learning calculations and experiments.', base_url=None, homepage=AnyUrl('https://jarvis.nist.gov', scheme='https', host='jarvis.nist.gov', tld='gov', host_type='domain'), link_type=, aggregate=, no_aggregate_reason=None) relationships=None [DEBUG 09:16:49 utils.py:428] Base URL found to be None for provider: id='pcod' type='links' links=None meta=None attributes=LinksResourceAttributes(name='Predicted Crystallography Open Database', description='', base_url=None, homepage=None, link_type=, aggregate=, no_aggregate_reason=None) relationships=None [DEBUG 09:16:49 utils.py:412] Temporarily disabling provider: id='tcod' type='links' links=None meta=None attributes=LinksResourceAttributes(name='Theoretical Crystallography Open Database', description='Open-access collection of theoretically calculated or refined crystal structures of organic, inorganic, metal-organic compounds and minerals, excluding biopolymers', base_url=AnyUrl('http://providers.optimade.org/index-metadbs/tcod', scheme='http', host='providers.optimade.org', tld='org', host_type='domain', path='/index-metadbs/tcod'), homepage=AnyUrl('https://www.crystallography.net/tcod', scheme='https', host='www.crystallography.net', tld='net', host_type='domain', path='/tcod'), link_type=, aggregate=, no_aggregate_reason=None) relationships=None [DEBUG 09:16:50 provider_database.py:720] Provider changed in summary. New value: None [DEBUG 09:16:50 provider_database.py:729] Database changed in summary. New value: None [DEBUG 09:16:51 summary.py:231] Got no new structure for DownloadChooser (change['new']=None). [DEBUG 09:16:51 informational.py:159] Trying image file path: /home/aiida/apps/aiidalab-optimade/img/optimade-text-right-transparent-bg.png [DEBUG 09:16:54 provider_database.py:720] Provider changed in summary. New value: LinksResourceAttributes(name='Materials Cloud', description='A platform for Open Science built for seamless sharing of resources in computational materials science', base_url='https://www.materialscloud.org/optimade/v1', homepage=AnyUrl('https://www.materialscloud.org', scheme='https', host='www.materialscloud.org', tld='org', host_type='domain'), link_type=, aggregate=, no_aggregate_reason=None) [DEBUG 09:16:54 provider_database.py:244] Initializing child DBs for Materials Cloud. [DEBUG 09:16:54 utils.py:165] Performing OPTIMADE query: https://www.materialscloud.org/optimade/v1/links?filter=%28+link_type%3Dchild+OR+type%3Dchild+%29&response_format=json&page_limit=100&page_offset=0&page_number=1 [ERROR 09:16:55 utils.py:531] Errored response: { "meta": { "query": { "representation": "/links?filter=%28+link_type%3Dchild+OR+type%3Dchild+%29&response_format=json&page_limit=100&page_offset=0&page_number=1" }, "api_version": "1.1.0", "more_data_available": false, "time_stamp": "2021-08-24T09:16:55Z", "data_returned": 0, "provider": { "name": "Materials Cloud", "description": "A platform for Open Science built for seamless sharing of resources in computational materials science", "prefix": "mcloud", "homepage": "https://www.materialscloud.org" }, "data_available": 0, "implementation": { "name": "optimade-python-tools (configured for Materials Cloud)", "version": "0.16.2", "source_url": "https://github.com/CasperWA/optimade-python-tools/tree/index_meta_db", "maintainer": { "email": "casper.andersen@epfl.ch" } } }, "errors": [ { "status": "400", "title": "Bad Request", "detail": "'child' is not a known or searchable quantity" } ] } [ERROR 09:16:55 exceptions.py:20] QueryError raised. Error message: QueryError Message: Error(s) during querying. Message(s) from server:
- "'child' is not a known or searchable quantity"
Remove target: True About this exception: Error while querying specific implementation (or provider) [DEBUG 09:16:55 provider_database.py:289] Trying to initalize child DBs. QueryError caught: QueryError('\nQueryError\n Message: Error(s) during querying. Message(s) from server:
- "\'child\' is not a known or searchable quantity"
\n Remove target: True') [DEBUG 09:16:55 provider_database.py:295] Remove target: True. Will remove target at 1: LinksResourceAttributes(name='Materials Cloud', description='A platform for Open Science built for seamless sharing of resources in computational materials science', base_url='https://www.materialscloud.org/optimade/v1', homepage=AnyUrl('https://www.materialscloud.org', scheme='https', host='www.materialscloud.org', tld='org', host_type='domain'), link_type=, aggregate=, no_aggregate_reason=None) ```
Versions ``` aiida-bands-inspect==0.4.0 aiida-bigdft==0.2.6 aiida-codtools==2.1.0 aiida-core==1.6.3 aiida-cp2k==1.3.0 aiida-crystal17==0.11.0 aiida-ddec==1.1.0 aiida-diff==1.2.0 aiida-fleur==1.2.0 aiida-gaussian==1.4.1 aiida-lammps==0.8.0 aiida-lsmo==1.0.0 aiida-nanotech-empa==0.3.0 aiida-optimize==0.4.0 aiida-pseudo==0.6.2 aiida-qeq==1.0.0a1 aiida-quantumespresso==3.4.2 aiida-raspa==1.2.0 aiida-tbmodels==0.3.0 aiida-tools==0.3.3 aiida-vasp==2.1.0 aiida-wannier90==2.0.1 aiida-yambo==1.3.0 aiida-zeopp==1.1.2 aiidalab==21.7.3 aiidalab-eln==0.1.1 aiidalab-qe==21.7.0b4 aiidalab-qe-workchain==1.0 aiidalab-widgets-base==1.0.0rc1 aio-pika==6.8.0 aiormq==3.3.1 alabaster==0.7.12 aldjemy==0.9.1 alembic==1.5.8 aniso8601==9.0.1 ansi2html==1.6.0 appdirs==1.4.4 archive-path==0.2.1 argon2-cffi==20.1.0 arrow==1.1.1 ase==3.19.3 async-generator==1.10 attrs==20.3.0 Babel==2.9.1 backcall==0.2.0 backports.entry-points-selectable==1.1.0 bands-inspect==0.3.1 bcrypt==3.2.0 binaryornot==0.4.4 bleach==3.3.1 bokeh==2.3.3 bqplot==0.12.30 brotlipy==0.7.0 bump2version==1.0.1 CacheControl==0.12.6 cached-property==1.5.2 cachetools==4.2.2 calc-pe==1.0.1 cclib==1.7 certifi==2021.5.30 cffi==1.14.4 cfgv==3.3.0 cftime==1.5.0 chardet==4.0.0 charset-normalizer==2.0.4 cheminfopy==0.7.0 circus==0.17.1 click==7.1.2 click-completion==0.5.2 click-config-file==0.6.0 click-spinner==0.1.10 colorama==0.4.4 conda==4.9.2 conda-package-handling==1.7.2 configobj==5.0.6 cookiecutter==1.7.3 cryptography==3.3.1 cycler==0.10.0 debugpy==1.3.0 decorator==4.4.2 deepdiff==5.5.0 defusedxml==0.7.1 deprecation==2.1.0 distlib==0.3.2 Django==2.2.20 dnspython==2.1.0 docutils==0.15.2 dulwich==0.20.23 elementpath==2.2.3 email-validator==1.1.3 entrypoints==0.3 ete3==3.1.2 fastapi==0.65.3 filelock==3.0.12 Flask==1.1.4 Flask-Cors==3.0.10 Flask-RESTful==0.3.9 fsc.export==1.2.0 fsc.hdf5-io==1.0.1 future==0.18.2 graphviz==0.16 h5py==3.3.0 humanfriendly==9.2 identify==2.2.13 idna==2.10 imagesize==1.2.0 importlib-metadata==3.10.1 importlib-resources==5.2.0 iniconfig==1.1.1 ipydatawidgets==4.2.0 ipykernel==6.0.2 ipython==7.25.0 ipython-genutils==0.2.0 ipytree==0.2.1 ipywidgets==7.6.3 ipywidgets-extended==1.1.0 itsdangerous==1.1.0 jedi==0.18.0 Jinja2==2.11.3 jinja2-time==0.2.0 joblib==1.0.1 jsonextended==0.7.11 jsonschema==3.2.0 jupyter-client==6.1.12 jupyter-core==4.7.1 jupyterlab-pygments==0.1.2 jupyterlab-widgets==1.0.0 kiwipy==0.7.4 kiwisolver==1.3.1 lark-parser==0.11.3 lockfile==0.12.2 lxml==4.6.3 Mako==1.1.4 Markdown==3.3.4 MarkupSafe==1.1.1 masci-tools==0.4.10 matplotlib==3.4.1 matplotlib-inline==0.1.2 mendeleev==0.7.0 mistune==0.8.4 monty==2021.3.3 more-itertools==8.8.0 mpmath==1.2.1 msgpack==1.0.2 multidict==5.1.0 nbclient==0.5.3 nbconvert==6.0.7 nbformat==5.1.3 nest-asyncio==1.4.3 netCDF4==1.5.7 networkx==2.5.1 nglview==3.0.3 nodeenv==1.6.0 notebook==6.4.0 numpy==1.21.0 olefile==0.46 optimade==0.16.2 optimade-client==2021.8.6 ordered-set==4.0.2 packaging==20.9 palettable==3.3.0 pamqp==2.3.0 pandas==1.3.0 pandocfilters==1.4.3 paramiko==2.7.2 parsevasp==2.0.1 parso==0.8.2 pathlib2==2.3.6 pathtools==0.1.2 pbr==5.6.0 periodictable==1.6.0 pexpect==4.8.0 pgsu==0.2.0 pickleshare==0.7.5 Pillow==8.3.1 Pint==0.16.1 pip==21.1.3 platformdirs==2.2.0 plotly==4.14.3 pluggy==0.13.1 plumpy==0.19.0 poyo==0.5.0 pre-commit==2.11.1 prometheus-client==0.11.0 prompt-toolkit==3.0.18 psutil==5.8.0 psycopg2-binary==2.8.6 ptyprocess==0.7.0 py==1.10.0 pycairo==1.20.1 PyCifRW==4.4.3 pycosat==0.6.3 pycparser==2.20 pydantic==1.8.2 pydata-sphinx-theme==0.4.3 pyfiglet==0.8.post1 Pygments==2.8.1 pyhull==2015.2.1 pyiast==1.4.3 pymatgen==2020.12.3 PyMySQL==0.9.3 PyNaCl==1.4.0 pyOpenSSL==20.0.1 pyparsing==2.4.7 pyrsistent==0.17.3 pysmiles==1.0.1 PySocks==1.7.1 pytest==6.2.4 python-dateutil==2.8.2 python-editor==1.0.4 python-memcached==1.59 python-slugify==5.0.2 pythreejs==2.3.0 pytojcamp==0.1.0 pytray==0.3.1 pytz==2019.3 PyYAML==5.1.2 pyzmq==22.0.3 qe-tools==2.0.0rc2 reentry==1.3.2 repo2env==0.1.2 requests==2.26.0 requests-cache==0.5.2 retrying==1.3.3 ruamel-yaml-conda==0.15.80 ruamel.yaml==0.16.10 ruamel.yaml.clib==0.2.2 scikit-learn==0.24.2 scipy==1.6.3 seaborn==0.11.1 seekpath==1.9.7 Send2Trash==1.7.1 setuptools==49.6.0.post20210108 shellingham==1.4.0 shortuuid==1.0.1 simplejson==3.17.2 six==1.15.0 snowballstemmer==2.1.0 spglib==1.16.1 Sphinx==3.2.1 sphinx-copybutton==0.3.3 sphinx-notfound-page==0.7.1 sphinx-panels==0.5.2 sphinxcontrib-applehelp==1.0.2 sphinxcontrib-details-directive==0.1.0 sphinxcontrib-devhelp==1.0.2 sphinxcontrib-htmlhelp==2.0.0 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.5 sphinxext-rediraffe==0.2.7 SQLAlchemy==1.3.24 SQLAlchemy-Utils==0.36.8 sqlparse==0.4.1 starlette==0.14.2 subprocess32==3.5.4 sympy==1.8 tabulate==0.8.9 terminado==0.10.1 testpath==0.5.0 text-unidecode==1.3 threadpoolctl==2.2.0 toml==0.10.2 tornado==6.1 tqdm==4.56.1 traitlets==4.3.3 traittypes==0.2.1 typing-extensions==3.10.0.0 tzlocal==2.1 uncertainties==3.1.5 upf-to-json==0.9.3 urllib3==1.26.3 Vapory==0.1.2 virtualenv==20.7.2 voluptuous==0.12.1 watchdog==0.10.4 wcwidth==0.2.5 webencodings==0.5.1 Werkzeug==1.0.1 wheel==0.36.2 widget-bandsplot==0.2.3 widget-periodictable==2.1.5 widgetsnbextension==3.5.1 wrapt==1.11.2 xmlschema==1.6.4 yarl==1.6.3 zipp==3.4.1 ```
Traceback ```python-traceback --------------------------------------------------------------------------- QueryError Traceback (most recent call last) ~/apps/aiidalab-optimade/optimade_client/subwidgets/provider_database.py in _initialize_child_dbs(self) 246 # Query database and get child_dbs --> 247 child_dbs, links, data_returned, data_available = self._query() 248 ~/apps/aiidalab-optimade/optimade_client/subwidgets/provider_database.py in _query(self, link, exclude_ids) 594 self.error_or_status_messages.value = msg --> 595 raise QueryError(msg=msg, remove_target=True) 596 QueryError: QueryError Message: Error(s) during querying. Message(s) from server:
- "'child' is not a known or searchable quantity"
Remove target: True During handling of the above exception, another exception occurred: TraitError Traceback (most recent call last) /opt/conda/lib/python3.7/site-packages/ipywidgets/widgets/widget.py in _handle_msg(self, msg) 674 if 'buffer_paths' in data: 675 _put_buffers(state, data['buffer_paths'], msg['buffers']) --> 676 self.set_state(state) 677 678 # Handle a state request. /opt/conda/lib/python3.7/site-packages/ipywidgets/widgets/widget.py in set_state(self, sync_data) 543 from_json = self.trait_metadata(name, 'from_json', 544 self._trait_from_json) --> 545 self.set_trait(name, from_json(sync_data[name], self)) 546 547 def send(self, content, buffers=None): /opt/conda/lib/python3.7/contextlib.py in __exit__(self, type, value, traceback) 117 if type is None: 118 try: --> 119 next(self.gen) 120 except StopIteration: 121 return False /opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in hold_trait_notifications(self) 1129 for changes in cache.values(): 1130 for change in changes: -> 1131 self.notify_change(change) 1132 1133 def _notify_trait(self, name, old_value, new_value): /opt/conda/lib/python3.7/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change) 604 # Send new state to front-end 605 self.send_state(key=name) --> 606 super(Widget, self).notify_change(change) 607 608 def __repr__(self): /opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in notify_change(self, change) 1174 c = getattr(self, c.name) 1175 -> 1176 c(change) 1177 1178 def _add_notifiers(self, handler, name, type): ~/apps/aiidalab-optimade/optimade_client/subwidgets/provider_database.py in _observe_providers(self, change) 183 self.child_dbs.index = 0 184 else: --> 185 self._initialize_child_dbs() 186 if sum([len(_[1]) for _ in self.child_dbs.grouping]) <= 2: 187 # The provider either has 0 or 1 implementations ~/apps/aiidalab-optimade/optimade_client/subwidgets/provider_database.py in _initialize_child_dbs(self) 296 ) 297 self.providers.options = self._remove_current_dropdown_option( --> 298 self.providers 299 ) 300 self.reset() /opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in __set__(self, obj, value) 583 raise TraitError('The "%s" trait is read-only.' % self.name) 584 else: --> 585 self.set(obj, value) 586 587 def _validate(self, obj, value): /opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in set(self, obj, value) 572 # we explicitly compare silent to True just in case the equality 573 # comparison above returns something other than True/False --> 574 obj._notify_trait(self.name, old_value, new_value) 575 576 def __set__(self, obj, value): /opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value) 1137 new=new_value, 1138 owner=self, -> 1139 type='change', 1140 )) 1141 /opt/conda/lib/python3.7/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change) 604 # Send new state to front-end 605 self.send_state(key=name) --> 606 super(Widget, self).notify_change(change) 607 608 def __repr__(self): /opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in notify_change(self, change) 1174 c = getattr(self, c.name) 1175 -> 1176 c(change) 1177 1178 def _add_notifiers(self, handler, name, type): /opt/conda/lib/python3.7/site-packages/ipywidgets/widgets/widget_selection.py in _propagate_options(self, change) 214 self._notify_trait('index', 0, 0) 215 else: --> 216 self.index = 0 217 else: 218 self.index = None /opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in __set__(self, obj, value) 583 raise TraitError('The "%s" trait is read-only.' % self.name) 584 else: --> 585 self.set(obj, value) 586 587 def _validate(self, obj, value): /opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in set(self, obj, value) 572 # we explicitly compare silent to True just in case the equality 573 # comparison above returns something other than True/False --> 574 obj._notify_trait(self.name, old_value, new_value) 575 576 def __set__(self, obj, value): /opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value) 1137 new=new_value, 1138 owner=self, -> 1139 type='change', 1140 )) 1141 /opt/conda/lib/python3.7/site-packages/ipywidgets/widgets/widget.py in notify_change(self, change) 604 # Send new state to front-end 605 self.send_state(key=name) --> 606 super(Widget, self).notify_change(change) 607 608 def __repr__(self): /opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in notify_change(self, change) 1174 c = getattr(self, c.name) 1175 -> 1176 c(change) 1177 1178 def _add_notifiers(self, handler, name, type): ~/apps/aiidalab-optimade/optimade_client/subwidgets/provider_database.py in _observe_providers(self, change) 176 index = change["new"] 177 self.show_child_dbs.display = "none" --> 178 self.provider = self.providers.value 179 if index is None or self.providers.value is None: 180 self.show_child_dbs.display = "none" /opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in __set__(self, obj, value) 583 raise TraitError('The "%s" trait is read-only.' % self.name) 584 else: --> 585 self.set(obj, value) 586 587 def _validate(self, obj, value): /opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in set(self, obj, value) 557 558 def set(self, obj, value): --> 559 new_value = self._validate(obj, value) 560 try: 561 old_value = obj._trait_values[self.name] /opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in _validate(self, obj, value) 589 return value 590 if hasattr(self, 'validate'): --> 591 value = self.validate(obj, value) 592 if obj._cross_validation_lock is False: 593 value = self._cross_validate(obj, value) /opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in validate(self, obj, value) 1675 return value 1676 else: -> 1677 self.error(obj, value) 1678 1679 def info(self): /opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py in error(self, obj, value) 1522 % (self.name, self.info(), msg) 1523 -> 1524 raise TraitError(e) 1525 1526 TraitError: The 'provider' trait of a ProviderImplementationChooser instance must be a LinksResourceAttributes or None, but a value of class 'dict' (i.e. {}) was specified. ```
CasperWA commented 3 years ago

Note to self for fixing: Update filter string with double quotations.