Target is "in_use=1" but there is no task associated with the target

I am automating with python-gvm script. i met a problem as title. my steps are as below.

my questions are :

a. what else element could make a target “in_use” besides a Task element?
b. once we met this problem, is there any way to quickly set a target NOT “in_use”? I have tried restart gvmd.service, but it not work.

PS: i didn’t do any force restart action before i met the problem.

problematic steps:

1.historically, i created target with resp = gmp.create_target( name=name, comment=comment, hosts=hosts, port_list_id=port_list_id ) where i set all the variables already, and it is validated with the value by several successful runs.

2.i suddenly find the problem one day.

3.i run single cmd in gvm-pyshell with gmp.get_targets() which i think shows all the targets created by gvm-tools, i find a target “in_use” = 1

4.i run gvm-pythell with gmp.get_tasks() to get all the tasks data but i can not the target that “in_use”=1 associated in the task. by “target id=” value.

An update:

restart the gvmd.service not change anything.

Just a guess, but it could be in_use by a credential or a report. Perhaps also by other object constructs such as a result.

Yes, the dependency is on report. i could delete the target after i delete the corresponding report.
I didn’ t find out before is the reason that by default the gmp.get_reports() restricted the output to only 10 rows. with only 10 rows hided the reports that are over 10 which misunderstood me that i have cleared the dependency fully.
so, as a summary in my case, target “in_use=1” means:
existing task
existing report
is depended by the target.