Registration Failed for Instance
An instance can fail to register with Autonomous Linux for several reasons.
Common 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. |
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, it might indicate that the policy statements or dynamic group rule 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:
Plugin OS Management Hub Agent not present for instance ocid1.instance.oc1.iad.<ocid>
To resolve the issue, verify you've correctly configured the policy statements. See Required IAM Policy.
Most commonly the dynamic group rule doesn't include the compartment that the instance resides in. Dynamic groups don't support compartment inheritance, so you might need to explicitly include subcompartments. See Required Dynamic Group.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.