Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS EBS Snapshot sync crashes with neo4j OSError : No data #1414

Open
achantavy opened this issue Dec 22, 2024 · 0 comments
Open

AWS EBS Snapshot sync crashes with neo4j OSError : No data #1414

achantavy opened this issue Dec 22, 2024 · 0 comments
Labels
AWS Related to cartography's AWS module bug Something isn't working help wanted Help is requested from anyone who has cycles to look at this

Comments

@achantavy
Copy link
Contributor

Description:

What issue is being seen? Describe what should be happening instead of the bug, for example: Cartography should not crash, the expected value isn't returned, the data schema is wrong, etc.

The EBS snapshot sync crashes with a neo4j exception.

To Reproduce:

Steps to reproduce the behavior. Provide all data and inputs required to reproduce the issue.

Run the sync and have transient network problems (I think?).

Logs:

If applicable, copy and paste your console log with the failing stack trace.

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/cartography/sync.py", line 113, in run
    stage_func(neo4j_session, config)
  File "/usr/local/lib/python3.10/site-packages/cartography/util.py", line 198, in timed
    return method(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/cartography/intel/aws/__init__.py", line 298, in start_aws_ingestion
    sync_successful = _sync_multiple_accounts(
  File "/usr/local/lib/python3.10/site-packages/cartography/intel/aws/__init__.py", line 169, in _sync_multiple_accounts
    _sync_one_account(
  File "/usr/local/lib/python3.10/site-packages/cartography/intel/aws/__init__.py", line 64, in _sync_one_account
    RESOURCE_FUNCTIONS[func_name](**sync_args)
  File "/usr/local/lib/python3.10/site-packages/cartography/util.py", line 198, in timed
    return method(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/cartography/intel/aws/ec2/snapshots.py", line 144, in sync_ebs_snapshots
    load_snapshots(neo4j_session, data, region, current_aws_account_id, update_tag)
  File "/usr/local/lib/python3.10/site-packages/cartography/util.py", line 198, in timed
    return method(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/cartography/intel/aws/ec2/snapshots.py", line 78, in load_snapshots
    neo4j_session.run(
  File "/usr/local/lib/python3.10/site-packages/neo4j/work/simple.py", line 217, in run
    self._autoResult._run(
  File "/usr/local/lib/python3.10/site-packages/neo4j/work/result.py", line 115, in _run
    self._attach()
  File "/usr/local/lib/python3.10/site-packages/neo4j/work/result.py", line 204, in _attach
    self._connection.fetch_message()
  File "/usr/local/lib/python3.10/site-packages/neo4j/io/_common.py", line 187, in inner
    func(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/neo4j/io/_bolt4.py", line 291, in fetch_message
    details, summary_signature, summary_metadata = next(self.inbox)
  File "/usr/local/lib/python3.10/site-packages/neo4j/io/_common.py", line 83, in __next__
    tag, fields = self.pop()
  File "/usr/local/lib/python3.10/site-packages/neo4j/io/_common.py", line 77, in pop
    return next(self._messages)
  File "/usr/local/lib/python3.10/site-packages/neo4j/io/_common.py", line 74, in _yield_messages
    self.on_error(error)
  File "/usr/local/lib/python3.10/site-packages/neo4j/io/__init__.py", line 579, in _set_defunct_read
    self._set_defunct(message, error=error, silent=silent)
  File "/usr/local/lib/python3.10/site-packages/neo4j/io/__init__.py", line 624, in _set_defunct
    raise SessionExpired(message) from error
neo4j.exceptions.SessionExpired: Failed to read from defunct connection IPv4Address(('URI', 7687)) (IPv4Address(('IP', 7687)))
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/neo4j/io/_common.py", line 57, in _yield_messages
    buffer.receive(sock, 2)
  File "/usr/local/lib/python3.10/site-packages/neo4j/packstream.py", line 484, in receive
    raise OSError("No data")
OSError: No data

Please complete the following information::

  • Cartography release version or commit hash [e.g. 0.12.0 or 95e8e11]

0.96.2

Failing line:

neo4j_session.run(
ingest_snapshots,
snapshots_list=data,
AWS_ACCOUNT_ID=current_aws_account_id,
Region=region,
update_tag=update_tag,
)

It's a bare neo4j.session() call without a transaction. Refactoring to the new data model will fix this.

@achantavy achantavy added bug Something isn't working help wanted Help is requested from anyone who has cycles to look at this AWS Related to cartography's AWS module labels Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AWS Related to cartography's AWS module bug Something isn't working help wanted Help is requested from anyone who has cycles to look at this
Projects
None yet
Development

No branches or pull requests

1 participant