[git5040] snapinJobs with HostID 0 appear
-
In the table snapinJobs entries with (sj)HostID appear when a host computer (with client 0.95) is turned on:
+------+----------+-----------+---------------------+ | sjID | sjHostID | sjStateID | sjCreateTime | +------+----------+-----------+---------------------+ | 1 | 0 | 5 | 2015-10-22 11:32:44 | | 2 | 0 | 5 | 2015-10-22 11:37:01 | | 3 | 0 | 5 | 2015-10-22 11:38:04 | | 4 | 0 | 5 | 2015-10-22 11:39:06 | +------+----------+-----------+---------------------+
Between 11:32 and 11:37 the computer was restarted. Before the restart I truncated the table snapinJobs.
- It isn’t triggered only by a special host computer turned on. I tested it with more computers
- The table “hosts” begins with hostID 1.
- On the web interface there are no open/waiting snapin tasks.
- The table “snapinTasks” contains some already finished tasks with “stState” -> “4”.
- The table “snapinAssoc” contains just entries with saHostID beginning from “1”.
Is there any more information needed to solve this?
-
I think we need more information.
The fact that they’re showing up with a stateID of 0, leads me to believe there were snapinJobs associated to the host, and it was then updated to be in a cancelled state because of how the code runs. If there’s a job that hasn’t been closed out properly, to ensure a new tasking occurs properly, it cancels all of that hosts jobs (and snapin task associations). that’s what the stateID 5 is.
I’ve modified to make a bit better handling too now. Maybe it will be much faster, and less numerically dependent.
-
I’ve modified the cleanup code for the cancellation of older snapin tasks/jobs. It will now appropriately setup the return code and details for those tasks that did need to get cancelled so our logging (Snapin History) should represent properly. It doesn’t have to loop any data to do the same thing anymore.
-
I just tested with git5074 and the entries with sjHostID 0 still are created, when a host computer is turned on.
On the host computer the client checks for snapins every minute without any error:
------------------------------------------------------------------------------ ---------------------------------SnapinClient--------------------------------- ------------------------------------------------------------------------------ 26.10.2015 10:22 Client-Info Version: 0.9.5 26.10.2015 10:22 SnapinClient Running... 26.10.2015 10:22 Middleware::Communication URL: http://SERVER-IP/fog/service/servicemodule-active.php?moduleid=snapinclient&mac=ONBOARD-MAC|VM-MAC|&newService=1 26.10.2015 10:22 Middleware::Communication Response: Success 26.10.2015 10:22 Middleware::Communication URL: http://SERVER-IP/fog/service/snapins.checkin.php?mac=ONBOARD-MAC|VM-MAC|&newService=1 26.10.2015 10:22 Middleware::Communication Response: No snapins ------------------------------------------------------------------------------
More things I tested:
- truncated the Table snapinTasks -> “sjHostID 0” entries still created
– (I still think about why there is/was status code “4” - I just remember 1 for running and 2 for finished) - disabled the Snapins service in the Service Configuration of one host -> for this host no “sjHostID 0” entries are created anymore
– enabling the Snapin service for this hosts again -> “sjHostID 0” entries are created every minute again for this host
Which table content/error log i can provide to help to find out why that is caused?
- truncated the Table snapinTasks -> “sjHostID 0” entries still created
-
I did a quick test with git5122 - (two computers turned on, Snapin service activated, no snapin task) - and it seems to be fixed:
- no new “sjHostID 0” entries in snapinJobs are created anymore - also not after truncate snapinJobs
I try to test some more with snapins and report if anything doesn’t work.
-
@tian just let me know if I can solve the thread and thanks for reporting back.
-
-
on the web interface (Taskmanagement -> OK
– the active snapin task was there
– after running the snapin the task vaished -
on the web interface (snapin log -> not OK
– i can select the date range of today
– no log of the just run snapin was found (“no results found”)
– the csv export is empty (just the headers) -
on the client (OK
– the client icon messages that the snapin(s) is/are running or finish appear when a user is logged in
– the client is able to see the snapin and runs it - return code of the batch file is 0 (information from the fog.log on the client) -
in the database ((not) OK??
– snapinJobs:
+------+----------+-----------+---------------------+ | sjID | sjHostID | sjStateID | sjCreateTime | +------+----------+-----------+---------------------+ | 1 | 21 | 4 | 2015-10-29 12:40:15 | | 2 | 21 | 4 | 2015-10-29 12:59:37 | +------+----------+-----------+---------------------+
– snapinTasks:
+------+---------+---------+---------------------+---------------------+------------+--------------+-----------------+ | stID | stJobID | stState | stCheckinDate | stCompleteDate | stSnapinID | stReturnCode | stReturnDetails | +------+---------+---------+---------------------+---------------------+------------+--------------+-----------------+ | 1 | 1 | 4 | 2015-10-29 12:40:30 | 2015-10-29 12:40:31 | 1 | 0 | | | 2 | 2 | 4 | 2015-10-29 13:00:00 | 2015-10-29 13:00:01 | 1 | 0 | | | 3 | 2 | 4 | 2015-10-29 13:00:01 | 2015-10-29 13:01:36 | 11 | 0 | | +------+---------+---------+---------------------+---------------------+------------+--------------+-----------------+
I started the “All Snapins” at advanced actions two times for this host. the first time with one snapin, the second time with 2 snapins on the host.
Running a single snapin with the single snapin advanced action behaves the same like above. -
-
@tian was the snapin completed today?
-
@Tom-Elliott said:
@tian was the snapin completed today?
Yes - the snapins have been completed on the host. I could verify the changes have been made there.
The snapins with the ID 1 and 11 are simple batch files with some simple commands - the snapin with ID11 additionally contains wait commands for 90 seconds in total. -
@tian can you update? I fixed a few problems last night and snapin logs were one of them.
-
@Tom-Elliott Thanks - git5135 fixed the snapin log:
- “active snapins” are added/removed correctly -> OK
- snapins are running ok on the client -> OK
- the snapin log displays the database content correctly again (it added the new snapin tasks additionally to the ones from yesterday)** -> OK**
- the snapin status still is reported as “4” in snapinJobs and snapinTasks -> OK?
- no “sjHostID 0” entries in snapinJobs are created from hosts only started up/running -> OK