# Anomalies section missing on local agent dashboard and on cloud

**URL:** <https://community.netdata.cloud/t/anomalies-section-missing-on-local-agent-dashboard-and-on-cloud/770>\
**Category:** Help\
**Tags:** agent\
**Created:** [January 15, 2021, 8:26am UTC](https://community.netdata.cloud/t/anomalies-section-missing-on-local-agent-dashboard-and-on-cloud/770 "2021-01-15T08:26:52Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Morne\_Supra](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/morne_supra/32/376_2.png) [@Morne\_Supra](https://community.netdata.cloud/u/Morne_Supra)\
**Post date:** [January 15, 2021, 8:26am UTC](https://community.netdata.cloud/t/anomalies-section-missing-on-local-agent-dashboard-and-on-cloud/770/1 "2021-01-15T08:26:52Z")

</div>

Hi  
I followed the anomaly detection guide, but I can not see the Anomaly section nor any dashboards.

Using Centos7 with agent **`v1.28.0-131-nightly`**

Regards

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [January 15, 2021, 9:26am UTC](https://community.netdata.cloud/t/anomalies-section-missing-on-local-agent-dashboard-and-on-cloud/770/2 "2021-01-15T09:26:45Z")

</div>

Hi @Morne_Supra

Let’s try to debug the problem.

Running anomalies collector in the debug mode likely will tell us what is wrong, please do the following:

```auto
cd /path/to/netdata/plugins.d/ # /opt/netdata/usr/libexec/netdata/plugins.d or usr/libexec/netdata/plugins.d

sudo su -s /bin/bash netdata

./python.d.plugin debug nolock trace anomalies 

```

And share the output

---

<div class="post-metadata">

**Author:** ![Morne\_Supra](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/morne_supra/32/376_2.png) [@Morne\_Supra](https://community.netdata.cloud/u/Morne_Supra)\
**Post date:** [January 15, 2021, 9:30am UTC](https://community.netdata.cloud/t/anomalies-section-missing-on-local-agent-dashboard-and-on-cloud/770/3 "2021-01-15T09:30:22Z")

</div>

Hi @ilyam8  
Thanks for your reply. Below the output:

```auto
bash-4.2$ ./python.d.plugin debug nolock trace anomalies
2021-01-15 11:29:19: python.d INFO: plugin[main] : using python v2
2021-01-15 11:29:19: python.d DEBUG: plugin[main] : looking for 'python.d.conf' in ['/etc/netdata', '/usr/lib/netdata/conf.d']
2021-01-15 11:29:19: python.d DEBUG: plugin[main] : loading '/etc/netdata/python.d.conf'
2021-01-15 11:29:19: python.d DEBUG: plugin[main] : '/etc/netdata/python.d.conf' is loaded
2021-01-15 11:29:19: python.d DEBUG: plugin[main] : looking for 'pythond-jobs-statuses.json' in /var/lib/netdata
2021-01-15 11:29:19: python.d DEBUG: plugin[main] : loading '/var/lib/netdata/pythond-jobs-statuses.json'
2021-01-15 11:29:19: python.d DEBUG: plugin[main] : '/var/lib/netdata/pythond-jobs-statuses.json' is loaded
2021-01-15 11:29:19: python.d WARNING: plugin[main] : [anomalies] error on loading source : SyntaxError('invalid syntax', ('/usr/libexec/netdata/python.d/anomalies.chart.py', 83, 108, " self.charts_available = [c for c in list(requests.get(f'{self.protocol}://{self.host}/api/v1/charts').json().get('charts', {}).keys())]\n")), skipping it
2021-01-15 11:29:19: python.d INFO: plugin[main] : no jobs to run

```

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [January 15, 2021, 9:35am UTC](https://community.netdata.cloud/t/anomalies-section-missing-on-local-agent-dashboard-and-on-cloud/770/4 "2021-01-15T09:35:12Z")

</div>

> [@Morne\_Supra](#):
>
> ```auto
> 2021-01-15 11:29:19: python.d INFO: plugin[main] : using python v2
> 
> ```

Ok, that is the problem, anomalies collector requires python3. If you have python3 installed, see [Syntax error: anomalies.chart.py · Issue #10499 · netdata/netdata · GitHub](https://github.com/netdata/netdata/issues/10499#issuecomment-759523781)

---

<div class="post-metadata">

**Author:** ![Morne\_Supra](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/morne_supra/32/376_2.png) [@Morne\_Supra](https://community.netdata.cloud/u/Morne_Supra)\
**Post date:** [January 15, 2021, 9:43am UTC](https://community.netdata.cloud/t/anomalies-section-missing-on-local-agent-dashboard-and-on-cloud/770/5 "2021-01-15T09:43:16Z")

</div>

Hi @ilyam8

I made the required change and then restarted the agent:

```auto
[plugin:python.d]
        # update every = 1
        # command options =
        command options = -ppython3

```

I then ran ./python.d.plugin debug nolock trace anomalies again and got the same error:

```auto
bash-4.2$ ./python.d.plugin debug nolock trace anomalies
2021-01-15 11:38:46: python.d INFO: plugin[main] : using python v2
2021-01-15 11:38:46: python.d DEBUG: plugin[main] : looking for 'python.d.conf' in ['/etc/netdata', '/usr/lib/netdata/conf.d']
2021-01-15 11:38:46: python.d DEBUG: plugin[main] : loading '/etc/netdata/python.d.conf'
2021-01-15 11:38:46: python.d DEBUG: plugin[main] : '/etc/netdata/python.d.conf' is loaded
2021-01-15 11:38:46: python.d DEBUG: plugin[main] : looking for 'pythond-jobs-statuses.json' in /var/lib/netdata
2021-01-15 11:38:46: python.d DEBUG: plugin[main] : loading '/var/lib/netdata/pythond-jobs-statuses.json'
2021-01-15 11:38:46: python.d DEBUG: plugin[main] : '/var/lib/netdata/pythond-jobs-statuses.json' is loaded
2021-01-15 11:38:46: python.d WARNING: plugin[main] : [anomalies] error on loading source : SyntaxError('invalid syntax', ('/usr/libexec/netdata/python.d/anomalies.chart.py', 83, 108, " self.charts_available = [c for c in list(requests.get(f'{self.protocol}://{self.host}/api/v1/charts').json().get('charts', {}).keys())]\n")), skipping it
2021-01-15 11:38:46: python.d INFO: plugin[main] : no jobs to run

```

I definitely have python3 installed:

```auto
bash-4.2$ python3 --version
Python 3.6.8
bash-4.2$ python --version
Python 2.7.5
bash-4.2$ exit
exit

```

Looks like python is defaulting to v2. Do you know how to setup default to version 3 for the netdata user?

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [January 15, 2021, 9:48am UTC](https://community.netdata.cloud/t/anomalies-section-missing-on-local-agent-dashboard-and-on-cloud/770/6 "2021-01-15T09:48:45Z")

</div>

Changes you applied to `netdata.conf` are not seen in the debug mode because python.d.plugin doesn’t read the file (netdata reads it and tells to use python3 to python.d.plugin - should work after netdata.service restart).

In the debug mode you need

```auto
./python.d.plugin -ppython3 debug nolock trace anomalies

```

---

<div class="post-metadata">

**Author:** ![Morne\_Supra](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/morne_supra/32/376_2.png) [@Morne\_Supra](https://community.netdata.cloud/u/Morne_Supra)\
**Post date:** [January 15, 2021, 9:54am UTC](https://community.netdata.cloud/t/anomalies-section-missing-on-local-agent-dashboard-and-on-cloud/770/7 "2021-01-15T09:54:46Z")

</div>

Thanks @ilyam8

The following from error.log and ./python.d.plugin -ppython3 debug nolock trace anomalies. Is it expected?

```auto
2021-01-15 11:52:00: python.d INFO: plugin[main] : [anomalies] built 1 job(s) configs
2021-01-15 11:52:01: python.d WARNING: plugin[main] : anomalies[local] : unhandled exception on check : DataError('No numeric types to aggregate',), skipping the job

```

---

<div class="post-metadata">

**Author:** ![Morne\_Supra](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/morne_supra/32/376_2.png) [@Morne\_Supra](https://community.netdata.cloud/u/Morne_Supra)\
**Post date:** [January 15, 2021, 10:06am UTC](https://community.netdata.cloud/t/anomalies-section-missing-on-local-agent-dashboard-and-on-cloud/770/8 "2021-01-15T10:06:16Z")

</div>

Hi @ilyam8

Fixed it. I had a typo in my anomalies.conf.

Now just waiting for the Anomalies section to appear:

```auto
2021-01-15 12:03:58: python.d INFO: plugin[main] : [anomalies] built 1 job(s) configs
2021-01-15 12:03:59: python.d INFO: plugin[main] : anomalies[local] : check success
2021-01-15 12:04:02: python.d INFO: anomalies[local] : training complete in 3.14 seconds (runs_counter=1, model=pca, train_n_secs=14400, models=23, n_fit_success=23, n_fit_fails=0, after=1610690639, before=1610705039).

```

---

<div class="post-metadata">

**Author:** ![Morne\_Supra](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/morne_supra/32/376_2.png) [@Morne\_Supra](https://community.netdata.cloud/u/Morne_Supra)\
**Post date:** [January 15, 2021, 10:11am UTC](https://community.netdata.cloud/t/anomalies-section-missing-on-local-agent-dashboard-and-on-cloud/770/9 "2021-01-15T10:11:56Z")

</div>

Thanks @ilyam8

I see my anomaly score for system..\*. Will now start playing around with it to see if I can trigger an anomaly.

 ![Screenshot from 2021-01-15 12-11-27](https://canada1.discourse-cdn.com/flex029/uploads/netdata2/original/1X/ad76db445978694f02a70b49cf24f73d766f6a49.png)

---

<div class="post-metadata">

**Author:** ![ilyam8](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/ilyam8/32/134_2.png) [@ilyam8](https://community.netdata.cloud/u/ilyam8)\
**Post date:** [January 15, 2021, 10:39am UTC](https://community.netdata.cloud/t/anomalies-section-missing-on-local-agent-dashboard-and-on-cloud/770/10 "2021-01-15T10:39:36Z")

</div>

Nice you get it working 🎉

Consider to check [Anomalies collector feedback megathread!](https://community.netdata.cloud/t/anomalies-collector-feedback-megathread/767) and share your opinion 😄

---

<div class="post-metadata">

**Author:** ![Morne\_Supra](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/morne_supra/32/376_2.png) [@Morne\_Supra](https://community.netdata.cloud/u/Morne_Supra)\
**Post date:** [January 15, 2021, 10:54am UTC](https://community.netdata.cloud/t/anomalies-section-missing-on-local-agent-dashboard-and-on-cloud/770/11 "2021-01-15T10:54:32Z")

</div>

Yeah, I definitely will. I am setting up an SNMP config, so I can get values from my Mikrotik router. As soon as I have these values, I can start playing around with detection and then share my findings.

---

<div class="post-metadata">

**Author:** ![sambutle](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@sambutle](https://community.netdata.cloud/u/sambutle)\
**Post date:** [April 27, 2021, 8:45am UTC](https://community.netdata.cloud/t/anomalies-section-missing-on-local-agent-dashboard-and-on-cloud/770/12 "2021-04-27T08:45:19Z")

</div>

> [@Morne\_Supra](#):
>
> `DataError('No numeric types to aggregate',), skipping the job`

This is due to the way GroupBy objects handle the different [aggregation](http://net-informations.com/ds/pda/agg.htm) methods. In fact sum and mean are handled differently. GroupBy.mean function call dispatches to self.\_cython\_agg\_general which checks for numeric types and in case it doesn’t find any (which is the case for your example) it raises a DataError. Though the call to self.\_cython\_agg\_general is wrapped in try/except in case of a GroupByError it just re-raises and DataError inherits from GroupByError. Thus the exception.

By applying pd.to\_numeric you convert them to numeric type and the agg works.

---

<div class="post-metadata">

**Author:** ![andrewm4894](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/andrewm4894/32/125_2.png) [@andrewm4894](https://community.netdata.cloud/u/andrewm4894)\
**Post date:** [April 27, 2021, 8:50am UTC](https://community.netdata.cloud/t/anomalies-section-missing-on-local-agent-dashboard-and-on-cloud/770/13 "2021-04-27T08:50:33Z")

</div>

Thanks @sambutle for that awesome explanation!

I think i have seen this come up sometimes too if i set the configuration for the collector to cover a handful of charts that sometimes return “None” or “null” via the rest api. It’s usually transient most of this time iirc. But it would be nice to handle this better in some way within the collector i think, just not 100% sure how would be as graceful as possible a way to do it without having to add more complex logic or data validation of some sort.

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/netdata2/original/1X/95a9c096b648126c4ba002c73e1eef483b082454.png)
