Hi All,

In this blog I have mentioned what could be the other reason for “Service specific Error Occurred. Code :2”

Recently I faced an issue where my Oracle Agent on one of the servers was not getting started. Every time I try to start it get failed,with error message. ” A service specific error occurred: 2“. Agent could not be started.

Since it was the familiar Issue, so I thought it is issue of varying timezone of the server and the agent. I crosschecked the “emd.properties” file but there was nothing wrong with the timezone setting.

I checked some of the important log files and found that this time it was a different error messages.

emdctlj.log

—————————————————————-

2015-07-20 03:47:05,037 [main] INFO – Disconnecting: client terminus
2015-07-20 03:47:05,038 [main] INFO – stderr: Status agent Failure:Unable to connect to the agent at https://HANBRXX1.test.com:1830/emd/lifecycle/main/ [Connection refused: connect]
2015-07-20 03:47:05,040 [main] INFO – Exit Code: 1
2015-07-20 03:47:06,276 [main] INFO – EmdCtl Timezone = America/Chicago
2015-07-20 03:47:07,093 [main] INFO – EmdCtl Timezone = America/Chicago
2015-07-20 03:47:11,956 [main] INFO – Command: run_autotune agent
2015-07-20 03:47:11,979 [main] INFO – Performing AutoTuning
2015-07-20 03:47:12,062 [main] INFO – AutoTuning done
2015-07-20 03:47:12,063 [main] INFO – Exit Code: 0
2015-07-20 03:47:12,757 [main] INFO – Command: status agent
2015-07-20 03:47:13,863 [main] INFO – Unable to connect to the agent at https://HANBRXX1.test.com:1830/emd/lifecycle/main/ [Connection refused: connect]
oracle.sysman.emSDK.agent.comm.exception.ConnectException: Unable to connect to the agent at https://HANBRXX1.test.com:1830/emd/lifecycle/main/ [Connection refused: connect]

gcagent_errors.log

———————————————————————————————
2015-07-20 03:47:19,215 [1:main] ERROR – Targets.xml was loaded with a wrong agent token, instance is rejected
2015-07-20 03:47:19,490 [1:main] ERROR – Agent failed to Startup for Target Manager in step 2
oracle.sysman.gcagent.tmmain.lifecycle.AgentStartupException: targets.xml was rejected: loaded with a wrong agent token
at oracle.sysman.gcagent.metadata.TargetManager.loadTargetsInstance(TargetManager.java:4029)
at oracle.sysman.gcagent.metadata.TargetManager$3.newMetaData(TargetManager.java:6417)
at oracle.sysman.gcagent.metadata.MetadataManager.notifyListeners(MetadataManager.java:637)
at oracle.sysman.gcagent.metadata.MetadataManager.notifyListeners(MetadataManager.java:579)
at oracle.sysman.gcagent.metadata.MetadataManager$RegistryLoader.loadFile(MetadataManager.java:2037)
at oracle.sysman.gcagent.metadata.MetadataManager$RegistryLoader.processMDFile(MetadataManager.java:1941)
at oracle.sysman.gcagent.metadata.MetadataManager$RegistryLoader.readRegistry(MetadataManager.java:1891)
at oracle.sysman.gcagent.metadata.MetadataManager$RegistryLoader.load(MetadataManager.java:1827)
at oracle.sysman.gcagent.metadata.MetadataManager.load(MetadataManager.java:366)
at oracle.sysman.gcagent.metadata.MetadataManager.runStartupStep(MetadataManager.java:555)
at oracle.sysman.gcagent.metadata.MetadataManager.tmNotifier(MetadataManager.java:422)
at oracle.sysman.gcagent.tmmain.lifecycle.TMComponentSvc.invokeNotifier(TMComponentSvc.java:978)
at oracle.sysman.gcagent.tmmain.lifecycle.TMComponentSvc.invokeInitializationStep(TMComponentSvc.java:1063)
at oracle.sysman.gcagent.tmmain.lifecycle.TMComponentSvc.doInitializationStep(TMComponentSvc.java:896)
at oracle.sysman.gcagent.tmmain.lifecycle.TMComponentSvc.notifierDriver(TMComponentSvc.java:792)
at oracle.sysman.gcagent.tmmain.TMMain.startup(TMMain.java:250)
at oracle.sysman.gcagent.tmmain.TMMain.agentMain(TMMain.java:530)
at oracle.sysman.gcagent.tmmain.TMMain.main(TMMain.java:519)

agabend.log

———————————————————
Target Manager failed at Startup: targets.xml was rejected: loaded with a wrong agent token
Target Manager failed at Startup: targets.xml was rejected: loaded with a wrong agent token
Target Manager failed at Startup: targets.xml was rejected: loaded with a wrong agent token
Target Manager failed at Startup: targets.xml was rejected: loaded with a wrong agent token
Target Manager failed at Startup: targets.xml was rejected: loaded with a wrong agent token

Solution: I renamed the target.xml to target_old.xml and created a new target.xml file under /AGENT_INST/sysman/emd location with the below mentioned content

<Targets>

</Targets>

After this start the agent, the agent will start now but it will not populate targets. You can either add targets using “emctl config agent addinternaltargets” or perform resynchronization from the console.

So {TARGET.XML rejected} can be the another reason for the failure of Oracle Agent to startup. Hope this will help you someday to fix your problem.