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

Advice that directory /home/odoo/.cache Needs permission update #186

Closed
hbto opened this issue Oct 28, 2022 · 6 comments · Fixed by #187
Closed

Advice that directory /home/odoo/.cache Needs permission update #186

hbto opened this issue Oct 28, 2022 · 6 comments · Fixed by #187
Assignees

Comments

@hbto
Copy link

hbto commented Oct 28, 2022

When first running pre-commit-vauxoo

It tries to create new folders at directory /home/odoo/.cache/

But in doing so an Exception is raised:


PermissionError: [Errno 13] Permission denied: '/home/odoo/.cache/

Screenshot 2022-10-28 at 3 07 13

Changing ownership on folder from root to odoo is needed

chown -R odoo:odoo /home/odoo/.cache/ 

as directory is owned by root:
Screenshot 2022-10-28 at 3 11 14

It would be good to have this advice when running t2d


docker exec -it --user=root CONTAINER chown -R odoo:odoo /home/odoo/.cache/ 

Regards.

@moylop260
Copy link
Collaborator

moylop260 commented Oct 28, 2022

@antonag32

This folder can be changed during the image build since it is not a volume (I think so)

Could you check what particular folders or files in the /home/odoo path has root permissions in order to run chown from the Dockerfile, please?

e.g. chown -R odoo:odoo /home/odoo/.config from #172

and chown -R odoo:odoo /home/odoo/.cache

Also, the following path is missing in the PATH /home/odoo/.local/bin

@moylop260
Copy link
Collaborator

BTW
Maybe something is not working well here:

Notice we don't like to run chown -R odoo:odoo /home/odoo/ because of it spends a lot of time and almost of the path already have odoo permission

@luisg123v
Copy link
Contributor

FYI @allanpa88

@antonag32
Copy link
Contributor

@moylop260

I don't think we can place it in the Dockerfile since these folders are not part of the base install, but are generated by optional programs, like vim.

In this case .cache being owned by root is caused by choosing installing the ctrpl plugin for vim.
/home/odoo/.spf13-vim-3 is also owned by root but I don't think that causes any problems.

I also could not find /home/odoo/.config, on the images I created. What program is using that directory?

@moylop260
Copy link
Collaborator

moylop260 commented Nov 7, 2022

You can use a find with not user

  • find /home/odoo -maxdepth 1 -not -user odoo -exec chown -R odoo:odoo {} \;

antonag32 added a commit to vauxoo-dev/travis2docker that referenced this issue Nov 7, 2022
@moylop260
Copy link
Collaborator

FYI $HOME/.cache is a generic folder used from pre-commit, pip and so on

antonag32 added a commit to vauxoo-dev/travis2docker that referenced this issue Nov 8, 2022
moylop260 pushed a commit that referenced this issue Nov 8, 2022
Fixes #186

`/home/odoo/.cache` is created when installing vim by the `ctrlp` vim plugin and is owned by root. This causes issues when other programs like pre-commit are run without privileges by end users and try to access `.cache`.
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

Successfully merging a pull request may close this issue.

4 participants