After a migration to SUSE Manager 5.0 some commands fail with "Permission denied" errors
This document (000021535) is provided subject to the disclaimer at the end of this document.
Environment
Situation
uyuni-server:/ # mgr-create-bootstrap-repo --create SLE-15-SP6-x86_64 Creating bootstrap repo for SLE-15-SP6-x86_64 copy 'gio-branding-SLE-15-150600.35.2.1.noarch' copy 'hostname-3.16-2.22.x86_64' Traceback (most recent call last): File "/usr/sbin/mgr-create-bootstrap-repo", line 1082, in <module> sys.exit(abs(main() or 0)) File "/usr/sbin/mgr-create-bootstrap-repo", line 1075, in main r = create_repo(opts.create, opts, mgr_bootstrap_data, additional=args) File "/usr/sbin/mgr-create-bootstrap-repo", line 739, in create_repo shutil.copy2(os.path.join(basepath, p["path"]), rpmdir) File "/usr/lib64/python3.6/shutil.py", line 264, in copy2 copystat(src, dst, follow_symlinks=follow_symlinks) File "/usr/lib64/python3.6/shutil.py", line 229, in copystat _copyxattr(src, dst, follow_symlinks=follow) File "/usr/lib64/python3.6/shutil.py", line 165, in _copyxattr os.setxattr(dst, name, value, follow_symlinks=follow_symlinks) PermissionError: [Errno 13] Permission denied: '/srv/www/htdocs/pub/repositories/sle/15/6/bootstrap.tmp/x86_64/hostname-3.16-2.22.x86_64.rpm'
Additionally something similar to the following messages are logged to the journal (see "/usr/bin/journalctl --help") on the SLE Micro host:
024-08-19T13:25:17+0200 automatix setroubleshoot[16148]: SELinux is preventing mgr-create-boot from relabelto access on the file hostname-3.16-2.22.x86_64.rpm. For complete SELinux messages run: sealert -l a920e1c8-a1a6-4b1b-acf9-04dd0c025f7a 2024-08-19T13:25:17+0200 automatix setroubleshoot[16148]: SELinux is preventing mgr-create-boot from relabelto access on the file hostname-3.16-2.22.x86_64.rpm.
Resolution
restorecon -F -r -v /var/lib/containers/storage/volumes/
There is no need to stop the container or any services.
Cause
After migration of the data (the copy of the files from 4.3 to 5.0) due to a bug in the migration the security context is not set correctly.
Additional Information
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000021535
- Creation Date: 22-Aug-2024
- Modified Date:22-Aug-2024
-
- SUSE Manager Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com