Running AWS' CLI command "aws s3 sync" as root gives no output

Hello,

I moved from Arch Linux to OpenMandriva about two weeks ago, in order to give it a try. I had some problems with OpenMandriva for which I found solutions in the forum or the internet, but this one I couldn’t solve for the life of me. I had no luck with IA assistance either, so here I come.

Context

I want to install AWS’ CLI in order to manage an S3 bucket. First, I installed the package aws from OpenMandriva’s repository with dnf install aws, but soon I realized it’s an old version that doesn’t support the S3 command I need, namely:

aws s3 sync <local-directory> s3://<my-endpoint> --delete --storage-class=DEEP_ARCHIVE

So, I went to AWS’ official website and downloaded its command-line installer. The installation succeeded, which resulted in a new directory /usr/local/aws-cli and symlinks created in /usr/local/bin. Running aws --version gives:

aws-cli/2.25.12 Python/3.12.9 Linux/6.12.1-desktop-1omv2490 exe/x86_64.openmandriva

Problem

When I use the above command (aws s3 sync) as a regular non-root user, it works as expected, and shows me an output whose first lines are given below:

warning: Skipping file /mnt/backup/borg/config. File/Directory is not readable.
warning: Skipping file /mnt/backup/borg/data. File/Directory is not readable.
warning: Skipping file /mnt/backup/borg/hints.1800. File/Directory is not readable.
warning: Skipping file /mnt/backup/borg/index.1800. File/Directory is not readable.
warning: Skipping file /mnt/backup/borg/integrity.1800. File/Directory is not readable.
warning: Skipping file /mnt/backup/borg/nonce. File/Directory is not readable.
warning: Skipping file /mnt/backup/borg/README. File/Directory is not readable.
(dryrun) delete: s3://<my-endpoint>/borg/README        
(dryrun) delete: s3://<my-endpoint>/borg/config        
(dryrun) delete: s3://<my-endpoint>/borg/data/0/10     
(dryrun) delete: s3://<my-endpoint>/borg/data/0/100    
(dryrun) delete: s3://<my-endpoint>/borg/data/0/101
...

Note that the output above shows “(dryrun)”, as I ran the command with the option --dryrun.

The problem I’m losing hairs over is that when I run that same command as root, it shows no output. It simply returns, as if the option --quiet was passed (though it isn’t):

[root@omlx ~]# aws s3 sync <local-directory> s3://<my-endpoint> --delete --storage-class=DEEP_ARCHIVE
[root@omlx ~]#

Using the option --dryrun (as root) gives no output either.

If you take notice, the warnings I’m getting from the example output above are because /mnt/backup/borg has root-only permissions. That’s one reason I want to run the command as root. The other reason is that I want to run the command from inside an script that runs other root-level commands.

I don’t know if this problem is caused by OpenMandriva or if it’s a defect in the AWS CLI executable. The fact is that when I was on Arch Linux, I was able to use the command aws s3 sync with both root and non-root users, and both would show me the expected output.

Does anyone have any ideia what to do before I go bald? :upside_down_face:

Further details

  • journalctl gives no messages related to the issue whatsoever.
  • aws was configured both in root and non-root users, so the directories /root/.aws and /home/<user>/.aws are identical.
  • /etc/sudoers was changed so that secure_path includes /usr/local/bin.
  • Running aws s3 sync with sudo has the same effect as running it from a root session: that is, no output.
  • Running aws s3 ls s3://<my-endpoint> works and shows the expected output, both with root and non-root users, and also with sudo.
  • Running aws s3 sync with the option --debug does show output, both for root and non-root users, but their outputs are pretty much identical and nothing there indicates a problem.
  • IA assistance directed me at environment variables. I changed some, such as PATH and others I got from printenv that I thought could change something, but no effect.

System information

  • OS: OpenMandriva Lx ROME 25.04
  • DE: KDE Plasma 6.3.4 / KDE Frameworks 6.12.0 / Qt 6.9.0
  • Linux kernel: 6.12.1-desktop-1omv2490 (64-bit)
1 Like

Welcome! We are happy to see you here and hope you will call this your home.

This above my pay grade, but I am sure someone will know something. It may have to be built locally to figure it out.

1 Like

It turns out the problem was in the directory I was using for syncing, that is, /mnt/backup/borg. I reckon the problem was caused by resizing the disk partition where /mnt/backup lies, as I had shrunk that partition before installing OpenMandriva. Though I checked that partition after shrinking it (and before installing OpenMandriva) by creating and deleting files in it, for some reason the command aws s3 sync wouldn’t work specifically with the directory borg. I realized that was the problem as I created a directory /mnt/backup/test and the command worked with this one.

So, I deleted /mnt/backup/borg and created it again. After that, the command ran successfully with that directory, for both root and non-root users. Who knows what happened to the original directory. Weird, but I’m glad it’s solved.

3 Likes