Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error is not reported in nim module #193

Open
aklyachkin opened this issue Mar 14, 2022 · 23 comments
Open

error is not reported in nim module #193

aklyachkin opened this issue Mar 14, 2022 · 23 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@aklyachkin
Copy link
Contributor

Describe the bug
A small playbook is run (code see below) and returns "OK", but nothing happens. If it is run with -vvv (very verbose), there is an error in meta information:

    "meta": {
        "nimclient": {
            "messages": [
                "Cannot get oslevel from lpp source name: 7200-02-02-1832_current"
            ]
        },
        "messages": []
    },
    "msg": "NIM update operation successfull. See status and meta for details.",

To Reproduce
Code:

- hosts: localhost
  collections:
  - ibm.power_aix

  tasks:
  - name: update AIX server
    ibm.power_aix.nim:
      action: update
      targets: nimclient
      lpp_source: 7200-02-02-1832_current

grafik

Expected behavior
The task should fail and the error message should be shown.

Environment (please complete the following information):

  • OS: AIX 7.3 TL0 SP1
  • Python Version: 3.7.12
  • OpenSSH Version: 8.1.102.2104
  • Ansible Version: 2.9.14
  • AIX Collection Version: 1.4.0
@josesantosgit
Copy link

Hello,

Any update about that??
i have the same error.

thank you

@raeyacld
Copy link
Member

raeyacld commented Aug 9, 2022

Hello, the lpp_source name needs to follow "7xxx-xx-xx-xxxx-lpp_source" format
Please change 7200-02-02-1832_current to "7200-02-02-1832-lpp_source" and try again

@aklyachkin
Copy link
Contributor Author

The issue is not about lpp_source name format, but about error reporting. If it doesn't work with the lpp_source provided, it MUST report the error and set the task to failed.

@raeyacld
Copy link
Member

If you use "async=yes" flag in "nim -o cust" command, ansible will move on to next task without return an error
please provide the log of "nim -o cust" command that is triggered by Ansible nim update task.

@aklyachkin
Copy link
Contributor Author

Sorry, I don't use any flags in any commands. I use IBM's provided ansible module. E.g. as for now I see another error message on another server:

    "meta": {
        "nimclient": {
            "messages": [
                "Invalid oslevel got: 'timedout'."
            ]
        },
        "messages": [
            "Failed to get oslevel on nimclient. Command '/usr/bin/oslevel -s' failed, stderr: '0042-008 nimsh: Request denied - nimclient'"
        ]
    },
    "msg": "NIM update operation successfull. See status and meta for details.",

But still the task was successful and didn't return any error/failure.

@raeyacld
Copy link
Member

can you post your playbook? or use -vvv flag for ansible run?

@aklyachkin
Copy link
Contributor Author

The whole playbook is posted in the first message.

@raeyacld
Copy link
Member

raeyacld commented Aug 15, 2022

oh, missed that... did you run with a set of nim clients? your nim client nimsh seens inoperative according to the last error

@raeyacld
Copy link
Member

please re-create problem with -vvv so I can see what flags are being executed.

@aklyachkin
Copy link
Contributor Author

Please provide information what you want to see in the output. There is no NIM command in the verbose output and the only error information I posted above. I can't post the whole output because of security considerations.

@raeyacld
Copy link
Member

Screen Shot 2022-08-15 at 10 29 47 AM

@raeyacld
Copy link
Member

please check if you can find any details under meta

@aklyachkin
Copy link
Contributor Author

I posted above the whole meta section. I post it again:

    "meta": {
        "nimclient": {
            "messages": [
                "Cannot get oslevel from lpp source name: 7200-05-03_current"
            ]
        },
        "messages": []
    },
    "msg": "NIM update operation successfull. See status and meta for details.",

@raeyacld
Copy link
Member

what is your local host? is it a group of clients or a single client, can you share you inventory file?
what is your ansible command you just run?

@raeyacld
Copy link
Member

the lpp_source name does not follow the required format based on the current design. please change to:
xxxx-xx-xx-xxxx-lpp_source

You would keep hitting the same message without changing the lpp_source name.

@aklyachkin
Copy link
Contributor Author

The localhost is NIM server where the playbook is. There is no inventory, because I don't need it for the example and we don't have many NIM servers, where NIM module could be run.

The command I run is always the same (see the first message):

#/opt/freeware/bin/ansible-playbook -i localhost, -c local -vvv update.yml

The difference is only in -vvv if I want to get additional information.

@aklyachkin
Copy link
Contributor Author

the lpp_source name does not follow the required format based on the current design. please change to: xxxx-xx-xx-xxxx-lpp_source

You would keep hitting the same message without changing the lpp_source name.

Again - the problem is not lpp source naming, but your ignorance regarding error messages. I just did the test with the "correct" naming, it fails the same way.

If you look in YOUR source code, in file plugins/modules/nim.py, in the function nim_update you ignore all the possible errors.

@raeyacld
Copy link
Member

understand. what is the log when you use the correct name? your last log does not show it.
"meta": {
"nimclient": {
"messages": [
"Cannot get oslevel from lpp source name: 7200-05-03_current" <---- wrong format.

@aklyachkin
Copy link
Contributor Author

aklyachkin commented Aug 15, 2022

Here was wrong info from my side. With the lpp_source named according to your undocumented rules, the server is being updated. Still the issue with ignoring errors persist.

@raeyacld
Copy link
Member

thanks for the feedback. We will document the rules.

@aklyachkin
Copy link
Contributor Author

and what about errors? how do you plan to handle them?

@raeyacld
Copy link
Member

we will evaluate the current design and come up with a solution.

@mccharlton
Copy link

mccharlton commented Aug 30, 2022

Hello Raeyacld

So I run into an issue when patching AIX lpar using ansible when updating AIX from 7200-05-03-2135 to 7200-05-04-2220 . Playbook runs and does not update the nim client. No errors are displayed after the playbook run. The only way to see any significant output is to add -vvv (verbose) option.

Here is the meta information.

},
"meta": {
"messages": [],
"nimclient": {
"messages": [
"Already at same or higher level: 7200-05-03-2136, got: ['7200', '05', '03', '2135']"

Here is the playbook info.


  • name: AIX Patching Playbook
    hosts: nimclient
    vars:
    nim_lpp_source: 7200-05-03-2136-lpp_source
    nim_master: nimmaster
    collections:
    • ibm.power_aix
      tasks:

    • name: Run AIX Update
      nim:
      action: update
      lpp_source: "{{ nim_lpp_source }}"
      targets: "{{ ansible_hostname }}"
      delegate_to: "{{ nim_master }}"

Any help will be really appreciated.

@nitismis nitismis added the bug Something isn't working label Jun 7, 2023
@nitismis nitismis assigned nitismis and unassigned raeyacld Oct 12, 2023
@nitismis nitismis added the help wanted Extra attention is needed label Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants