Bug 29785

Summary: aws-cli does not work
Product: Mageia Reporter: Alex Kotov <alex_q_2000>
Component: RPM PackagesAssignee: Buchan Milne <bgmilne>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Normal    
Version: Cauldron   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: aws-cli-2.2.29-1.mga9.src.rpm CVE:
Status comment:

Description Alex Kotov 2021-12-19 14:40:39 CET
Hello, friends! :)

Yesterday I needed to upload a disk image (>5GB) for a Mageia virtual machine to a free bucket on YandexCloud and I decided to use the aws-cli package that Mageia-9 (Cauldron) has in order not to do anything with my hands...

And here I failed :(

> aws configure

cannot import name 'get_event_loop' from 'prompt_toolkit.eventloop' (/usr/lib/python3.9/site-packages/prompt_toolkit/eventloop/__init__.py)

Then I created the necessary configuration files ~/.aws/{credentials,config} with the necessary data aws_access_key_id/aws_secret_access_key manually and tried to get a list of objects from the bucket:

> aws --endpoint-url=https://storage.yandexcloud.net s3 ls --recursive s3://mageia-8-cloud

cannot import name 'get_event_loop' from 'prompt_toolkit.eventloop' (/usr/lib/python3.9/site-packages/prompt_toolkit/eventloop/__init__.py)

Since I still needed to download the object at any cost, I had to rebuild the s3fs-fuse package from Fedora-35 and mount the storage through it. If anyone needs it too, then I have s3fs-fuse here: https://github.com/AKotov-dev/s3fs-fuse

If you have time, could you fix aws-cli in Mageia-9-Cauldron? I think I'll have to use it in the future. Thanks. :)

p.s. Separately, I want to thank your specialists who build the kernel: Mageia-8 works fine in the cloud version, and "virtio" drivers are perfectly added. And in general - I really enjoyed working with Mageia in the cloud. :)

Sincerely,
Alex
Comment 1 Lewis Smith 2021-12-19 20:03:55 CET
Thank you for the report.

This thing looks new for Mageia 9: its Cauldron history goes back over 3y, but I cannot find any sign of it in Mageia 8. Nearest hit is 'ruby-aws-s3', the s3 having a bearing on this report.

Assigning to Buchan, the registered maintainer; although other packagers have been doing it too.

Assignee: bugsquad => bgmilne

Comment 2 Alex Kotov 2021-12-20 10:11:13 CET
@Lewis Smith
Hello, Lewis Smith. Thank you for your cooperation. It is very nice to feel your support, because you are always there at a difficult moment. There is a lot of snow in Russia now and we are in high spirits before the New Year. I hope that you are doing well too. :)

Since I don't understand anything in 'Python', I managed to find out something by experiment and I'll leave it here, maybe it will be useful for Buchan Milne. Now in the repository Mageia-9-Cauldron the package is located 'python3-prompt-toolkit-3.0.16-1.mga9.noarch.rpm', but with its versions >=3 'aws-cli' does not work.

I managed to run 'aws-cli' after downgrading to the package version 'python3-prompt-toolkit-2.0.10-1.mga9.noarch.rpm'. He and his *.src.rpm are in here: https://cloud.mail.ru/public/YdUp/khzBDAuVd I just rebuilt it with the sources 2.0.10 and overwritten its contents on top '3.0.16-1' and thereby replaced it. Of course, this is very ugly on my part, but perhaps it will be useful to find out the reasons. :)

Testing together with 'prompt_toolkit-2.0.10'...

# Configuration (fictitious)
> aws configure
AWS Access Key ID [****************ww]: 11111
AWS Secret Access Key [****************222]: 22222
Default region name [rrrrrr]: 33333
Default output format [wqwqw]: 44444

# Creating a new bucket 'mageia-8-cloud'
> aws --endpoint-url=https://storage.yandexcloud.net s3 mb s3://mageia-8-cloud
make_bucket: mageia-8-cloud

#I upload files from the current directory to the new bucket 'mageia-8-cloud'
> aws --endpoint-url=https://storage.yandexcloud.net s3 cp --recursive ./ s3://mageia-8-cloud
upload: ./python3-prompt-toolkit-2.0.10-1.mga9.noarch.rpm to s3://mageia-8-cloud/python3-prompt-toolkit-2.0.10-1.mga9.noarch.rpm
upload: ./python-prompt-toolkit-2.0.10-1.mga9.src.rpm to s3://mageia-8-cloud/python-prompt-toolkit-2.0.10-1.mga9.src.rpm

# I get a list of objects from the bucket 'mageia-8-cloud'
> aws --endpoint-url=https://storage.yandexcloud.net s3 ls --recursive s3://mageia-8-cloud
2021-12-20 02:59:30    2978712 python-prompt-toolkit-2.0.10-1.mga9.src.rpm
2021-12-20 02:59:29     556849 python3-prompt-toolkit-2.0.10-1.mga9.noarch.rpm

With best wishes,
Alex
Comment 3 Alex Kotov 2022-01-03 18:19:59 CET
@Buchan Milne
...for visual work with aws-cli:
AwsCli-GUI: https://github.com/AKotov-dev/awscli-gui

I compared two similar clients S3: 'aws-cli' and 's3cmd'. 'S3cmd' it turned out to be much more convenient, faster and more reliable than 'aws-cli'. If you have a desire to compare the work 'aws-cli' and 's3cmd', there is
S3cmd-GUI: https://github.com/AKotov-dev/s3cmd-gui

Sincerely,
Alex