Hello!
The topic says it by itself. I have configured monitoring for failed task via API, and i got a little confused with results i got. It is not a big issue, anyway, because template is checking for an endtime value.
Here are responses with different filters
Here is everything totally OK, as i expected, two running tasks, total is 2
	
	
	
		
	
	
		
			
	
Strange things start here. Same two running task and indeed task that has been finished with an error. And total is 4 somehow
	
	
	
		
	
	
		
			
	
Well, lets specifically exclude running tasks, but... Nope, same two running tasks and different erroneous task. Total is 4 again
	
	
	
		
	
	
		
			
	
For some reason running tasks always end up in errors=true filter. Is this a bug?
Thank you
				
			The topic says it by itself. I have configured monitoring for failed task via API, and i got a little confused with results i got. It is not a big issue, anyway, because template is checking for an endtime value.
Here are responses with different filters
Here is everything totally OK, as i expected, two running tasks, total is 2
		Code:
	
	curl -k -X GET 'https://PBS:8007/api2/json/nodes/0/tasks?running=true' -H 'Authorization: PBSAPIToken=xxxxxxxxx' | jq{
"total": 2,
"data": [
{
"upid": "UPID BS:00000278:000003BA:00000322:67DBA0D0:syncjob",
BS:00000278:000003BA:00000322:67DBA0D0:syncjob",
"node": "localhost",
"pid": 632,
"pstart": 954,
"starttime": 1742446800,
"worker_type": "syncjob",
"worker_id": "xxx:xxx:xxx ve-htznr-5:s-6077bf49-51d4",
ve-htznr-5:s-6077bf49-51d4",
"user": "root@pam"
},
{
"upid": "UPID BS:00000278:000003BA:0000031E:67DB92C0:syncjob",
BS:00000278:000003BA:0000031E:67DB92C0:syncjob",
"node": "localhost",
"pid": 632,
"pstart": 954,
"starttime": 1742443200,
"worker_type": "syncjob",
"worker_id": "xxx:xxx:xxx:xxx:s-1201e66e-98ff",
"user": "root@pam"
}
]
}
		"total": 2,
"data": [
{
"upid": "UPID
 BS:00000278:000003BA:00000322:67DBA0D0:syncjob",
BS:00000278:000003BA:00000322:67DBA0D0:syncjob","node": "localhost",
"pid": 632,
"pstart": 954,
"starttime": 1742446800,
"worker_type": "syncjob",
"worker_id": "xxx:xxx:xxx
 ve-htznr-5:s-6077bf49-51d4",
ve-htznr-5:s-6077bf49-51d4","user": "root@pam"
},
{
"upid": "UPID
 BS:00000278:000003BA:0000031E:67DB92C0:syncjob",
BS:00000278:000003BA:0000031E:67DB92C0:syncjob","node": "localhost",
"pid": 632,
"pstart": 954,
"starttime": 1742443200,
"worker_type": "syncjob",
"worker_id": "xxx:xxx:xxx:xxx:s-1201e66e-98ff",
"user": "root@pam"
}
]
}
Strange things start here. Same two running task and indeed task that has been finished with an error. And total is 4 somehow
		Code:
	
	curl -k -X GET 'https://PBS:8007/api2/json/nodes/0/tasks?typefilter=syncjob&errors=true&limit=3' -H 'Authorization: PBSAPIToken=xxxxxxxxx' | jq{
"total": 4,
"data": [
{
"upid": "UPID BS:00000278:000003BA:00000322:67DBA0D0:syncjob:",
BS:00000278:000003BA:00000322:67DBA0D0:syncjob:",
"node": "localhost",
"pid": 632,
"pstart": 954,
"starttime": 1742446800,
"worker_type": "syncjob",
"worker_id": "xxx:xxx:xxx:xxx:s-6077bf49-51d4",
"user": "root@pam"
},
{
"upid": "UPID BS:00000278:000003BA:0000031E:67DB92C0:syncjob",
BS:00000278:000003BA:0000031E:67DB92C0:syncjob",
"node": "localhost",
"pid": 632,
"pstart": 954,
"starttime": 1742443200,
"worker_type": "syncjob",
"worker_id": "xxx:xxx:xxx:xxx:s-1201e66e-98ff",
"user": "root@pam"
},
{
"upid": "UPID BS:00000278:000003BA:000001F8:67BDC51B:syncjob",
BS:00000278:000003BA:000001F8:67BDC51B:syncjob",
"node": "localhost",
"pid": 632,
"pstart": 954,
"starttime": 1740490011,
"worker_type": "syncjob",
"worker_id": "xxx:xxx:xxx:xxx:s-6077bf49-51d4",
"user": "root@pam",
"endtime": 1740490012,
"status": "sync aborted"
}
]
}
		"total": 4,
"data": [
{
"upid": "UPID
 BS:00000278:000003BA:00000322:67DBA0D0:syncjob:",
BS:00000278:000003BA:00000322:67DBA0D0:syncjob:","node": "localhost",
"pid": 632,
"pstart": 954,
"starttime": 1742446800,
"worker_type": "syncjob",
"worker_id": "xxx:xxx:xxx:xxx:s-6077bf49-51d4",
"user": "root@pam"
},
{
"upid": "UPID
 BS:00000278:000003BA:0000031E:67DB92C0:syncjob",
BS:00000278:000003BA:0000031E:67DB92C0:syncjob","node": "localhost",
"pid": 632,
"pstart": 954,
"starttime": 1742443200,
"worker_type": "syncjob",
"worker_id": "xxx:xxx:xxx:xxx:s-1201e66e-98ff",
"user": "root@pam"
},
{
"upid": "UPID
 BS:00000278:000003BA:000001F8:67BDC51B:syncjob",
BS:00000278:000003BA:000001F8:67BDC51B:syncjob","node": "localhost",
"pid": 632,
"pstart": 954,
"starttime": 1740490011,
"worker_type": "syncjob",
"worker_id": "xxx:xxx:xxx:xxx:s-6077bf49-51d4",
"user": "root@pam",
"endtime": 1740490012,
"status": "sync aborted"
}
]
}
Well, lets specifically exclude running tasks, but... Nope, same two running tasks and different erroneous task. Total is 4 again
		Code:
	
	curl -k -X GET 'https://PBS:8007/api2/json/nodes/0/tasks?running=false&errors=true&limit=3' -H 'Authorization: PBSAPIToken=xxxxxxxxx' | jq{
"total": 4,
"data": [
{
"upid": "UPID BS:00000278:000003BA:00000322:67DBA0D0:syncjob",
BS:00000278:000003BA:00000322:67DBA0D0:syncjob",
"node": "localhost",
"pid": 632,
"pstart": 954,
"starttime": 1742446800,
"worker_type": "syncjob",
"worker_id": "xxx:xxx:xxx:xxx:s-6077bf49-51d4",
"user": "root@pam"
},
{
"upid": "UPID BS:00000278:000003BA:0000031E:67DB92C0:syncjob",
BS:00000278:000003BA:0000031E:67DB92C0:syncjob",
"node": "localhost",
"pid": 632,
"pstart": 954,
"starttime": 1742443200,
"worker_type": "syncjob",
"worker_id": "xxx:xxx:xxx:xxx:s-1201e66e-98ff",
"user": "root@pam"
},
{
"upid": "UPID BS:00182027:23BA733D:00000000:67DB5E78:aptupdate::root@pam:",
BS:00182027:23BA733D:00000000:67DB5E78:aptupdate::root@pam:",
"node": "localhost",
"pid": 1581095,
"pstart": 599421757,
"starttime": 1742429816,
"worker_type": "aptupdate",
"worker_id": null,
"user": "root@pam",
"endtime": 1742429816,
"status": "unknown"
}
]
}
		"total": 4,
"data": [
{
"upid": "UPID
 BS:00000278:000003BA:00000322:67DBA0D0:syncjob",
BS:00000278:000003BA:00000322:67DBA0D0:syncjob","node": "localhost",
"pid": 632,
"pstart": 954,
"starttime": 1742446800,
"worker_type": "syncjob",
"worker_id": "xxx:xxx:xxx:xxx:s-6077bf49-51d4",
"user": "root@pam"
},
{
"upid": "UPID
 BS:00000278:000003BA:0000031E:67DB92C0:syncjob",
BS:00000278:000003BA:0000031E:67DB92C0:syncjob","node": "localhost",
"pid": 632,
"pstart": 954,
"starttime": 1742443200,
"worker_type": "syncjob",
"worker_id": "xxx:xxx:xxx:xxx:s-1201e66e-98ff",
"user": "root@pam"
},
{
"upid": "UPID
 BS:00182027:23BA733D:00000000:67DB5E78:aptupdate::root@pam:",
BS:00182027:23BA733D:00000000:67DB5E78:aptupdate::root@pam:","node": "localhost",
"pid": 1581095,
"pstart": 599421757,
"starttime": 1742429816,
"worker_type": "aptupdate",
"worker_id": null,
"user": "root@pam",
"endtime": 1742429816,
"status": "unknown"
}
]
}
For some reason running tasks always end up in errors=true filter. Is this a bug?
Thank you
 
	 
	