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

ACL.py AttributeError: 'NoneType' object has no attribute 'lower' #936

Closed
fviard opened this issue Nov 27, 2017 · 2 comments
Closed

ACL.py AttributeError: 'NoneType' object has no attribute 'lower' #936

fviard opened this issue Nov 27, 2017 · 2 comments
Assignees

Comments

@fviard
Copy link
Contributor

fviard commented Nov 27, 2017

Report from "astekolshchikov" on s3tools-bugs:

Invoked as: ./s3cmd-2.0.1/s3cmd setacl --acl-revoke=read:m3rouser s3://test --recursive
Problem: AttributeError: 'NoneType' object has no attribute 'lower'
S3cmd: 2.0.1
python: 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2]
environment LANG=ru_RU.UTF-8

Traceback (most recent call last):
File "./s3cmd-2.0.1/s3cmd", line 3073, in
rc = main()
File "./s3cmd-2.0.1/s3cmd", line 2989, in main
rc = cmd_func(args)
File "./s3cmd-2.0.1/s3cmd", line 1921, in cmd_setacl
update_acl(s3, uri, seq_label)
File "./s3cmd-2.0.1/s3cmd", line 2550, in update_acl
acl.revoke(**revoke)
File "/root/s3cmd-2.0.1/S3/ACL.py", line 191, in revoke
self.grantees = [g for g in self.grantees if not ((g.display_name.lower() == name and g.permission.upper() == permission)
AttributeError: 'NoneType' object has no attribute 'lower'

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
An unexpected error has occurred.
Please try reproducing the error using
the latest s3cmd code from the git master
branch found at:
...
and have a look at the known issues list:
...
If the error persists, please report the
above lines (removing any private
info as necessary) to:
s3tools-bugs@lists.sourceforge.net
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

@fviard fviard self-assigned this Nov 27, 2017
@fviard
Copy link
Contributor Author

fviard commented Nov 28, 2017

More info from the reporter:

In the meantime, can you tell me if your destination bucket is on
"amazon s3" or on an alternative s3 compatible server?
We use "alternative s3 compatible server" - radosgw attached to ceph.

root@radosgw:~# ./s3cmd-master/s3cmd setacl --acl-revoke=all:m3rouser s3://test --recursive
s3://test/test/test.pdf: ACL updated
root@radosgw:~# ./s3cmd-master/s3cmd info s3://test | grep ACL
   ACL:       media3 ro user: READ
   ACL:       media3 ro user: READ_ACP
root@radosgw:~# ./s3cmd-master/s3cmd --version
s3cmd version 2.0.1+

@brutasse
Copy link

This happens on AWS s3 as well, when granting permissions to two email addresses at once: /usr/bin/s3cmd setacl --acl-grant full_control:test1@example.com --acl-grant full_control:test2@example.com s3://my-bucket

Root cause seems to be that Grantees are created in-memory without a display_name: https://github.com/s3tools/s3cmd/blob/master/S3/ACL.py#L166

Changing to grantee.name = grantee.display_name = name fixes the issue.

@fviard fviard closed this as completed in 95be407 Mar 3, 2018
fviard added a commit that referenced this issue Mar 3, 2018
Fixes #936 - Fix setacl command exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants