Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

EBS Auditor: Issues are not removed on volume deletion #164

Open
bunjiboys opened this issue Jun 4, 2018 · 1 comment
Open

EBS Auditor: Issues are not removed on volume deletion #164

bunjiboys opened this issue Jun 4, 2018 · 1 comment
Assignees
Labels
cinq-auditor-ebs EBS Volume Attachment Auditor

Comments

@bunjiboys
Copy link
Contributor

When a volume which has an associated issue is deleted, before being fixed, the issue is not correctly removed, but instead causes the auditor to crash with a NoneType exception

Traceback (most recent call last):
  File "/opt/pyenv/lib/python3.5/site-packages/cinq_scheduler_sqs/__init__.py", line 348, in execute_worker
    worker.run()
  File "/opt/pyenv/lib/python3.5/site-packages/cinq_auditor_ebs/__init__.py", line 46, in run
    data = self.update_data()
  File "/opt/pyenv/lib/python3.5/site-packages/cinq_auditor_ebs/__init__.py", line 71, in update_data
    fixed_issues = self.process_fixed_issues(volumes, existing_issues)
  File "/opt/pyenv/lib/python3.5/site-packages/cinq_auditor_ebs/__init__.py", line 175, in process_fixed_issues
    fixed_issues.setdefault(issue.volume.account, []).append(issue)
AttributeError: 'NoneType' object has no attribute 'account'

To avoid this, we need to check if the issue.volume reference is None during the cleanup phase, as this will only be None if the resource it references doesn't exist, ie. the volume has been deleted

@bunjiboys bunjiboys added the cinq-auditor-ebs EBS Volume Attachment Auditor label Jun 4, 2018
@bunjiboys bunjiboys self-assigned this Jun 4, 2018
@laf-rge
Copy link

laf-rge commented Nov 8, 2018

This is probably related to #112

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cinq-auditor-ebs EBS Volume Attachment Auditor
Projects
None yet
Development

No branches or pull requests

2 participants