Skip to content

Tier0: Background process crashes when loading schema metadata #82

@everaldorodrigo

Description

@everaldorodrigo

What I Observed:

The application crashes when no schema metadata found for specific version:

  • The system attempts to load schema metadata version vF.
  • fetch_mapping_from_db() logs a warning that no metadata exists for that version.
  • get_operations() expects this metadata and raises a ValueError.
  • This exception is not handled and crashes the entire background process.

Actual Behavior

A missing metadata version causes a ValueError, killing the background process completely.

Expected Behavior

The system should either:

  • gracefully handle missing schema metadata versions, or
  • fail with a clearer error indicating what version should exist and why.

Logs

Below are the logs:

2025-12-11T10:55:18.467-08:00 63837 WARNING No schema metadata found for version 'vF'                                        retriever.data_tiers.tier_0.dgraph.driver:fetch_mapping_from_db():282
2025-12-11T10:55:18.468-08:00 63837 ERROR   Unhandled exception in background process.                                       uvloop:wrapper():61
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/spawn.py", line 122, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/spawn.py", line 135, in _main
    return self._bootstrap(parent_sentinel)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/process.py", line 313, in _bootstrap
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/v/dev/scripps/retriever/src/retriever/background.py", line 56, in background_process
    uvloop.run(_background_async())
  File "/Users/v/dev/scripps/retriever/.venv/lib/python3.13/site-packages/uvloop/__init__.py", line 109, in run
    return __asyncio.run(
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/runners.py", line 195, in run
    return runner.run(main)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
> File "/Users/v/dev/scripps/retriever/.venv/lib/python3.13/site-packages/uvloop/__init__.py", line 61, in wrapper
    return await main
  File "/Users/v/dev/scripps/retriever/src/retriever/background.py", line 32, in _background_async
    await metakg_manager.initialize()
  File "/Users/v/dev/scripps/retriever/src/retriever/metakg/metakg.py", line 178, in initialize
    await self.build_operation_table()
  File "/Users/v/dev/scripps/retriever/src/retriever/metakg/metakg.py", line 128, in build_operation_table
    await tier_manager.get_driver(tier).get_operations() for tier in range(0, 2)
  File "/Users/v/dev/scripps/retriever/src/retriever/data_tiers/tier_0/dgraph/driver.py", line 370, in get_operations
    raise ValueError(

Metadata

Metadata

Labels

bugSomething isn't workingtier0Concerns Tier 0

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions