nomad-coe / nomad

NOMAD lets you manage and share your materials science data in a way that makes it truly useful to you, your group, and the community.
https://nomad-lab.eu
Apache License 2.0
64 stars 14 forks source link

Example in documentation not working #56

Closed ericpre closed 1 year ago

ericpre commented 1 year ago

Uploading the example in https://nomad-lab.eu/prod/v1/docs/schema/basics.html#separating-data-and-schema fails with:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/nomad/metainfo/metainfo.py", line 3218, in __get__
    value = obj.__dict__[self.name]
KeyError: 'all_base_sections'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/nomad/files.py", line 734, in _file
    return open(path_object.os_path, *args, **kwargs)
FileNotFoundError: [Errno 2] No such file or directory: '.volumes/fs/staging/J/JOZylPJtSZ-bU7opnhnOfA/raw/schema.archive.yaml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/nomad/datamodel/context.py", line 265, in load_raw_file
    with upload_files.raw_file(path, 'rt') as f:
  File "/usr/local/lib/python3.9/site-packages/nomad/files.py", line 789, in raw_file
    return self._file(self.raw_file_object(file_path), *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/nomad/files.py", line 736, in _file
    raise KeyError(path_object.os_path)
KeyError: '.volumes/fs/staging/J/JOZylPJtSZ-bU7opnhnOfA/raw/schema.archive.yaml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/nomad/metainfo/metainfo.py", line 3237, in __get__
    return self.derived(obj)  # pylint: disable=not-callable
  File "/usr/local/lib/python3.9/site-packages/nomad/metainfo/metainfo.py", line 4144, in all_base_sections
    for base_base_section in base_section.all_base_sections:
  File "/usr/local/lib/python3.9/site-packages/nomad/metainfo/metainfo.py", line 168, in __getattr__
    if self.m_proxy_resolve() is not None:
  File "/usr/local/lib/python3.9/site-packages/nomad/metainfo/metainfo.py", line 163, in m_proxy_resolve
    self._set_resolved(self.m_proxy_type.resolve(self))
  File "/usr/local/lib/python3.9/site-packages/nomad/metainfo/metainfo.py", line 578, in resolve
    context_section = context.resolve_archive_url(url.archive_url)
  File "/usr/local/lib/python3.9/site-packages/nomad/datamodel/context.py", line 197, in resolve_archive_url
    self.cache_archive(url, self.load_url(url))
  File "/usr/local/lib/python3.9/site-packages/nomad/datamodel/context.py", line 193, in load_url
    return self.load_raw_file(entry_id_or_mainfile, upload_id, installation_url)
  File "/usr/local/lib/python3.9/site-packages/nomad/datamodel/context.py", line 269, in load_raw_file
    raise MetainfoReferenceError(f'Could not load {path}.')
nomad.metainfo.metainfo.MetainfoReferenceError: Could not load schema.archive.yaml.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/nomad/processing/data.py", line 1156, in parsing
    parser.parse(self.mainfile_file.os_path, self._parser_results, logger=logger, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/nomad/parsing/parser.py", line 495, in parse
    self.parse_file(mainfile, f, archive, logger)
  File "/usr/local/lib/python3.9/site-packages/nomad/parsing/parser.py", line 477, in parse_file
    errors, warnings = archive.definitions.m_all_validate()
  File "/usr/local/lib/python3.9/site-packages/nomad/metainfo/metainfo.py", line 2667, in m_all_validate
    more_errors, more_warnings = section.m_validate()
  File "/usr/local/lib/python3.9/site-packages/nomad/metainfo/metainfo.py", line 2565, in m_validate
    if self.m_parent and hasattr(self.m_parent, 'all_base_sections'):
  File "/usr/local/lib/python3.9/site-packages/nomad/metainfo/metainfo.py", line 3239, in __get__
    raise DeriveError(f'Could not derive value for {self}: {str(e)}')
nomad.metainfo.metainfo.DeriveError: Could not derive value for nomad.metainfo.metainfo.Section.all_base_sections:Quantity: Could not load schema.archive.yaml.
TLCFEM commented 1 year ago

chrome_icmHCL5T12

It can be successfully processed. Did you upload schema first?

ericpre commented 1 year ago

Thanks for checking! I used the yml extension instead of yaml... :facepalm:

Maybe the error message could be more precise, as in why the schema couldn't load? In this case, it couldn't find the file.

TLCFEM commented 1 year ago
FileNotFoundError: [Errno 2] No such file or directory: '.volumes/fs/staging/J/JOZylPJtSZ-bU7opnhnOfA/raw/schema.archive.yaml'

Isn't it the same thing?

ericpre commented 1 year ago

Yes, indeed, I didn't looked careful enough - my habit of reading the bottom of the trace error failed me on that one! 😉