The “Invalid EMSTATE valueEMD” error occurs when reload/upload/pingOMS agent:
oracle:/u01/app/oracle/product/13.5.0/agent_1/agent_inst/bin$ ./emctl reload agent
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
Invalid EMSTATE valueEMD reload completed successfully
Check what value is for EMSTATE :
$ cat emctl
#!/bin/sh -f
#++
#
# 16-dec-02.15:38:56 vnukal
#
# Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
#
# emctl - control script for state-only agent installs.
#
# MODIFIED (MM/DD/YY)
# mkiran 11/27/11 - 13417393: Pass args via "$@" instead of $*
# vnukal 12/16/02 - Creation
#--
REMOTE_EMDROOT=/u01/app/oracle/product/13.5.0/agent_1/agent_13.5.0.0.0
export REMOTE_EMDROOT
REMOTE_EMDROOT_AGHOME=/u01/app/oracle/product/13.5.0/agent_1/agent_13.5.0.0.0
export REMOTE_EMDROOT_AGHOME
EMSTATE=/u01/app/oracle/product/13.5.0/agent_1/agent_inst
export EMSTATE
/u01/app/oracle/product/13.5.0/agent_1/agent_13.5.0.0.0/bin/emctl "$@"
SOLUTION
The issue is that the group has write privilege for the directory agent_inst. This is not allowed, group should only have read and execute privilege .
Run the chmod utility to change the the access permissions as follows:
chmod g-w agent_inst
$ ./emctl upload agent
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
EMD upload completed successfully
$ ./emctl pingOMS
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
EMD pingOMS completed successfully
$ ./emctl reload agent
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
EMD reload completed successfully