Skip to content

Different filesystem ownership in cache package creates PermissionError Exception  #1530

Open
@cumulus-vfx

Description

@cumulus-vfx

Describe the bug here.

Environment

  • OS: Centos 7
  • Rez version: 2.112.0
  • Rez python version: Python 3.7.9

To Reproduce
Run rez-env on a pkg when user does not have write perms on pkg cache json file
Raised by os.utime function on pkg json file
Caused when a different user is using a workstation, then the user that created the cache in the first place

Expected behavior
Better to print warning instead of failure

Actual behavior
Traceback (most recent call last): 
File "/local_data/sw/pkg/rez/2.112.0/platform-linux/python-3.7.9/bin/rez/rez-env", line 8, in     sys.exit(run_rez_env()) 
File "/sw/pkg/rez/2.112.0/platform-linux/python-3.7.9/lib/python3.7/site-packages/rez/cli/_entry_points.py", line 148, in run_rez_env    return run("env") 
File "/sw/pkg/rez/2.112.0/platform-linux/python-3.7.9/lib/python3.7/site-packages/rez/cli/_main.py", line 191, in run    returncode = run_cmd() 
File "/sw/pkg/rez/2.112.0/platform-linux/python-3.7.9/lib/python3.7/site-packages/rez/cli/_main.py", line 183, in run_cmd    return func(opts, opts.parser, extra_arg_groups) 
File "/sw/pkg/rez/2.112.0/platform-linux/python-3.7.9/lib/python3.7/site-packages/rez/cli/env.py", line 261, in command    block=True) 
File "/sw/pkg/rez/2.112.0/platform-linux/python-3.7.9/lib/python3.7/site-packages/rez/resolved_context.py", line 1045, in _check    return fn(self, *nargs, **kwargs) 
File "/sw/pkg/rez/2.112.0/platform-linux/python-3.7.9/lib/python3.7/site-packages/rez/resolved_context.py", line 1431, in execute_shell    self._execute(executor) 
File "/sw/pkg/rez/2.112.0/platform-linux/python-3.7.9/lib/python3.7/site-packages/rez/utils/memcached.py", line 271, in wrapper    return func(*nargs, **kwargs) 
File "/sw/pkg/rez/2.112.0/platform-linux/python-3.7.9/lib/python3.7/site-packages/rez/resolved_context.py", line 2014, in _execute    cached_root = pkgcache.get_cached_root(pkg) 
File "/sw/pkg/rez/2.112.0/platform-linux/python-3.7.9/lib/python3.7/site-packages/rez/package_cache.py", line 110, in get_cached_root    os.utime(json_filepath, None)
PermissionError: [Errno 13] Permission denied

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions