Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.12.3 available

The official documentation can be found on https://wiki.ocsinventory-ng.org. Read it before asking your question.

Can't deploy package <EXIT_CODE_1>

Hey there,

I try to deploy a package, just for testing I try to deploy the latest VLC-Player.

So I put the 'vlc-3.0.10-win64.exe' and an 'install.bat' into a ZIP-archive.
I build a package using the action 'Execute / Lauch' and put the command 'install.bat'

The content of the 'install.bat' is the following:


vlc-3.0.10-win64.exe /L="1031" /S
exit 0


If I click the 'install.bat' manually it works with no problem and installs the VLC-Player silently in background.

If I activate and assign the the package to my workstation, the download will work but not the installation. The Logs says <EXIT_CODE_1>

Download.log:


Starting OCS Inventory NG Package Download and Setup Tool on Wednesday, June 10, 2020 16:46:24.

DOWNLOAD => Running OCS Inventory NG Download Version 2.6.0.1

DOWNLOAD => Using OCS Inventory NG FrameWork Version 2.6.0.1

DOWNLOAD => Using network connection with Communication Server

COM PROVIDER => Loading Communication Provider <C:\Program Files\OCS Inventory Agent\ComHTTP.dll>

DOWNLOAD => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.6.0.0>

DOWNLOAD => Starting new period of 10 cycles

DOWNLOAD => Flushing package queue

DOWNLOAD => Parsing directory <C:\ProgramData\OCS Inventory NG\Agent\download> for packages

DOWNLOAD => Verifying package <C:\ProgramData\OCS Inventory NG\Agent\download\1591800219>

DOWNLOAD => Package <1591800219> verified and added to process queue

DOWNLOAD => Processing packages for cycle 1 on Wednesday, June 10, 2020 16:46:24

DOWNLOAD => Downloading package fragment <1591800219-1>

COM SERVER => Initializing cURL library for getFile

COM SERVER => Using cURL without server authentication

COM SERVER => Disabling cURL proxy support

COM SERVER => Enabling cURL SSL server validation support using CA Bundle <cacert.pem>

COM SERVER => Sending fileGet request to URL <HTTP://ocs.ihidemydomain.com/download/1591800219/1591800219-1>

COM SERVER => fileGet response received <HTTP Status Code #200>

COM SERVER => Cleaning cURL library

DOWNLOAD => Pausing for fragment latency (10 seconds)

DOWNLOAD => Pausing for cycle latency (60 seconds)

DOWNLOAD => Processing packages for cycle 2 on Wednesday, June 10, 2020 16:47:47

DOWNLOAD => Building package <1591800219>

PACKAGE => Verifying fragment files of package <1591800219>

PACKAGE => Checking free disk space for package <1591800219>

PACKAGE => Building ZIP for package <1591800219>

PACKAGE => Verifying ZIP signature for package <1591800219>

DOWNLOAD => Package <1591800219> built successfully

DOWNLOAD => Executing action <EXECUTE> for package <1591800219>

PACKAGE => Executing command <install.bat> for package <1591800219> on <Wednesday, June 10, 2020 16:47:49>

PACKAGE => Package <1591800219> successfully executed. Command exit code is <1>. Package return code is <EXIT_CODE_1>

PACKAGE => Executing post execution command <NONE> for package <1591800219>

PACKAGE => Package <1591800219> post execution command successfully executed. Command exit code is <1>

ERROR *** DOWNLOAD => Will not register package <1591800219> in history: result <EXIT_CODE_1> not a success

DOWNLOAD => Sending result code <EXIT_CODE_1> for package <1591800219>

DID_CHECK => Read DeviceID <NB03-2020-06-03-17-23-26> and MACs <00:FF:18:5E:XX......XX:18:18> in file <ocsinventory.dat>

COM SERVER => Initializing cURL library for sendRequest

COM SERVER => Using cURL without server authentication

COM SERVER => Disabling cURL proxy support

COM SERVER => Enabling cURL SSL server validation support using CA Bundle <cacert.pem>

COM SERVER => Sending HTTP Post request to URL <https://ocs.ihidemydomain.com/ocsinventory>

COM SERVER => HTTP Post response received <HTTP Status Code #200>

COM SERVER => Cleaning cURL library

DOWNLOAD => Result code request successfully sent

DOWNLOAD => Pausing for fragment latency (10 seconds)

DOWNLOAD => Pausing for cycle latency (60 seconds)

DOWNLOAD => Processing packages for cycle 3 on Wednesday, June 10, 2020 16:49:00

DOWNLOAD => Pausing for cycle latency (60 seconds)

DOWNLOAD => Processing packages for cycle 4 on Wednesday, June 10, 2020 16:50:00

DOWNLOAD => Pausing for cycle latency (60 seconds)

DOWNLOAD => Processing packages for cycle 5 on Wednesday, June 10, 2020 16:51:00

DOWNLOAD => Pausing for cycle latency (60 seconds)

DOWNLOAD => Processing packages for cycle 6 on Wednesday, June 10, 2020 16:52:00

DOWNLOAD => Pausing for cycle latency (60 seconds)


OCSInventory.log:


Starting OCS Inventory NG Agent on Wednesday, June 10, 2020 16:21:52.

AGENT => Running OCS Inventory NG Agent Version 2.6.0.1

AGENT => Using OCS Inventory NG FrameWork Version 2.6.0.1

AGENT => Loading plug-in(s)

DLL PLUGIN => Searching for Plug-in DLL(s) in folder <C:\Program Files\OCS Inventory Agent\plugins>

DLL PLUGIN => 0 DLL Plug-in(s) successfully loaded on 0 DLL(s) found

AGENT => Using network connection with Communication Server

COM PROVIDER => Loading Communication Provider <C:\Program Files\OCS Inventory Agent\ComHTTP.dll>

AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.6.0.0>

AGENT => Sending Prolog

DID_CHECK => Read DeviceID <NB03-2020-06-03-17-23-26> and MACs <00:FF:XX......XX:CC:18:18> in file <ocsinventory.dat>

COM SERVER => Initializing cURL library for sendRequest

COM SERVER => Using cURL without server authentication

COM SERVER => Disabling cURL proxy support

COM SERVER => Enabling cURL SSL server validation support using CA Bundle <cacert.pem>

COM SERVER => Sending HTTP Post request to URL <https://ocs.ihidemydomain.com/ocsinventory>

COM SERVER => HTTP Post response received <HTTP Status Code #200>

COM SERVER => Cleaning cURL library

AGENT => Prolog successfully sent

AGENT => Prolog Frequency set to 24 hour(s)

AGENT => Inventory on startup option set to 1 

AGENT => Inventory required

AGENT => Launching hardware and software checks

INVENTORY => Loading Download history

..... I cut the inventory out ......

AGENT => Communication Server asks for IpDiscover

..... I cut the ip discover out ......

EXECUTABLE PLUGIN => Searching for VBS script(s) in folder <C:\Program Files\OCS Inventory Agent\plugins>

EXECUTABLE PLUGIN => Searching for PS1 script(s) in folder <C:\Program Files\OCS Inventory Agent\plugins>

EXECUTABLE PLUGIN => Found executable plugin <Saas.ps1>

WARNING *** EXECUTABLE PLUGIN => Plugin <C:\Program Files\OCS Inventory Agent\plugins\Saas.ps1> does not produce any output

AGENT => Sending Inventory

..... I cut the inventory out ......

COM SERVER => Initializing cURL library for sendRequest

COM SERVER => Using cURL without server authentication

COM SERVER => Disabling cURL proxy support

COM SERVER => Enabling cURL SSL server validation support using CA Bundle <cacert.pem>

COM SERVER => Sending HTTP Post request to URL <https://ocs.ihidemydomain.com/ocsinventory>

COM SERVER => HTTP Post response received <HTTP Status Code #200>

COM SERVER => Cleaning cURL library

AGENT => Inventory successfully sent

INVENTORY => Writing new inventory state

AGENT =>  Communication Server asked for Package Download

DOWNLOAD => Package history file successfully cleaned for duplicate IDs

DOWNLOAD => Metadata file <info> for package <1591798070> is located at <https://ocs.ihidemydomain.com/download/1591798070/info>

COM SERVER => Initializing cURL library for getFile

COM SERVER => Using cURL without server authentication

COM SERVER => Disabling cURL proxy support

COM SERVER => Enabling cURL SSL server validation support using CA Bundle <cacert.pem>

COM SERVER => Sending fileGet request to URL <https://ocs.ihidemydomain.com/download/1591798070/info>

COM SERVER => fileGet response received <HTTP Status Code #200>

COM SERVER => Cleaning cURL library

DOWNLOAD => Unloading communication provider

DOWNLOAD => Retrieve info file...OK (pack 1591798070)

DOWNLOAD => Package <1591798070> added to download queue

DOWNLOAD => Download and setup tool successfully started

AGENT => Unloading communication provider

AGENT => Unloading plug-in(s)

AGENT => Execution duration: 00:01:09.


What I am doing wrong or what do I missing?

Thank you

in OCS Inventory NG agent for Windows by (600 points)

6 Answers

+2 votes
 
Best answer

hy.. so try a cmd file instead of a bat.

And the included files in the zip must be at the top level folder hierachy (no subfolder)

also try this tip

http://ask.ocsinventory-ng.org/8328/exit-code-of-launch-action-deployment

find a way to log the command execution

try something from this site

https://superuser.com/questions/698496/log-an-entire-batch-file-output

and i would do something like

echo %USERNAME% >c:\logfiles\logfile.txt
in your script to get the username under which the script runs.
to simulate "system context" user you musst open a command prompt with system user right.
then you can see what happens when ocs is running your script.
The ocs-inventory agent normaly should run scipts  as "nt authority\system" 
 https://specopssoft.com/blog/how-to-become-the-local-system-account-with-psexec/ 

kind regards

by (24.3k points)
selected by
0 votes
Hello,
I have exactly the same problem as you.

Do you have any leads?
I'll get back to you if I can find a solution...
Yours sincerely,
by (200 points)
+1 vote

i haven't had this . but perhaps a tip from me works


1. delete windows temp files before deployment.

2. Don't trigger the download with the ocsagent.exe in C:\Program Files\OCS Inventory Agent

stop the "ocs Inventory service"

edit TTO_WAIT=xyzx  to TTO_WAIT=5 C:\ProgramData\OCS Inventory NG\Agent\ocsinventory.ini

start the service

you must edit the file outside the folder and copy that file back to the folder
C:\ProgramData\OCS Inventory NG\Agent
Otherwiese you can't overwrite the file ocsinventory.ini easily

Kind regards

soktra

by (24.3k points)
0 votes

Hey there,

thank you for the tips. Unfortunately nothing of this works for me.

1. delete windows temp files before deployment.

I deleted all windows temp files.

2. Don't trigger the download with the ocsagent.exe in C:\Program Files\OCS Inventory Agent

I didn't trigger anything manually. I just waited for the agent to do its work.

stop the "ocs Inventory service"

edit TTO_WAIT=xyzx  to TTO_WAIT=5 C:\ProgramData\OCS Inventory NG\Agent\ocsinventory.ini

start the service

I changed the TTO_WAIT value to 5 and restarted the started the service again.
Same error: <EXIT_CODE_1>

Could this be a probleme with the windows UAC? If I start the 'install.bat'-script manually on a client windows pops up a promt and asking if I want to execute the application.

I can't imaging this because this is the reason I want use OCS for deploying. Elsewhere I would use Windows GPO. I assumed that the agent will deploy the packages with high privileges and there will be no problem. Am I wrong?

Thank you!

by (600 points)
0 votes
Hi
It didn't work for me either.
I don't think this is a problem with UAC because I can deploy other packages that require administrative rights. In fact I even tried it on a workstation where the user is an administrator.

It seems to me that OCS has the rights granted to it at the installation. To check....

Personally it's the .msi installation of google Chrome that is the problem.
by (200 points)
0 votes

Hey there,

first of all thank you for your help. It works for me now.

also try this tip

http://ask.ocsinventory-ng.org/8328/exit-code-of-launch-action-deployment

find a way to log the command execution

Makes sense. If I have further problems with script execution I would try something like this at the end on the script:


Echo OCS-Deployment of the script by user: %USERNAME% results at %time% : %errorlevel% >> "%temp%"\OCS_errors.log


So I can see the execution user-account and the error-code and the execution time.

so try a cmd file instead of a bat

Could be a solution maybe, but for me it works now with BAT file type.

And the included files in the zip must be at the top level folder hierachy (no subfolder)

That was indeed the problem for me! I was putting the files inside a folder and use zip on this folder. So I had a folder inside a zip-archive which contains the files.
Like you said, that was wrong. I had to put the files in the 'root' directory of the zip file (put install script not into a subfolder).

As I did that, the execution works with no problems.

Thank you! Your answers were very helpful.
Hope this threat helps others ppl with similar problems.

Bye

by (600 points)
edited by
 
Powered by Question2Answer
...