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

[HDFS_Namenode] fix missing tags crash #1132

Merged
merged 1 commit into from
Feb 20, 2018

Conversation

djova
Copy link
Contributor

@djova djova commented Feb 17, 2018

What does this PR do?

Fixes a bug introduced in #1107

If no tags are specified for an instance in hdfs_namenode.yaml, the check crashes.

hdfs_namenode (5.22.0)
----------------------
  - instance #0 [ERROR]: "'NoneType' object has no attribute 'append'"
    Traceback (most recent call last):
      File "/opt/datadog-agent/agent/checks/__init__.py", line 812, in run
        self.check(copy.deepcopy(instance))
      File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/datadog_checks/hdfs_namenode/hdfs_namenode.py", line 99, in check
        tags.append('namenode_url:' + jmx_address)
    AttributeError: 'NoneType' object has no attribute 'append'

Temporary workaround for those that don't use tags and are having this problem is to set tags: [] in your instance yaml.

Motivation

Our HDFS Namenode check was crashing.

In DataDog#1107 a bug was introduced so that if no `tags` are specified on an instance, the check crashes:

```
hdfs_namenode (5.22.0)
----------------------
  - instance #0 [ERROR]: "'NoneType' object has no attribute 'append'"
    Traceback (most recent call last):
      File "/opt/datadog-agent/agent/checks/__init__.py", line 812, in run
        self.check(copy.deepcopy(instance))
      File "/opt/datadog-agent/embedded/lib/python2.7/site-packages/datadog_checks/hdfs_namenode/hdfs_namenode.py", line 99, in check
        tags.append('namenode_url:' + jmx_address)
    AttributeError: 'NoneType' object has no attribute 'append'
```

Temporary workaround for those that don't use tags is to simply set `tags: []` in your instance settings.
@djova djova changed the title [HDFS_Namenode] fix break [HDFS_Namenode] fix missing tags crash Feb 17, 2018
@masci masci added this to the 6.1 milestone Feb 19, 2018
@nmuesch
Copy link
Collaborator

nmuesch commented Feb 20, 2018

Hey @djova Thanks for the PR! I'll go ahead and merge this so we can get it released soon.

@nmuesch nmuesch merged commit 643a81c into DataDog:master Feb 20, 2018
@nmuesch nmuesch mentioned this pull request Feb 20, 2018
3 tasks
@djova djova deleted the dusan/fix_broken_hdfs_namenode_check branch February 26, 2018 17:20
@masci masci modified the milestones: 6.1, 6.1/5.23 Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants