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
Http Status Code: 400. Error Code: MissingParameter.
Message: Registration profile is required for on-boarding instances, but none was provided.
Cause: There wasn't a compatible default profile at registration.
Http Status Code: 404. Error Code: NotAuthorizedOrNotFound.
Message: Authorization failed or requested resource not found.
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.
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.
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.
Identify (or create) a profile that matches the OS version, architecture, and location of the instance you're registering.
To update the profile
Open the navigation menu and select Observability & Management. Under Autonomous Linux, select Instances.
Under List scope, select the compartment that contains the instance.
Select the name of the instance.
Select Set profile.
Select the compartment and correct profile to use for registration.
Select Set.
It can take several minutes for the status of the instance to update.
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:
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: