lyft / cartography

Cartography is a Python tool that consolidates infrastructure assets and the relationships between them in an intuitive graph view powered by a Neo4j database.

Home Page:https://lyft.github.io/cartography/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Critical error in GitHub intel repos

jychp opened this issue · comments

Description:

GitHub Intel call load function with bad parameters order in sync function that lead to a critical error.

load(neo4j_session, repo_data, common_job_parameters['UPDATE_TAG'])

def load(neo4j_session: neo4j.Session, common_job_parameters: Dict, repo_data: Dict) -> None:

Logs:

ERROR:cartography.sync:Unhandled exception during sync stage 'github'
Traceback (most recent call last):
  File "/home/runner/work/cyb-cartography/cyb-cartography/cartography/sync.py", line 109, in run
    stage_func(***_session, config)
  File "/home/runner/work/cyb-cartography/cyb-cartography/cartography/util.py", line 165, in timed
    return method(*args, **kwargs)
  File "/home/runner/work/cyb-cartography/cyb-cartography/cartography/intel/github/__init__.py", line 43, in start_github_ingestion
    cartography.intel.github.repos.sync(
  File "/home/runner/work/cyb-cartography/cyb-cartography/cartography/intel/github/repos.py", line 566, in sync
    load(***_session, repo_data, common_job_parameters['UPDATE_TAG'])
  File "/home/runner/work/cyb-cartography/cyb-cartography/cartography/util.py", line 165, in timed
    return method(*args, **kwargs)
  File "/home/runner/work/cyb-cartography/cyb-cartography/cartography/intel/github/repos.py", line 516, in load
    load_github_repos(***_session, common_job_parameters['UPDATE_TAG'], repo_data['repos'])
KeyError: 'UPDATE_TAG'
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.17/x64/bin/cartography", line 8, in <module>
    sys.exit(main())
  File "/home/runner/work/cyb-cartography/cyb-cartography/cartography/cli.py", line 690, in main
    sys.exit(CLI(prog='cartography').main(argv))
  File "/home/runner/work/cyb-cartography/cyb-cartography/cartography/cli.py", line 671, in main
    return cartography.sync.run_with_config(self.sync, config)
  File "/home/runner/work/cyb-cartography/cyb-cartography/cartography/sync.py", line [187](https://github.com/ResilienceCare/cyb-cartography/actions/runs/5353951882/jobs/9710399363#step:8:188), in run_with_config
    return sync.run(***_driver, config)
  File "/home/runner/work/cyb-cartography/cyb-cartography/cartography/sync.py", line 109, in run
    stage_func(***_session, config)
  File "/home/runner/work/cyb-cartography/cyb-cartography/cartography/util.py", line 165, in timed
    return method(*args, **kwargs)
  File "/home/runner/work/cyb-cartography/cyb-cartography/cartography/intel/github/__init__.py", line 43, in start_github_ingestion
    cartography.intel.github.repos.sync(
  File "/home/runner/work/cyb-cartography/cyb-cartography/cartography/intel/github/repos.py", line 566, in sync
    load(***_session, repo_data, common_job_parameters['UPDATE_TAG'])
  File "/home/runner/work/cyb-cartography/cyb-cartography/cartography/util.py", line 165, in timed
    return method(*args, **kwargs)
  File "/home/runner/work/cyb-cartography/cyb-cartography/cartography/intel/github/repos.py", line 516, in load
    load_github_repos(***_session, common_job_parameters['UPDATE_TAG'], repo_data['repos'])
KeyError: 'UPDATE_TAG'

Please complete the following information::

Up to date cartography (commit: 80d764ae75e56bfe3913902a286059cd2160dd58)
Python 3.8.16
OS: Ubuntu 22.04

Closing this as fixed in #1190 ( thank you @resilience-jychp !)