SUSE Support

Here When You Need Us

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

SUSE Manager Server 5.0

Situation

After a migration from SUSE Manager Server 4.3 to 5.0, some commands executed from within the container fail with something like the below example:
 
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

From the SLE Micro host directly execute the following command:
 
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

Depending on the amount of files, the command can take several minutes to complete. The output from the restorecon command above can alternatively also be piped to a log file to see what exactly is changed.

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

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.