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

Github action shown in README fails #3898

Closed
bschonec opened this issue Nov 14, 2023 · 6 comments · Fixed by #3916
Closed

Github action shown in README fails #3898

bschonec opened this issue Nov 14, 2023 · 6 comments · Fixed by #3916
Labels

Comments

@bschonec
Copy link

Summary

Using the simple example in the README.md, the github action fails with

Run ansible-lint 
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/ansible/config/manager.py", line 563, in get_config_value_and_origin
    value = ensure_type(value, defs[config].get('type'), origin=origin)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/ansible/config/manager.py", line 87, in ensure_type
    value = int(value)
            ^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''

During handling of the above exception, another exception occurred:

Issue Type
  • Bug Report
STEPS TO REPRODUCE

Simply copy and paste the example workflow code into .github/workflows/anyfile.yml

@bschonec bschonec added bug new Triage required labels Nov 14, 2023
@priyamsahoo priyamsahoo removed the new Triage required label Nov 22, 2023
@priyamsahoo
Copy link

We have been using this example in our repositories and it seems to work well. It would be great if you could share the repository where this action is failing.

@bschonec
Copy link
Author

My fork has never run successfully.

@ssbarnea
Copy link
Member

@bschonec I believe that https://github.com/bschonec/ansible-github/blob/stable/ansible.cfg#L123 is the line that makes ansible core to choke. That is a null and not an integer.

@ssbarnea
Copy link
Member

Confirmed:

$ ansible --version
ERROR: Invalid type for configuration option setting: DEFAULT_GATHER_TIMEOUT (from /Users/ssbarnea/c/a/1/ansible-github/ansible.cfg): invalid literal for int() with base 10: ''
FAIL: 5

This is caused by your broken ansible.cfg file. Still, I will keep the bug open little bit more because I want to make the linter behave little bit better in a case like this.

The current stacktrace is not very friendly and it would be better to provide a better error.

@bschonec
Copy link
Author

Very interesting. I don't know where I came up with that ansible.cfg. Most certainly, it's not valid.

Sorry for the noise. Since I never ran any real Ansible commands, I didn't notice the fubarred ansible.cfg file.

@ssbarnea
Copy link
Member

@bschonec It was a good opportunity for us to improve the behavior a little bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants