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

Pylint Unable to create directory /github/home/.cache/pylint #1919

Closed
Kurt-von-Laven opened this issue Sep 1, 2021 · 10 comments
Closed

Pylint Unable to create directory /github/home/.cache/pylint #1919

Kurt-von-Laven opened this issue Sep 1, 2021 · 10 comments
Labels
bug Something isn't working O: stale 🤖 Stale issue/pr

Comments

@Kurt-von-Laven
Copy link
Contributor

Kurt-von-Laven commented Sep 1, 2021

Describe the bug

Pylint itself logs what appears to be a permissions error when it detects a lint error.

Expected behavior

Pylint successfully caches stats files rather than failing to write to the file system.

Steps to Reproduce

  1. Create a Python file named foo.py containing a Pylint violation, such as a long line.
  2. Create an empty pyproject.toml.
  3. Run Super-Linter slim-v.4.7.1 on the file with the following options:
          LINTER_RULES_PATH: /
          PYTHON_PYLINT_CONFIG_FILE: pyproject.toml

Logs

Unable to create directory /github/home/.cache/pylint
Unable to create file /github/home/.cache/pylint/foo1.stats: [Errno 2] No such file or directory: '/github/home/.cache/pylint/foo1.stats'
@Kurt-von-Laven Kurt-von-Laven added the bug Something isn't working label Sep 1, 2021
@admiralAwkbar
Copy link
Collaborator

@Kurt-von-Laven Would it make sense to when we build the image we create the folder and have it open?

@Kurt-von-Laven
Copy link
Contributor Author

That might fix the issue, but I don't recommend that approach off the bat. This strikes me as a permissions issue, so these are the sorts of things I would look into.

  • What is the effective user of the Pylint process (top | grep pylint)?
  • What group is that user in (groups <username>)?
  • What permissions/ownership settings are set on the /github/home/ directory (ls -l)?
  • Does a /github/home/.cache/ directory exist?

If all of the permissions look right, but there is no ~/.cache, maybe this is instead a Pylint bug, and they need to be using mkdir -p ~/.cache/pylint rather than mkdir ~/.cache/pylint.

@admiralAwkbar
Copy link
Collaborator

@Kurt-von-Laven Thanks for the input. I need to get some time to test this.
Its been crazy week out here and any PRs are very welcome :)
As always, thanks for your insight and great issues

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2021

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 Stale issue/pr label Oct 4, 2021
@Kurt-von-Laven
Copy link
Contributor Author

@admiralAwkbar, this one has had me stumped for a while, but I recently hit a permission error in a different context that was related to Docker running as root. I wonder if that is also going on here and could be addressed by simply running Docker in rootless mode, which also has security benefits. That repo's README also explains the other error.

@Kurt-von-Laven
Copy link
Contributor Author

FYI, the job to remove the stale label failed.

@tunetheweb
Copy link
Contributor

FYI, the job to remove the stale label failed.

Fix for that proposed in #2032

@Kurt-von-Laven
Copy link
Contributor Author

Thank you, @tunetheweb (and @admiralAwkbar for the marknotstale label).

@github-actions github-actions bot removed the O: stale 🤖 Stale issue/pr label Oct 4, 2021
@admiralAwkbar
Copy link
Collaborator

@Kurt-von-Laven We need to get the linter into non root user. I agree on that.
I just haven't had the time to get that updated and tested.
If you know anyone real good at docker, this would be a great hackathon fix :)

@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2021

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 Stale issue/pr label Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working O: stale 🤖 Stale issue/pr
Projects
None yet
Development

No branches or pull requests

3 participants