EMCC: unable to connect to the agent

I was having some issue with EMCC 13cR2 from the 171130 patch level, both using rpm or fully patched gold image, with the OMS not able to reach the agent.

The emoms.trc logfile show the following error:

Caused by: java.sql.SQLException: ORA-20989: Property does not existOracleHome for Agent https://<hostname>:3872/emd/main/
ORA-06512: at "SYSMAN.EM_PLUGIN_UTIL", line 4218
ORA-06512: at line 1

Here is the workaround:

emctl config agent addinternaltargets