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

Python error version: 3.9 #40

Open
pedrooct opened this issue Aug 23, 2021 · 9 comments
Open

Python error version: 3.9 #40

pedrooct opened this issue Aug 23, 2021 · 9 comments

Comments

@pedrooct
Copy link

Following #39 , what python version do you recomend? Using ansible on version 2.9.18 and ansible-lint on version 4.3.7.

imagem

Thank you once again.

@pedrooct
Copy link
Author

P.S it only happens when running sonar-scanner.

@sbaudoin
Copy link
Owner

If this happens, this is certainly because some contextual things differ between the 2 runs, e.g. the Python versions differ or you are running in the venv locally whereas the plugin does not or the modules versions are different. Some environment variables may also differ, leading to different behaviors from Python or ansible-lint. So I'd investigate in this direction: try to identify what makes the runtime environments be different.

BTW, with ansible-lint 4.3.7 I use Ansible 2.8.16 in my integration tests because I was not able to set up a fully functional environment with ansible-lint 2.8.16 and a more recent version of Ansible. However, I had the issue even while running ansible-lint manually, not only via the plugin. I can't exactly remember the error I had, though, but as far as I can remember it came from the version of Python available by default in my Docker containers.

@pedrooct
Copy link
Author

Hi. Thank you for the response.

Although i have this error, the sonar-ansible and ansible-lint work as expected so it is just a detail. I will try with diferent ansible versions.

Waiting for 2.5.0! 👍

@sbaudoin
Copy link
Owner

Hello. I just released version 2.5.0. Tell me if this is OK now or if a new version is required to fix the issue.

@pedrooct
Copy link
Author

Thank you so much. I test it today and report if anything happens.

@sbaudoin
Copy link
Owner

@pedrooct have you noticed any issue? I have to release a 2.5.1 version to fix a code bug so should I also bring anything else in this 2.5.1 release?

@pedrooct
Copy link
Author

@pedrooct have you noticed any issue? I have to release a 2.5.1 version to fix a code bug so should I also bring anything else in this 2.5.1 release?

Hi! Sorry for the delay.
First, of all the error of this thread on appears with debug set to false. Second the logs show that it didn't find errors on the ansible, but sonarqube later shows the errors.

Sorry, i'm unable to provide screenshots right now.

Thank you.

@sbaudoin
Copy link
Owner

Hello,

Bad news. Do you have a simple playbook or so that I can use to debug the issue, please?

@sbaudoin
Copy link
Owner

sbaudoin commented Sep 26, 2021

OK, got it: you face this issue because of #32, which I cannot fix or do not know how to fix. Maybe I can specifically ignore this kind of errors but this would be a very specific behavior, a kind of workaround, so not really to be implemented.

So the only thing you can do is to ignore this issue if that's OK for you. Just confirm me that this is "just" a display error, and that the analysis does not fail.

EDIT: to reproduce the issue I created a playbook that just calls a role whose main.yml has a block that includes another YAML file:

playbook:

---
- hosts: all
  roles:
    - test

roles/test/tasks/main.yml:

---
- block:
    - include: test.yml

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

No branches or pull requests

2 participants