dell / dellemc-openmanage-ansible-modules

Dell OpenManage Ansible Modules
GNU General Public License v3.0
335 stars 163 forks source link

GetRepoBasedUpdateList_OUTPUT error message should be more descriptive #104

Closed silvam11 closed 4 years ago

silvam11 commented 4 years ago

During the execution of the idrac_firmware module I received the following error message:

{"changed": false, "msg": "'GetRepoBasedUpdateList_OUTPUT'"}

Debugging the code, I was able to see the following exception:

{
    'update_status': {
        u '@odata.type': u '#DellJob.v1_0_2.DellJob',
        'Status': 'Success',
        'job_details': {
            'Status': 'Failed',
            'Data': {
                'Status': 'Failed',
                'Message': "returned status code doesn't match with the expected success code",
                'StatusCode': 400
            },
            'error': {
                u 'error': {
                    u 'code': u 'Base.1.5.GeneralError',
                    u 'message': u 'A general error has occurred. See ExtendedInfo for more information',
                    u '@Message.ExtendedInfo': [{
                        u 'Severity': u 'Warning',
                        u 'RelatedProperties': [],
                        u 'MessageId': u 'IDRAC.2.1.SUP029',
                        u 'MessageArgs@odata.count': 0,
                        u 'RelatedProperties@odata.count': 0,
                        u 'Message': u 'Firmware versions on server match catalog, applicable updates are not present in the repository.',
                        u 'Resolution': u 'No response action is required.',
                        u 'MessageArgs': []
                    }]
                }
            },
            'Message': 'none',
            'retval': True,
            'StatusCode': 400
        },
        u 'JobState': u 'Completed',
        u 'Description': u 'Job Instance',
        u 'TargetSettingsURI': None,
        u '@odata.id': u '/redfish/v1/Managers/iDRAC.Embedded.1/Jobs/JID_823415472509',
        u '@odata.context': u '/redfish/v1/$metadata#DellJob.DellJob',
        u 'MessageArgs': [u 'NA'],
        u 'PercentComplete': 100,
        u 'CompletionTime': u '2020-02-21T21:19:13',
        u 'MessageArgs@odata.count': 1,
        u 'StartTime': u 'TIME_NOW',
        u 'MessageId': u 'RED001',
        u 'Message': u 'Job completed successfully.',
        u 'EndTime': None,
        'retval': True,
        u 'Id': u 'JID_823415472509',
        u 'JobType': u 'RepositoryUpdate',
        u 'Name': u 'Repository Update'
    },
    'changed': False,
    'update_msg': 'Successfully triggered the job to update the firmware.'
}

Looking at the snippet above, it is possible to see that the root cause is returned status code doesn't match with the expected success code because Firmware versions on server match catalog, applicable updates are not present in the repository Therefore, would be nice to have a more descriptive message to indicate the root cause of the issue.

Below are some details about the environment:

  1. dell openmanage and omsdk are the latest version of devel branches
  2. ansible-playbook: 2.8.4
  3. python version = 2.7.5
  4. IDRAC 9 version 4.10.10.10 (Build 32)
thizmo commented 4 years ago

Hi, thx for the ticket. Having this problem too. Yet not with the latest versions available vor iDrac.

Reason My latest Dell DRM (3.3, Cli-Only, on Ubuntu 18.04) doesn't update the repository.

03-03-20 15:21:33 Saving Repository Version Dell:1,01 03-03-20 15:21:33 SCHW com.dell.drm.datamanager.RepositoryDataManager nextVersion Invalid Version Name For input string: "1,01" 03-03-20 15:21:33 INFO com.dell.drm.service.DRMNotificationManager getNotification Responding a notification Job Refresh_03/03/2020 15:21 started. - Tue Mar 03 15:21:29 CET 2020 03-03-20 15:21:33 SCHW com.dell.drm.datamanager.RepositoryDataManager createOrSaveRepository Exception in Create Repository - not-null property references a null or transient value : com.dell.drm.model.db.Repository.nextrepoversion ... 03-03-20 15:21:36 INFO com.dell.drm.service.DRMNotificationManager getNotification Responding a notification Job Refresh_03/03/2020 15:21 failed. None of the repositories refreshed. - Tue Mar 03 15:21:33 CET 2020

So it did create a repository at first. But then not the update, because there seems a bug in the versioning. Using , instead of .

To whom or where should i report that too?

Thx.

silvam11 commented 4 years ago

@thizmo I did some investigation regarding this issue and the root cause seems to be on redfish APIs implemented by iDRAC. In a nutshell, I was able to reproduce the same issue using postman calling the following APIs:

  1. DellSoftwareInstallationService.InstallFromRepository
  2. DellSoftwareInstallationService.GetRepoBasedUpdateList
jagadeeshnv commented 4 years ago

We are working on it, fix will be posted by 3/31

silvam11 commented 4 years ago

@jagadeeshnv First of all, thanks! Secondly, what is the root cause? Is it on the redfish side?

jagadeeshnv commented 4 years ago

Hi @silvam11 The issue has been addressed in latest devel release, Please verify with https://github.com/dell/dellemc-openmanage-ansible-modules/tree/v2.0.10

jagadeeshnv commented 4 years ago

@silvam11 Did you get a chance to try with the latest version?

silvam11 commented 4 years ago

@jagadeeshnv Sorry no. I will do this week and let you know

silvam11 commented 4 years ago

@jagadeeshnv Sorry for the delay, I have tested the changes and they look ok. I could see that now the ansible module no longer fails, returning the following message:

{
        "changed": false,
        "failed": false,
        "msg": "The catalog in the repository specified in the operation has the same firmware versions as currently present on the server."
   }
jagadeeshnv commented 4 years ago

Thanks @silvam11