---
title: "Autodiscoverymanager stuck and not working"
description: "Autodiscoverymanager in Opsview may get stuck, causing scans to fail and the status to flip between Configured and Pending without running. The issue can be resolved by stopping autodiscovery, removing the pid file, and restarting autodiscovery to restore normal operation."
url: "https://docs.itrsgroup.com/docs/faq/opsview/8805275586845-opsview-autodiscoverymanager-stuck-and-not-working/index.html"
---
## Symptoms

In the UI when you click the Green (Start Scan) Arrow and the status flips from Configured to Pending and back again, It does not look like there is a running scan,

---
Logging in file `opsview.log` will look something like the below when attempting to run a network scan (also logged in syslog)

```
Jan 1 08:01:00 orchestrator-ops opsview-autodiscoverymanager[203794]:
Failed to execute scanning tool: Can't call method "publish" on an undefined value at
/opt/opsview/tmp/autodiscoverymanager/par-6f707376696577/
cache-6c4749b65d1c56a679f38732aba47c348aebb1c3/
inc/lib/OpsviewAutoDiscoveryManager.pm line 933.
```

## Causes

OP-39248 & OP-32859

diagnosis of this bug: if a message-queue restart happens at any point, the autodiscoverymanager is then broken until it restarts itself.

## Workaround

1. Stop autodiscovery

   ```
   /opt/opsview/watchdog/bin/opsview-monit stop opsview-autodiscoverymanager
   ```

2. Remove the pid file for autodiscovery

   ```
   rm -f /opt/opsview/autodiscoveryscanner/var/autodiscoveryscanner.pid
   ```

3. Start autodiscovery

   ```
   /opt/opsview/watchdog/bin/opsview-monit start opsview-autodiscoverymanager
   ```

---

I suggest you do the below, if the above does not fix your issue (take a **backup** of the file just to be safe)

```
rm -rf /opt/opsview/tmp/autodiscoverymanager/par-6f707376696577/
cache-6c4749b65d1c56a679f38732aba47c348aebb1c3/inc/lib/OpsviewAutoDiscoveryManager.pm
```

Your logging will look like the below if all is working:

```
Jan 1 09:02:00 orchestrator-ops opsview-autodiscoveryscanner[2350259]:
Starting scan
Jan 1 09:02:00 orchestrator-ops opsview-autodiscoveryscanner[2350259]:
Scanning 200 hosts
```

and the UI should say running


