New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows - Error starting GLPI Agent service #584
Comments
this is the first time I heard about such issue. Maybe something in your conf is triggering an issue. Have you a screenshot of the error users receive ? Is GLPI-Agent service running after the error is reported ? |
Okay, so indeed, this is a problem related to GLPI-AgentMonitor. It fails to access GLPI-Agent service. I think this can happen if the service failed to start or is still not fully started when the user logs. I'm not sure, @redddcyclone have you any clue to understand why such error can occur in GLPI-AgentMonitor? @ngaillard-gantois You still can disable GLPI-AgentMonitor on computers where it happens too often. P.S.: @redddcyclone probably the error message should still be more accurate so users knows the error is identified by GLPI-AgentMonitor |
Hi all @ngaillard-gantois could you execute the command @g-bougard Error 0x00000424 is |
So maybe the agent installation just failed. @ngaillard-gantois you'll have to verify if agent service is really installed on the related computers. And maybe just reinstalling the agent can fix the problem. |
I will communicate with our users to call us right when the error happening. |
@g-bougard I have just commited the change you requested. GLPI Agent Monitor now prints the error message together with the code and I replaced the error message box caption from just "Error" to "GLPI Agent Monitor - Error" |
I checked on two computers and service is not present when I use sc.exe query glpi-agent |
so the agent service has not been enabled or it fails to start. Can you figure out why ? Is it set to manual starting or did you forget to set a |
Also check the |
Can you run the script with
|
just a point I remember, are you eventually using an old vbs ? I mean, did you use the same vbs from an older version for which you just updated the agent version ? |
I have the latest version of VBS since the deployment of 1.6.1. I have checked another computer today and no problem with cscript after set Reconfigure to Yes. On reconfigure = No, the VBS say GLPI agent is already installed but without service on the computer. I will check with the users in start of next week to see if it's ok or not. |
Today I have the same error on my computer after I reboot, but the service is present (with sc.exe query glpi-agent). I think this time the message appears on GPO execution and reconfiguration of GLPI agent. I don't have more information with other users right now, but I will continue to track this issue in our company. |
I was having a similar problems trying to update all our agents on our network. Using PDQ Deploy, I ended up running a script to stop the glpi-agent process from version 1.5 and uninstall using the 1.5 installer and then running the 1.7.1 installer. So far this has been the only way without getting some weird error. I havent noticed any other errors and the new services seems to exist. We are using the agent-monitor and it has it's own process. This is my first time updating the agents remotely but it seems like once we finish the re-install, the computer needs to be restarted for the agent monitor to relaunch. So what my steps were 1: Script to stop-process on "glpi" to stop -- Stops all active glpi processses If you have the agent monitor you need to restart the computer which I will do during off hours. |
Hi @MarcSamD
when you said "both using the new VBS script", can you confirm the version you're using ? or when did you download the version you modified ? Generally on windows, this kind of service installation error also happen when a file wasn't released by the operating system. This may happen for example if a service thread is blocked and still running so it locked files to be replaced. Were there any other errors in the log before that one ? Can you share from that log all the line related to a custom action containing "ServiceConfig" in its name ? i.e. "SchedServiceConfig", "ExecServiceConfig" & "RollbackServiceConfig". This may give some clue to understand if something is wrongly handled by WixToolSet service configuration custom action. |
Hi @g-bougard The VBS script that I used is the Dec 22, 2023 one (feat: GLPI Agent 1.7.1 release). The service error in my previous screenshot is the first error and difference between a good install and a failure. See below the others lines: |
To be sure, can you share the Windows OS version for each of that clients ? You can check the MSI log for such property lines:
Even |
All the properties are the same, the only difference is the user (system vs normal admin user). Details of the differences:All the Details of the same:
|
Hi @MarcSamD
Are you telling this problem occurs on a Windows 8.1 OS or Windows Server 2012 ? If yes, can you reproduce the problem on a more recent OS version ? To be honest, I won't investigate such problem on a such old system as the real problem could be related to a still fixed system bug. |
Hi @g-bougard , no the OS is Windows 10 Enterprise 22H2. WindowsBuild = 9600 is not reserved only for Windows 8.1. Windows 10 can be from 9400 and higher and in fact it seems that all the Windows 10.0 family share the same WindowsBuild 9600. |
Oh yes, I remember now they made some changes against that number. So MSI is not sharing the right buildnumber. Can you test and reproduce the problem with a nightly build ? If you can, I'll propose you to test a build without the ExecServiceConfig custom action as it seems to fails. That custom action is used to configure the service restart in case of failure. I guess this is just a symptom as it seems to fail because the service seems to have been marked for deletion if I trust the error message. Do you see any message before that error which explains why the service has been marked for deletion where it should just have been deleted ? I think this can only happen if a service used file is still opened. Would you mind to share the failing log so I can dig myself in it ? |
But these error messages also exist in the case of a successfull install. There are many cases a service cannot be deleted and a computer reboot is necessary before reinstallation. To avoid this, we should priorly close any handles opened to the service, but it is not so easy to find programatically. Still MMC (services panel) and GLPI Agent Monitor are two obvious culprit.
|
Okay, that error is anyway a problem if the service is still running and should have been stopped during an upgrade. I also think the problem is related to opened handles. I think I still had such trouble when having the service MMC panel opened. We should probably find a way to detect if handles are still opened for the service before trying to remove it. I wonder if I can add a check before the service deletion and after the service stop to decide to abort the upgrade id service is still running. You can send me privately your log in a zipped file toward: |
Thank you for the log. Anyway, the error on StopServices action is not relevant. Indeed, this one is normal as this action is started in different context and the only context we want it to be run is the uninstall of the previous version. And I think this step was working in your log. Even the DeleteServices action seems to work. This means the service is probably removed as expected during the uninstall of the previous version. Finally the first relevant error is this one:
Of course the 1923 error is probably wrong as the installer is running with elevated privileges. Have you checked the service is still defined in service MMC panel after such a failure ? If yes, it means it has not been deleted. You can eventually check the glpi-agent log to see if it has been stopped. If it has been, you should see in the MSI debug file which StopServices action triggered the stop. So if you see a stop in agent log file, and the service is still defined in MMC, this gives the clue the service has not been deleted. If you see the service is stopped in agent log and it is no more defined in MMC, this should tell us the installer really fails to install it, but actually I don't how this can happen. |
Yes, the service is still defined in service MMC panel after such a failure. |
I modified one thing in the installer and it will be available from next nightly build:
So I moved the registry setup in its own component. I hope this can fix the current problem as this involves less resources interaction during components uninstall:
A point, this fix will only apply during upgrade of an installation with at least next nightly build installed as the fix only apply during the uninstall. So to test, first install next nightly build and try an upgrade to an older nightly build. |
Same installation service errors with the new nightly builds. Testing procedure:
|
Scheduled Task ? Do you mean you run the VBS installer from a scheduled task to trigger the error ? I must check if I can reproduce with this way of doing. |
The task is named "GLPI-Agent Installation". As explained in my first comment, the main difference between directly using the VBS or deploying via a GPO is the account that will be used, SYSTEM in the 2nd case. Which is why creating a task running as SYSTEM and highest privileges is a good way to reproduce the same issue as GPO deployment. |
I made my own tests using scheduled tasks setup to run as LocalSystem which starts a batch, and this batch starts the vbs using cscript. I can't reproduce the failure while installing 1.8-git0f1e55b3 after 1.7.3 or 1.8-gitcf993421.
This is probably an issue with downgrade support. But this doesn't happen while upgrading. So do you always have failure on your side or only sometime ? What options are you using for the installer in your vbs files ? Can you detail how you define scheduled tasks to be sure I'm not missing something from the context. |
Hi @MarcSamD I think I found the problem: Glpi-AgentMonitor is still running and the installer is not able to stop it during the upgrade. I audited more deeply the Glpi-AgentMonitor code and found it always keep a opened handle on the service. So as the installer fails to end the process, this makes the installer fails on the service uninstall as a handler is still in use. Indeed, the installer manages to stop the monitor but only when you run the installer from the user session. So I modified the installer to kill the process in place of asking it to quit just before stopping the service. In my tests, this seems to fix the problem. I really don't know if this is also your problem. I hope the installer fix I pushed will fix your problem. Please test upgrades with the next nightly build. In my tests, this still works on upgrading from 1.7.3. @redddcyclone About the service opened handle, I think you should not keep that handle opened and request it each time you want to check the service status. I don't know if this can be a performance issue, but eventually you can use a greater delay to check service status. Actually, as I understand from the code Glpi-AgentMonitor checks service status every 100 ms. For any user feeling, I think this won't change anything if you use a delay of 250 ms, 300 ms or even 500 ms. FYI, maybe this is a good news, but with all the work on that problem, this gave me some clue to manage Glpi-AgentMonitor restart. I'll try to add this support in 1.8. |
Hi @g-bougard I don't remember why exactly I used a global service handle, maybe performance concerns... Actually, some revisions ago, the handles were managed locally inside a single function, opened and closed when needed. About the 100ms timer, it was a mistake on my part, I was likely testing and forgot to set it to a higher value. I'll make changes for this and commit them soon. Anyway, if you are able to, there's no problem in killing the monitor process forcefully if needed. Thanks! |
Yes, I missed that too and I still thank you @MarcSamD to have help me to identify that issue proposing a reliable way to reproduce.
Thanks you, I'm waiting you commits to update windows installer. I won't be available next week, so I'll integrate it the following week at last. This still will be before the next release, so that's fine ;-) My last commit has still modified the installer to just kill the monitor process. |
I have already commited this change to my repo! I tested uninstalling the agent under the Local System account (with psexec) while the Monitor was running and the uninstallation was successful. Please report me if you find any more problems! |
Thank you I'll check that on my come back after a week. I'm off right now. |
I confirm that GLPI-Agent update is now working under system account with the nighly 1.8-git0a77a793 and 1.8-gitd493d729. The last minor issue is that GLPI-AgentMonitor is not restarting automatically after updating the Agent, but a manual start or a computer reboot will fix it. |
Hi @MarcSamD thank you for that feedback and your investment to help us understand the problem. I'm confident now I can close this issue. About the last minor issue, as I said earlier, I think this should be possible in a near future, but I think this is too short for the next release. |
Bug reporting acknowledgment
Yes, I read it
Professional support
Yes, I know
Describe the bug
On Windows startup, many users get an error 0x000000424 with the message indicating an error to open GLPI Agent service.
Affected OS for now is Windows 10 Pro and Windows 11 Pro. Agent is installed via GPO with provided VBS script.
GLPI Agent version from 1.6 to 1.7.1 seems to be affected.
I didn't find helpful events in Event Viewer at first glance.
To reproduce
Expected behavior
Normal start without error
Operating system
Windows
GLPI Agent version
1.7, 1.6.1, 1.6
GLPI version
Not applicable
GLPIInventory plugin or FusionInventory for GLPI plugin version
GLPI Inventory v1.3.3
Additional context
No response
The text was updated successfully, but these errors were encountered: