Registration Failed for Instance
An instance can fail to register with Autonomous Linux for several reasons.
Common osmh-agent.log Error Messages
To troubleshoot registration issues, start by examining the osmh-agent.log
file for the following error messages. See Examining Log Files on an Instance to identify the location of the log file.
Code and Message | Possible cause and resolution |
---|---|
|
Cause: There wasn't a compatible default profile at registration. Resolution: Identify and use a compatible profile. See Invalid profile was used. |
|
Cause: The current policies don't allow the service to access the instance. Most commonly, the dynamic group doesn't include matching rules for the compartment that contains the instance. Or, there's a missing or incorrect policy statement. Resolution: Verify policies are correct. See Incorrect policy statement or missing dynamic group rule. |
|
Cause: The profile has the wrong operating system. For example, the instance is Oracle Linux 8 but the profile is Oracle Linux 7. Resolution: Identify and use a compatible profile. See Invalid profile was used. |
Common Oracle Cloud Agent Error Messages
For OCI instances, use the OS Management Hub Agent plugin status to troubleshoot registration issues. In the Console, on the Oracle Cloud Agent tab on the Compute instance details page, you might see one of the following error messages.
Error Message | Possible cause and resolution |
---|---|
Plugin OS Management Hub Agent not present for instance ocid1.instance.oc1.iad.<ocid> |
Cause: The OS Management Hub agent isn't installed on the instance. This usually occurs when the service can't access the instance because of a policy issue. Resolution: Verify your policy statements are correct and that the instance is included in the dynamic group. See Incorrect policy statement or missing dynamic group rule. |
failed to start osmh-agent with [lookup image failed. The instance could not register with OS Management Hub. |
Cause: The OS Management Hub agent can't start on the instance. This usually occurs when the service can't access the instance because of a policy issue. Resolution: Verify your policy statements are correct and that the instance is included in the dynamic group. If not using the default identitiy domain, verify you've specified the identity domain in the policy statements. See Incorrect policy statement or missing dynamic group rule. |
rpc error: code = Unavailable desc = connection error: desc = "transport: error while dialing: dial unix /var/lib/oracle-cloud-agent/tmp/plugin162329539: connect: connection refused" |
Cause: Multiple OCA plugins are running. The OS Management Hub and OS Management plugin can't run at the same time. Resolution: Disable the OS Management plugin. See Multiple plugins running. |
Invalid profile was used
Check the osmh-agent.log
file and identify the correct profile
To update the profile
- Under List scope, select the compartment that contains the instance.
- Click the name of the instance.
- Click Set profile.
- Select the compartment and correct profile to use for registration.
- Click Set.
Incorrect policy statement or missing dynamic group rule
If you encounter the following errors when registering an instance, it might indicate that the policy statements or dynamic group rules aren't set correctly.
The osmh-agent.log
contains:
ERROR: failed to update managed instance: Error returned by Service. Http Status Code: 404.
Error Code: NotAuthorizedOrNotFound. Opc request id: <requestID>. Message: Authorization failed or requested resource not found.
...
Request Endpoint: PUT https://osmh.<region>.oci.oraclecloud.com/20220901/agent/managedInstances/ocid1.managementagent.oc1.iad.<ocid>
Or, the Oracle Cloud Agent tab on the Compute instance details page shows one of the following messages:
Plugin OS Management Hub Agent not present for instance ocid1.instance.oc1.iad.<ocid>
failed to start osmh-agent with [lookup image failed. The instance could not register with OS Management Hub.
To resolve the issue, verify you've correctly configured the policy statements and dynamic group rules. Most commonly the dynamic group doesn't include the instance.
Verify the following:
- Ensure that you've included a dynamic group rule for each compartment and subcompartment containing instances that you want manged by the service. Dynamic groups don't support compartment inheritance.
- If not using the
default
identity domain, ensure each policy statement has the identity domain before the group or dynamic group name (for example,<identity_domain_name>/<dynamic_group_name>
).
Instance was previously unregistered
Re-registering an instance that was unregistered will fail until you remove the unregistration file on the instance. This file prevents the instance from registering with the service. When you try to register an instance that contains this file, the agent plugin displays the following error: started oci-osmh under unregistered mode
.
Remove the following file before registering the instance:
-
/var/lib/oracle-cloud-agent/plugins/oci-osmh/osmh-agent-unregister
Multiple plugins running
The OS Management plugin and OS Management Hub plugin for the Oracle Cloud Agent can't be running at the same time. In the Console, on the Oracle Cloud Agent tab in Compute instance details, you might see the following error:
rpc error: code = Unavailable desc = connection error:
desc = "transport: error while dialing: dial unix /var/lib/oracle-cloud-agent/tmp/plugin162329539: connect: connection refused"
Disable the OS Management plugin:
- Open the navigation menu, click Compute, and then click Instances.
- Click the name of the instance.
- Click the Oracle Cloud Agent tab.
- Disable the OS Management Service Agent plugin.