Skip to content

Bucket Names/Endpoints/Permissions/CoreDump #421

Closed
@hnaik

Description

@hnaik

I am trying out the aws-sdk-s3 examples and here are some of the issues I am seeing:
(My examples are built with GCC 6.3.0)

I setup my credentials and it looks fine.

On my command line, I ran:

$ aws s3 ls

I get the following:

YYYY-mm-DD HH:MM:SS bucket_1
YYYY-mm-DD HH:MM:SS bucket_2
YYYY-mm-DD HH:MM:SS bucket_3

Then I ran the example:
$ ./list_buckets

and I got:

* bucket_1
* bucket_2
* bucket_3

So far, everything looks good and as expected. This also tells me I have the correct credentials setup.


Now I run:

$ aws s3 ls bucket_1

I get:

                                  PRE data/  
YYYY-mm-DD HH:MM:SS xxxxx data_1_1
YYYY-mm-DD HH:MM:SS xxxxx data_1_2

looks good.


Now when I run:

$ ./list_objects bucket_1

I see the following:

Objects in S3 bucket: bucket_1
ListObjects error: PermanentRedirect Unable to parse ExceptionName: PermanentRedirect Message: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.


I took suggestions from: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro and ran again:

$ ./list_objects http://s3.amazonaws.com/bucket_1

and see this:
ListObjects error: NoSuchBucket The specified bucket does not exist


Then I ran:
$ ./list_objects http://bucket_1.s3.amazonaws.com

and see this:
ListObjects error: NoSuchBucket The specified bucket does not exist


Then I run:
$ ./list_objects s3.amazonaws.com/bucket_1

and see this:
ListObjects error: AccessDenied Access Denied


Also, when I enable the line:

Aws::ShutdownAPI(options);
I get a core dump and here is the gdb backtrace:


#0  __GI___pthread_mutex_lock (mutex=0x280) at ../nptl/pthread_mutex_lock.c:67
#1  0xabcdef9876543210 in __gthread_mutex_lock (__mutex=0x280) at /home/username/local/gcc-6.3.0/include/c++/6.3.0/x86_64-linux-gnu/bits/gthr-default.h:748
#2  0xabcdef9876543210 in std::mutex::lock (this=0x280) at /home/username/local/gcc-6.3.0/include/c++/6.3.0/bits/std_mutex.h:103
#3  0xabcdef9876543210 in Aws::Utils::Crypto::OpenSSL::locking_fn (mode=9, n=16) at /home/username/git/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/crypto/openssl/CryptoImpl.cpp:83
#4  0xabcdef9876543210 in CRYPTO_add_lock () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#5  0xabcdef9876543210 in SSL_free () from /lib/x86_64-linux-gnu/libssl.so.1.0.0
#6  0xabcdef9876543210 in ?? () from /usr/lib/x86_64-linux-gnu/libcurl.so.4
#7  0xabcdef9876543210 in ?? () from /usr/lib/x86_64-linux-gnu/libcurl.so.4
#8  0xabcdef9876543210 in curl_multi_cleanup () from /usr/lib/x86_64-linux-gnu/libcurl.so.4
#9  0xabcdef9876543210 in ?? () from /usr/lib/x86_64-linux-gnu/libcurl.so.4
#10 0xabcdef9876543210 in curl_easy_cleanup () from /usr/lib/x86_64-linux-gnu/libcurl.so.4
#11 0xabcdef9876543210 in Aws::Http::CurlHandleContainer::~CurlHandleContainer (this=0x14a1ca8, __in_chrg=<optimized out>) at /home/username/git/aws-sdk-cpp/aws-cpp-sdk-core/source/http/curl/CurlHandleContainer.cpp:42
#12 0xabcdef9876543210 in Aws::Http::CurlHttpClient::~CurlHttpClient (this=0x14a1c40, __in_chrg=<optimized out>) at /home/username/git/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/http/curl/CurlHttpClient.h:33
#13 0xabcdef9876543210 in __gnu_cxx::new_allocator<Aws::Http::CurlHttpClient>::destroy<Aws::Http::CurlHttpClient> (this=0x14a1c40, __p=0x14a1c40) at /home/username/local/gcc-6.3.0/include/c++/6.3.0/ext/new_allocator.h:124
#14 0xabcdef9876543210 in std::allocator_traits<Aws::Allocator<Aws::Http::CurlHttpClient> >::_S_destroy<Aws::Allocator<Aws::Http::CurlHttpClient>, Aws::Http::CurlHttpClient> (__a=..., __p=0x14a1c40) at /home/username/local/gcc-6.3.0/include/c++/6.3.0/bits/alloc_traits.h:236
#15 0xabcdef9876543210 in std::allocator_traits<Aws::Allocator<Aws::Http::CurlHttpClient> >::destroy<Aws::Http::CurlHttpClient> (__a=..., __p=0x14a1c40) at /home/username/local/gcc-6.3.0/include/c++/6.3.0/bits/alloc_traits.h:336
#16 0xabcdef9876543210 in std::_Sp_counted_ptr_inplace<Aws::Http::CurlHttpClient, Aws::Allocator<Aws::Http::CurlHttpClient>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x14a1c30) at /home/username/local/gcc-6.3.0/include/c++/6.3.0/bits/shared_ptr_base.h:529
#17 0xabcdef9876543210 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() ()
#18 0xabcdef9876543210 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() ()
#19 0xabcdef9876543210 in std::__shared_ptr<Aws::Http::HttpClient, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x7ffee2de1408, __in_chrg=<optimized out>) at /home/username/local/gcc-6.3.0/include/c++/6.3.0/bits/shared_ptr_base.h:928
#20 0xabcdef9876543210 in std::shared_ptr<Aws::Http::HttpClient>::~shared_ptr (this=0x7ffee2de1408, __in_chrg=<optimized out>) at /home/username/local/gcc-6.3.0/include/c++/6.3.0/bits/shared_ptr.h:93
#21 0xabcdef9876543210 in Aws::Client::AWSClient::~AWSClient (this=0x7ffee2de1400, __in_chrg=<optimized out>) at /home/username/git/aws-sdk-cpp/aws-cpp-sdk-core/source/client/AWSClient.cpp:110
#22 0xabcdef9876543210 in Aws::Client::AWSXMLClient::~AWSXMLClient (this=0x7ffee2de1400, __in_chrg=<optimized out>) at /home/username/git/aws-sdk-cpp/aws-cpp-sdk-core/include/aws/core/client/AWSClient.h:259
#23 0xabcdef9876543210 in Aws::S3::S3Client::~S3Client (this=0x7ffee2de1400, __in_chrg=<optimized out>) at /home/username/git/aws-sdk-cpp/aws-cpp-sdk-s3/source/S3Client.cpp:143
#24 0xabcdef9876543210 in main ()


What am I missing? This is likely more of a question than a issue with the SDK, I realize I might be missing something fundamental, because it looks like everyone else has gotten these examples to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedWe are asking the community to submit a PR to resolve this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions