Package's execution status does not change when upgrading agent

Bug #1079151 reported by Ubik
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OCS Inventory: Windows Agent
Fix Released
Medium
Didier Liroulet

Bug Description

I have already tested upgrade of an agent.
OCS-NG_windows_client_v4054 => OCS-NG_WINDOWS_AGENT_v2.0.5.2 through deployment feature.

OCS-NG-Windows-Agent-Setup.exe /S /NOSPLASH /UPGRADE /NO_SYSTRAY /SERVER=xxx ... /USER=xxx /PWD=xxx /SSL=1 /DEBUG=1

According to the wiki http://wiki.ocsinventory-ng.org/index.php/Documentation:WindowsAgent
status should be updated.

"""
/UPGRADE to deploy new agent through OCS deployement feature. Because you upgrade agent using agent itself to run the upgrade, it is needed to notify the installer (which terminates agent's processes) to specify the result in order to send it back to the server next time agent will run .
"""

Although, agent upgraded and sent inventory successfully status remained "NOTIFIED"

Revision history for this message
Nachtfalke (alexander-wilke) wrote :

Hi,

I saw this bug to late and I posted on the forum:
http://forums.ocsinventory-ng.org/viewtopic.php?id=11915

I have the problem that the agent's EXIT_CODE is 29. After that the most parts of the agent were updated but the Service version does not get updated.

For me personally I do not see any other chance to upgrade all my clients because my clients are not in a domain and so I cannot use GPOs for that.

Revision history for this message
Nachtfalke (alexander-wilke) wrote :

I did some further tries with deployment of the agent and it seems that the problem only occurs on Windows 7 computers.
Windows XP computers seem to update all parts of the agent correctly.

On Windows 7 machines there is the EXIT_CODE_29 and the "service" part of the agent was not updated.

The fact that in future most computers are running Windows 7 because Windows XP is running out of Microsoft support gives this bug a higher priority I think.

I tried with these parameters without any difference:

OCS-NG-Windows-Agent-Setup.exe /S /NOSPLASH /UPGRADE /NO_SYSTRAY /SERVER=xxx /SSL=0 /DEBUG=1
OCS-NG-Windows-Agent-Setup.exe /S /NOSPLASH /UPGRADE /NOW /NO_SYSTRAY /SERVER=xxx /SSL=0 /DEBUG=1
OCS-NG-Windows-Agent-Setup.exe /S /NOSPLASH /FORCE /UPGRADE /NO_SYSTRAY /SERVER=xxx /SSL=0 /DEBUG=1

Revision history for this message
Didier Liroulet (dliroulet) wrote :

Hi.

Could you try deploying agent using the following script:

@echo off
REM Make a copy of installer to TEMP folder
copy OCS-NG-Windows-Agent-Setup.exe %TEMP%\OCS-NG-Windows-Agent-Setup.exe
REM Launch uninstall of old agent
START /WAIT %PROGRAMFILES%\OCS Inventory Agent\uninst.exe /S
REM Install new agent
%TEMP%\OCS-NG-Windows-Agent-Setup.exe /S /NOSPLASH /UPGRADE /NO_SYSTRAY /SERVER=xxx /SSL=0 /DEBUG=1

As I'm not able to reproduce this problem on my windows 7 VM, very difficult for me to identify the main cause.

Cheers

Changed in ocsinventory-windows-agent:
assignee: nobody → Didier Liroulet (dliroulet)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Nachtfalke (alexander-wilke) wrote :

Just tested on one machine but for me this results in a "loop".
The agent will be updated but it stays in "NOTIFIED" and so will be rerun everytime agent starts again.

Further the script variable "%PROGRAMFILES%" just works on x86 systems but not on x64 systems. Not sure if such a check is in the installer of the agent.exe or not.

The file "OCSNG-Windows-Agent-Setup_done" will be created and contains 3 lines. The first is "SUCCESS" and the other two lines are empty. It is placed here:
C:\ProgramData\OCS Inventory NG\Agent\download

The package in the download folder has the name "1363205496" and the exec_try file contains "1"

I would assume that if "OCSNG-Windows-Agent-Setup_done" contains success then the agent should report that back to server and delete the folder "1363205496" so that it does not result in a loop. Further after 3 times running the agent the exec_try remains on "1" - but I can see that the timestamp of this file will be updated every time I run the agent.

Just for information - I upgraded from 2.0.5.2 to 2.0.5.3 and I modified your script a little bit to make it work on my system:

[code]
@echo off
REM Make a copy of installer to TEMP folder
copy /Y OCS-NG-Windows-Agent-Setup.exe C:\Windows\Temp\OCS-NG-Windows-Agent-Setup.exe
REM Launch uninstall of old agent
cmd.exe /C C:\"Program Files (x86)\OCS Inventory Agent\uninst.exe" /S
REM Install new agent
C:\Windows\Temp\OCS-NG-Windows-Agent-Setup.exe /S /NOSPLASH /UPGRADE /SERVER=http://172.17.240.200/ocsinventory /SSL=0 /DEBUG=1
exit 0
[/code]

I tested this on Windows 7 x64 Enterprise.

Revision history for this message
Didier Liroulet (dliroulet) wrote :

OK, agent 1.x uninstaller is able to remove agent service before 2.X installer upgrade service.

I will look at this.

I think it is linked to service eventlog registration :-(

Regards

Revision history for this message
Didier Liroulet (dliroulet) wrote :

OK, I think I've fund the problem.

When uninstalling upgrading old agent, service is only stopped, not unregistered from Windows service control manager. Then files are upgraded.

But one file is used by event manager to display event log message, and i think it is this file which sometimes is not upgradable.

So, in next release, old service will be completely unregistered before installling new agent 2.X service.

Regards

Changed in ocsinventory-windows-agent:
status: In Progress → Fix Committed
Revision history for this message
Nachtfalke (alexander-wilke) wrote :

This sound really good :-))

Changed in ocsinventory-windows-agent:
milestone: none → 2.1rc1
Changed in ocsinventory-windows-agent:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.