Wednesday, July 23, 2008

Agent upload fails...ret = -2

For some time now, I had some trouble with a database instance in OEM. The agent refused to upload his data to the OMS, giving me the Failed to upload file Bxxxxxx.xml, ret = -2 error.
In the log file, the following error occurs :

Thread-4595721 ERROR upload: Failed to upload file B0012907.xml, ret = -22008-07-23
Thread-4595721 WARN upload: FxferSend: received http error in header from repository: http://oemrepository/em/upload/

I bounced the agent, the OMS...even patched the OMS, but nothing solved this problem. Until I noticed the same problem in a forum. I tried the following on the target machine..

oemagent@oebs04:(state)> rm *
oemagent@oebs04:(collection)> rm *
oemagent@oebs04:(upload)> rm *
oemagent@oebs04:(emd)> rm lastupld.xml
oemagent@oebs04:(emd)> rm agntstmp.txt
oemagent@oebs04:(emd)> rm blackouts.xml
oemagent@oebs04:(emd)> cd ..
oemagent@oebs04:(sysman)> cd ../bin
oemagent@oebs04:(bin)> ./emctl clearstate agent
Oracle Enterprise Manager 10g Release 10.1.0.5.0
Copyright (c) 1996, 2006 Oracle Corporation. All rights reserved.
EMD clearstate completed successfully
oemagent@oebs04:(bin)> ./emctl start agent
Oracle Enterprise Manager 10g Release 10.1.0.5.0
Copyright (c) 1996, 2006 Oracle Corporation. All rights reserved.
Starting agent ........ started.
oemagent@oebs04:(bin)> ./emctl reload agent
Oracle Enterprise Manager 10g Release 10.1.0.5.0
Copyright (c) 1996, 2006 Oracle Corporation. All rights reserved.
EMD reload completed successfully
oemagent@oebs04:(bin)> ./emctl upload agent
Oracle Enterprise Manager 10g Release 10.1.0.5.0
Copyright (c) 1996, 2006 Oracle Corporation. All rights reserved.
EMD upload completed successfully
oemagent@oebs04:(bin)> ./emctl status agent
Oracle Enterprise Manager 10g Release 10.1.0.5.0
Copyright (c) 1996, 2006 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
Agent Version : 10.1.0.5.1
OMS Version : 10.2.0.3.0
Protocol Version : 10.1.0.2.0
Agent Home : /oebs/oemagent/10.1.0
Agent binaries : /oebs/oemagent/10.1.0
Agent Process ID : 14591
Parent Process ID : 14588
Agent URL : http://oebs04.control.publicsoft.nl:1831/emd/main/
Started at : 2008-07-23 08:52:23
Started by user : oemagent
Last Reload : 2008-07-23 08:52:38
Last successful upload : 2008-07-23 08:52:52
Total Megabytes of XML files uploaded so far : 2.75
Number of XML files pending upload : 1
Size of XML files pending upload(MB) : 0.02
Available disk space on upload filesystem : 47.02%
---------------------------------------------------------------
Agent is Running and Ready


And this solved the problem !

2 comments:

Anonymous said...

Hi Bas

Ik zou publicsoft vervangen door smartapps.

Je bent er maar druk mee met het schrijven op je blog ;-)

Agent URL : http://oebs04.control.publicsoft.nl:1831/emd/main/

Henk said...

Thanks very much for this solution, had the same problem with our agent.

(Bedankt!)