Agent 2.0.3.0 -exit code is 259 => Unknown code

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

Bug Description

After installing the New Agent on all of our servers, they all seem to be reporting back fine , but they are full of errors in event viewer

Service encounter error <OCS Inventory NG Agent encounter an error (exit code is 259 => Unknown code !)>.

whats does this mean and how do we fix it?

Revision history for this message
Alexandre Cop (a-cop) wrote :

+1 on this, I can also see it on the servers as well as my desktop (Win7 x64), same error message.

Revision history for this message
makeijan (makeijan) wrote :

Win 7 x32 shows it as well.

Revision history for this message
passianer (passianer) wrote :

I have the same problems on Windows 7 (x32 and x64) and Windows XP Clients. I think the bug occurs because the windows service of ocs is blocking the file ocsinventory.ini when the ocsinventory.exe wants to write the values TTO_WAIT=25920, PROLOG_FREQ=12, OLD_PROLOG_FREQ=12. When I kill the windows service and start the inventory.exe manually there is no message in the event log and the values are written in ocsinventory.exe

Revision history for this message
hackensolo (hackensolo) wrote :

After checking the OCSInventory.log i got these errors

Starting OCS Inventory NG Agent on Thursday, December 08, 2011 11:39:10.
AGENT => Running OCS Inventory NG Agent Version 2.0.3.0
AGENT => Using OCS Inventory NG FrameWork Version 2030
AGENT => Loading plug-in(s)
AGENT => Using network connection with Communication Server
AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.0.3.0>
AGENT => Sending Prolog
AGENT => Prolog successfully sent
SUPPORT => No support detected, Registration key : N/A
ERROR *** AGENT => Failed to write Prolog Frequency <Error code 32 = The process cannot access the file because it is being used by another process. >
AGENT => Inventory required
AGENT => Launching hardware and software checks
AGENT => Communication Server ask for Registry Query
AGENT => Communication Server ask for Package Download
DOWNLOAD => Download and setup tool successfully started
AGENT => Sending Inventory
INVENTORY => Inventory changed since last run
AGENT => Inventory successfully sent
AGENT => Unloading communication provider
AGENT => Unloading plug-in(s)
AGENT => Execution duration: 00:00:07.

The Agent can talk to server , but does this error relate to the one above...?

Revision history for this message
JF Weber (jfw-ho) wrote :

Same behavior on our Windows 2003 R2 x64 servers
One of then as rebooted unexpectedly since the setup of 2.03 Windows agent yesterday (this server was stable before, but may or may be no direct relation : we have no log on this)

Revision history for this message
Biblo (florian-bidault) wrote :

Hi,

I have the same problem on 20 servers (2008 32 and 64 bit).

Revision history for this message
passianer (passianer) wrote :

sorry I made one mistake in my last comment:

the last part should be:

When I kill the windows service and start the inventory.exe manually there is no message in the event log and the values are written in ocsinventory.ini (not ocsinventory.exe)

Revision history for this message
ElNounch (elnounch) wrote :

Should be a (disturbing) visual glitch only.

Seems like the Agent is trying to update PROLOG_FREQ parameter of ocsinventory.ini ( Agent/OCSInventory.cpp lines 404-415 ) but the file is lock by the Service due to the Service doing the update by itself ( Service/OcsService.cpp line 456 ) and avoiding external nuisances.

No idea if there is a need for the ini-file being updated by the Agent if not run from Service (needing an additional new argument being sent to the Agent telling him not to do this ini-file update if run from service) or not (in this case, deleting the eleven lines from Agent should solve the problem).

I'm not familiar enough with the whole OCS Windows Agent stuff to help more in closure of the bug but, even if the thing is fully functional, having erroneous stuff logged in Sysevent is very unpleasant.

Revision history for this message
ElNounch (elnounch) wrote :

Seems to be link with bug #904162 and due to problems on files unlocking before launching Agent.

Revision history for this message
ElNounch (elnounch) wrote :

Had a deeper look, problem was enlighted by r292 because lack of capture trigger a code path not waiting for the Agent's end.
Attached is a patch proposal correcting the behaviour of CExecCommand::wait

Revision history for this message
Gerold Gruber (gruber-citkomm) wrote :

problem seen here too, on various platforms

Changed in ocsinventory-windows-agent:
status: New → In Progress
assignee: nobody → eguillory (emmanuel-guillory)
Revision history for this message
Gerold Gruber (gruber-citkomm) wrote :

is this odd exit code related to the following entry in the log file:
"ERROR *** AGENT => Failed to write Prolog Frequency <Error code 32 = Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird. >" ?
if I try to translate the German part of the error message, I get
ERROR *** AGENT => Failed to write Prolog Frequency <Error code 32 = the process cannor access a file, bacause it is used by another process >

Revision history for this message
eguillory (emmanuel-guillory) wrote :

Probably, but not tested yet.
In fact bugs linked to a write right sould be solved.

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

Hi All,

I've included ElNounch patch, in a little different way. Many thanks ElNounch.

I'm doing some last test scripts and I will release a new version in 2 or 3 days.

Many thanks everybody.

Cheers

Changed in ocsinventory-windows-agent:
assignee: eguillory (emmanuel-guillory) → Didier Liroulet (dliroulet)
Revision history for this message
Didier Liroulet (dliroulet) wrote :

Hi.

Fix for this bug is released in agent 2.0.3.1, available from https://bugs.launchpad.net/ocsinventory-windows-agent/+bug/765893/+attachment/2693154/+files/OCSNG-Windows-Agent-2.0.3.1.zip

Really, many thanks to ElNounch

Regards

Changed in ocsinventory-windows-agent:
status: In Progress → Fix Committed
importance: Undecided → Medium
Revision history for this message
Josué Mouco (josue-mouco) wrote :

Hi there,

Thank you for the the fix!

Acutally, I tried to create a package through the OCS packager but at the end of the process it says: "Error writing output files on:C:\xxxxx".

Do you know why?

Otherwise, I tried to install manually the agent on one machine, I have an Error in the System event with the ID 7030 and says: "The OCS Inventory Service service is marked as an interactive service. However, the system is configured to not allow interactive services. This service may not functionThe OCS Inventory Service service is marked as an interactive service. However, the system is configured to not allow interactive services. This service may not function properly. properly."

Revision history for this message
Carlos Colon (espacio-sideral) wrote :

Hi,

The package https://bugs.launchpad.net/ocsinventory-windows-agent/+bug/765893/+attachment/2693154/+files/OCSNG-Windows-Agent-2.0.3.1.zip is corrupted.

I'll try to install it on a Windows Vista 64 and on a Win 7 64, in both cases I have the same error "Error opening file for writing C:\Program Files (x86)\OCS Inventory Agent\OcsService.exe"

Any suggestions?

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

Hi Josué,

The error is clear. You must configure the system to allow OCS Inventory Service as interactive ! This is a known limitation og 2.0 release, which will be fixed in 2.1.

Carlos,

Package is not corrupted. I think the installer is to not able to stop service, either because your not logged in as adminsitrator, or because you've not launched installer with enhanced privileges.

Cheers

Revision history for this message
Josué Mouco (josue-mouco) wrote :

Hi Didier,

Thank you for your answers.

Regarding the interactive service, I don't want OCS to send message to users. Is there any problem if I let the service as it is: Stopped?

What about the OCS Packager with the Agent 2.0.3.1 who gives an error: "Error writing output files on:C:\xxxxx"

Revision history for this message
makeijan (makeijan) wrote :

Hi,

I've deployed the new agent and tested teledeploy. Now the log is plain clean :-)

Thank you

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

Many thanks makeijan.

Josué,

The problem with packager is not related to this bug.

So please, ask question in the forum with full packager log or post a bug for OCS Packager. However, i don't think it is a bug, but i suggest you to ensure admin credentials used in Packager are right. Thanks by advance

Kind regards

Revision history for this message
ElNounch (elnounch) wrote :

Glad I could gave an hand !
Deploying 2.0.4 at moment. So far, so good on memory and event viewer side.

Revision history for this message
Josué Mouco (josue-mouco) wrote :

Hey ElNounch,

Where did you get it?

Revision history for this message
Gerold Gruber (gruber-citkomm) wrote :

First tests with 2.0.4.0 client look good.

There is only one thing in the logs file that produces a question mark in my head:
the line
ADMIN INFOS => Couple ( TAG <=> my.clients.tag ) added to configuration file
what does this mean?
There was no such line in the configuration file (if "configuration file" refers to the .ini-file),
and no such line was created by running the agent.

If I add such a line in the ini-file manually, the log entry remains.

So what does this mean?

Revision history for this message
Gerold Gruber (gruber-citkomm) wrote :
Revision history for this message
Didier Liroulet (dliroulet) wrote :

Hello Gerold,

It means that you've added administrative data (TAG in your case) in admin console for this computer, and agent store a backup copy on local computer, in case of server crash...

However, admin data stored on computer will override server stored data only if server does not know the data.

Cheers

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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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