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

Mock resultdir created by chroot_scan plugin has weird permissions #1467

Closed
praiskup opened this issue Sep 26, 2024 · 1 comment · Fixed by #1468
Closed

Mock resultdir created by chroot_scan plugin has weird permissions #1467

praiskup opened this issue Sep 26, 2024 · 1 comment · Fixed by #1468
Assignees
Labels

Comments

@praiskup
Copy link
Member

Two subsequent calls of mockchain fail with:

$ mockchain /tmp/tito/python-copr-1.132-1.git.75.658230d.fc41.src.rpm /tmp/tito/copr-cli-1.112-1.git.78.658230d.fc41.src.rpm

## mockchain is deprecated, use mock --chain instead ##

INFO: mock.py version 5.6.post1 starting (python version = 3.13.0, NVR = mock-5.6.post1-1.git.3802.3dd0024.fc41), args: /usr/libexec/mock/mock --chain /tmp/tito/python-copr-1.132-1.git.75.658230d.fc41.src.rpm /tmp/tito/copr-cli-1.112-1.git.78.658230d.fc41.src.rpm
Start(bootstrap): init plugins
INFO: tmpfs initialized
INFO: selinux enabled
INFO: chroot_scan: initialized
Finish(bootstrap): init plugins
Start: init plugins
INFO: tmpfs initialized
INFO: selinux enabled
INFO: chroot_scan: initialized
Finish: init plugins
INFO: Signal handler active
Start: run
INFO: chroot_scan: 1 files copied to /var/lib/mock/fedora-41-x86_64/result/chroot_scan
INFO: /var/lib/mock/fedora-41-x86_64/root/var/log/dnf5.log
Traceback (most recent call last):
  File "/usr/libexec/mock/mock", line 1135, in <module>
    exitStatus = main()
  File "/usr/lib/python3.13/site-packages/mockbuild/trace_decorator.py", line 93, in trace
    result = func(*args, **kw)
  File "/usr/libexec/mock/mock", line 887, in main
    result = run_command(options, args, config_opts, commands, buildroot)
  File "/usr/lib/python3.13/site-packages/mockbuild/trace_decorator.py", line 93, in trace
    result = func(*args, **kw)
  File "/usr/libexec/mock/mock", line 930, in run_command
    commands.init(do_log=True)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/mockbuild/trace_decorator.py", line 93, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.13/site-packages/mockbuild/backend.py", line 156, in init
    self.buildroot.resetLogging()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/mockbuild/trace_decorator.py", line 93, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.13/site-packages/mockbuild/buildroot.py", line 648, in resetLogging
    fh = logging.FileHandler(fullPath, "a+")
  File "/usr/lib64/python3.13/logging/__init__.py", line 1218, in __init__
    StreamHandler.__init__(self, self._open())
                                 ~~~~~~~~~~^^
  File "/usr/lib64/python3.13/logging/__init__.py", line 1247, in _open
    return open_func(self.baseFilename, self.mode,
                     encoding=self.encoding, errors=self.errors)
PermissionError: [Errno 13] Permission denied: '/var/lib/mock/fedora-41-x86_64/result/state.log'

@praiskup praiskup added the bug label Sep 26, 2024
@github-project-automation github-project-automation bot moved this to Needs triage in CPT Kanban Sep 26, 2024
praiskup added a commit to praiskup/mock that referenced this issue Sep 26, 2024
This is already handled by the preceding resetLogging() call.

Relates: rpm-software-management#1467
praiskup added a commit to praiskup/mock that referenced this issue Sep 26, 2024
To make the fix possible, we needed to make the result directory
creation method public.

Fixes: rpm-software-management#1467
@praiskup
Copy link
Member Author

The problem was caused by chroot_scan plugin (I have it enabled locally).

@praiskup praiskup changed the title Mock --chain resultdir has weird permissions Mock resultdir created by chroot_scan plugin has weird permissions Sep 26, 2024
praiskup added a commit to praiskup/mock that referenced this issue Sep 26, 2024
To make the fix possible, we needed to make the result directory
creation method public.

Fixes: rpm-software-management#1467
praiskup added a commit to praiskup/mock that referenced this issue Sep 26, 2024
To make the fix possible, we needed to make the result directory
creation method public.

Fixes: rpm-software-management#1467
praiskup added a commit that referenced this issue Sep 26, 2024
This is already handled by the preceding resetLogging() call.

Relates: #1467
praiskup added a commit that referenced this issue Sep 26, 2024
To make the fix possible, we needed to make the result directory
creation method public.

Fixes: #1467
@praiskup praiskup moved this from Needs triage to In Progress in CPT Kanban Sep 26, 2024
@praiskup praiskup self-assigned this Sep 26, 2024
@nikromen nikromen moved this from In Progress to Done in CPT Kanban Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant