aws / aws-sdk-cpp

AWS SDK for C++
Apache License 2.0
1.96k stars 1.06k forks source link

S3 PutObjectRequest Outcome Cannot access memory at address #513

Closed imfranklin closed 7 years ago

imfranklin commented 7 years ago

This simple code, quickly broken out from its full application, runs successfully on its development environment of macOS Sierra. Unfortunately it fails 100% on the production environment of CentOS Linux release 7.3.1611 (on EC2). Both envs are using the same SDK release, 1.0.110.

#include <aws/core/Aws.h>
#include <aws/core/Version.h>
#include <aws/core/auth/AWSCredentialsProvider.h>
#include <aws/s3/S3Client.h>
#include <aws/s3/model/PutObjectRequest.h>
#include <iostream>
#include <fstream>

int main()
{
    Aws::SDKOptions options;
    Aws::InitAPI(options);

    {
        const char *TEST_TAG = "PleaseUploadTag";
        std::cout << "AWS-SDK-CPP VERSION: " << Aws::Version::GetVersionString() << std::endl;

        const Aws::String s3_key_id = "XXXXXXXXXXXXXXXXXXXX";
        const Aws::String s3_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
        const Aws::String bucket_name = "testingbucket";
        const Aws::String key_name = "testingkey";

        Aws::Client::ClientConfiguration config;
        Aws::S3::S3Client s3_client(Aws::Auth::AWSCredentials(s3_key_id, s3_secret), config);

        auto input_data = Aws::MakeShared<Aws::FStream>(TEST_TAG, "/path/to/file.jpg", std::ios_base::in);

        Aws::S3::Model::PutObjectRequest put_object_request;
        put_object_request.WithBucket(bucket_name).WithKey(key_name);
        put_object_request.SetBody(input_data);

        auto s3_put_outcome = s3_client.PutObject(put_object_request);
        if (s3_put_outcome.IsSuccess()) {
            std::cout << "S3 IS GOOD!" << std::endl;
        } else {
            std::cout << "S3...FAILED." << std::endl;
        }
    }

    Aws::ShutdownAPI(options);

    return 0;
}

The program is compiled with g++ (GCC) 4.8.5 - g++ -g --std=c++11 -L/usr/local/lib -laws-cpp-sdk-core -laws-cpp-sdk-s3 -lstdc++ aws-test.cpp -o aws-test. Whether the SDK has been installed in full or just the needed services via -DBUILD_ONLY it still fails.

The relevant gdb output follows:

#0  main () at aws-test.cpp:43
        s3_key_id = "XXXXXXXXXXXXXXXXXXXX"
        bucket_name = "testingbucket"
        key_name = "testingkey"
        s3_client = {<Aws::Client::AWSXMLClient> = {<Aws::Client::AWSClient> = {_vptr.AWSClient = 0x7ffff790d6b0 <vtable for Aws::S3::S3Client+16>, m_httpClient = std::shared_ptr (count 1, weak 0) 0x618a18, m_signer = std::shared_ptr (count 1, weak 0) 0x618328, m_errorMarshaller = 
    std::shared_ptr (count 1, weak 0) 0x6182f8, m_retryStrategy = std::shared_ptr (count 2, weak 0) 0x618288, m_writeRateLimiter = std::shared_ptr (empty) 0x0, m_readRateLimiter = std::shared_ptr (empty) 0x0, m_userAgent = "aws-sdk-cpp/1.0.110 Linux/3.10.0-327.10.1.el7.x86_64 x86_64", m_hash = 
    std::shared_ptr (count 1, weak 0) 0x6189e8, static s_refCount = {<std::__atomic_base<int>> = {_M_i = 1}, <No data fields>}}, <No data fields>}, m_baseUri = "s3.amazonaws.com", m_scheme = "https", m_executor = std::shared_ptr (count 2, weak 0) 0x6182c8, m_useVirtualAdressing = true}
        s3_put_outcome = {result = {m_expiration = <error reading variable: Cannot access memory at address 0xffffefbd7fafffe8>, m_eTag = <error reading variable: Cannot access memory at address 0xffffffffffffffec>, m_serverSideEncryption = (unknown: 4294959072), 
            m_versionId = "\000\220\222\367\377\177\000\000@\226\377\367\377\177\000\000 \366\334\367\377\177\000\000X\233\377\367\377\177\000\000\330\346\377\367\377\177\000\000h\226\377\367\377\177\000\000\000\000\000\000\000\000\000\000ؚ\377\367\377\177\000\000\000\000\000\000\000\000\000\000\240\366\334\367\377\177\000\000\200\367\334\367\377\177\000\000p\367\334\367\377\177\000\000\000\000\000\000\000\000\000\000\060\367\334\367\377\177\000\000@\367\334\367\377\177\000\000\260\367\334\367\377\177\000\000\300\367\334\367\377\177\000\000\320\367\334\367\377\177\000\000P\367\334\367\377\177\000\000`\367\334\367\377\177\000\000\300\366\334\367\377\177\000\000\320\366\334\367\377\177\000\000\260\366\334\367\377\177", '\000' <repeats 42 times>...<Address 0x7ffff7fff000 out of bounds>, 
            m_sSECustomerAlgorithm = "libz.so.1\000libstdc++.so.6\000libm.so.6\000libgcc_s.so.1\000libc.so.6\000__lxstat\000_edata\000__bss_start\000_end\000libaws-cpp-sdk-core.so", '\000' <repeats 17 times>, "GLIBC_2.2.5\000CXXABI_1.3\000GLIBCXX_3.4.11\000GLIBCXX_3.4.14\000GLIBCXX_3.4.9\000CXX"...<Address 0x7ffff7dfd000 out of bounds>, m_sSECustomerKeyMD5 = <error reading variable: Cannot access memory at address 0xffffffffbbdfffe8>, m_sSEKMSKeyId = <error reading variable: Cannot access memory at address 0xffffefbd7fafffe8>, m_requestCharged = (Aws::S3::Model::requester | unknown: 2)}, error = {
            m_errorType = 4294959072, 
            m_exceptionName = "\000\220\222\367\377\177\000\000@\226\377\367\377\177\000\000 \366\334\367\377\177\000\000X\233\377\367\377\177\000\000\330\346\377\367\377\177\000\000h\226\377\367\377\177\000\000\000\000\000\000\000\000\000\000ؚ\377\367\377\177\000\000\000\000\000\000\000\000\000\000\240\366\334\367\377\177\000\000\200\367\334\367\377\177\000\000p\367\334\367\377\177\000\000\000\000\000\000\000\000\000\000\060\367\334\367\377\177\000\000@\367\334\367\377\177\000\000\260\367\334\367\377\177\000\000\300\367\334\367\377\177\000\000\320\367\334\367\377\177\000\000P\367\334\367\377\177\000\000`\367\334\367\377\177\000\000\300\366\334\367\377\177\000\000\320\366\334\367\377\177\000\000\260\366\334\367\377\177", '\000' <repeats 42 times>...<Address 0x7ffff7fff000 out of bounds>, 
            m_message = "libcrypto.so.10\000libz.so.1\000libstdc++.so.6\000libm.so.6\000libgcc_s.so.1\000libc.so.6\000__lxstat\000_edata\000__bss_start\000_end\000libaws-cpp-sdk-core.so", '\000' <repeats 17 times>, "GLIBC_2.2.5\000CXXABI_1.3\000GLIBCXX_3.4.11\000GLIBCXX_3.4.14\000"...<Address 0x7ffff7dfd000 out of bounds>, m_responseHeaders = std::map with 140737348442292 elements = {[""] = ""<error reading variable: Cannot access memory at address 0x18>...}, m_isRetryable = 32}, success = 8}
        input_data = std::shared_ptr (count 2, weak 0) 0x618be8
        put_object_request = {<Aws::AmazonStreamingWebServiceRequest> = {<Aws::AmazonWebServiceRequest> = {_vptr.AmazonWebServiceRequest = 0x60b330 <vtable for Aws::S3::Model::PutObjectRequest+16>, 
              m_responseStreamFactory = {<std::_Maybe_unary_or_binary_function<std::basic_iostream<char, std::char_traits<char> >*>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff7b27037
     <Aws::Utils::Stream::DefaultResponseStreamFactoryMethod()>, _M_const_object = 0x7ffff7b27037 <Aws::Utils::Stream::DefaultResponseStreamFactoryMethod()>, _M_function_pointer = 0x7ffff7b27037 <Aws::Utils::Stream::DefaultResponseStreamFactoryMethod()>, 
                      _M_member_pointer = &virtual table offset 140737349054518}, _M_pod_data = "7p\262\367\377\177\000\000\000\000\000\000\000\000\000"}, _M_manager = 0x7ffff7ae9251
     <std::_Function_base::_Base_manager<std::iostream* (*)()>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation)>}, _M_invoker = 0x7ffff7ae9232 <std::_Function_handler<std::iostream* (), std::iostream* (*)()>::_M_invoke(std::_Any_data const&)>}, 
              m_onDataReceived = {<std::_Maybe_unary_or_binary_function<void, Aws::Http::HttpRequest const*, Aws::Http::HttpResponse*, long long>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x4042ee, 
                      _M_const_object = 0x4042ee, _M_function_pointer = 0x4042ee, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x4042ee, this adjustment 140737321389296}, _M_pod_data = "\356B@\000\000\000\000\000\360L\f\366\377\177\000"}, _M_manager = 0x0}, 
                _M_invoker = 0x100000000}, m_onDataSent = {<std::_Maybe_unary_or_binary_function<void, Aws::Http::HttpRequest const*, long long>> = {<std::binary_function<Aws::Http::HttpRequest const*, long long, void>> = {<No data fields>}, <No data fields>}, <std::_Function_base> = {
                  static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x100000325, _M_const_object = 0x100000325, _M_function_pointer = 0x100000325, _M_member_pointer = &virtual table offset 4294968100, this adjustment 226670640}, 
                    _M_pod_data = "%\003\000\000\001\000\000\000\060\270\202\r\000\000\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffe380}, 
              m_continueRequest = {<std::_Maybe_unary_or_binary_function<bool, Aws::Http::HttpRequest const*>> = {<std::unary_function<Aws::Http::HttpRequest const*, bool>> = {<No data fields>}, <No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {
                    _M_unused = {_M_object = 0x1, _M_const_object = 0x1, _M_function_pointer = 0x1, _M_member_pointer = &virtual table offset 0, this adjustment 140737354011400}, _M_pod_data = "\001\000\000\000\000\000\000\000\b\023\376\367\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7ffff7ffe148}, 
              m_requestRetryHandler = {<std::_Maybe_unary_or_binary_function<void, Aws::AmazonWebServiceRequest const&>> = {<std::unary_function<Aws::AmazonWebServiceRequest const&, void>> = {<No data fields>}, <No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, 
                  _M_functor = {_M_unused = {_M_object = 0x7ffff7de6caf <_dl_lookup_symbol_x+287>, _M_const_object = 0x7ffff7de6caf <_dl_lookup_symbol_x+287>, _M_function_pointer = 0x7ffff7de6caf <_dl_lookup_symbol_x+287>, _M_member_pointer = &virtual table offset 140737351937198}, 
                    _M_pod_data = "\257l\336\367\377\177\000\000\000\000\000\000\000\000\000"}, _M_manager = 0x0}, _M_invoker = 0x7fff00000001}}, m_bodyStream = std::shared_ptr (count 2, weak 0) 0x618be8, m_contentType = "binary/octet-stream"}, m_aCL = Aws::S3::Model::NOT_SET, m_aCLHasBeenSet = false, 
          m_bucket = "testingbucket", m_bucketHasBeenSet = true, m_cacheControl = "", m_cacheControlHasBeenSet = false, m_contentDisposition = "", m_contentDispositionHasBeenSet = false, m_contentEncoding = "", m_contentEncodingHasBeenSet = false, m_contentLanguage = "", 
          m_contentLanguageHasBeenSet = false, m_contentLength = 0, m_contentLengthHasBeenSet = false, m_contentMD5 = "", m_contentMD5HasBeenSet = false, m_expires = {m_time = {__d = {__r = 0}}, m_valid = true}, m_expiresHasBeenSet = false, m_grantFullControl = "", m_grantFullControlHasBeenSet = false, 
          m_grantRead = "", m_grantReadHasBeenSet = false, m_grantReadACP = "", m_grantReadACPHasBeenSet = false, m_grantWriteACP = "", m_grantWriteACPHasBeenSet = false, m_key = "testingkey", m_keyHasBeenSet = true, m_metadata = std::map with 0 elements, m_metadataHasBeenSet = false, 
          m_serverSideEncryption = Aws::S3::Model::NOT_SET, m_serverSideEncryptionHasBeenSet = false, m_storageClass = Aws::S3::Model::NOT_SET, m_storageClassHasBeenSet = false, m_websiteRedirectLocation = "", m_websiteRedirectLocationHasBeenSet = false, m_sSECustomerAlgorithm = "", 
          m_sSECustomerAlgorithmHasBeenSet = false, m_sSECustomerKey = "", m_sSECustomerKeyHasBeenSet = false, m_sSECustomerKeyMD5 = "", m_sSECustomerKeyMD5HasBeenSet = false, m_sSEKMSKeyId = "", m_sSEKMSKeyIdHasBeenSet = false, m_requestPayer = Aws::S3::Model::NOT_SET, m_requestPayerHasBeenSet = false, 
          m_tagging = "", m_taggingHasBeenSet = false}
...

Are there any known issues on CentOS? Have we missed something in using the SDK on Linux as opposed to macOS?

JonathanHenson commented 7 years ago

you need scoping brackets between the init and shutdown calls and the code that uses the memory.

Sent from my iPhone

On Apr 28, 2017, at 2:18 PM, imfranklin notifications@github.com wrote:

This simple code, quickly broken out from its full application, runs successfully on its development environment of macOS Sierra. Unfortunately it fails 100% on the production environment of CentOS Linux release 7.3.1611 (on EC2). Both envs are using the same SDK release, 1.0.110.

include <aws/core/Aws.h>

include <aws/core/Version.h>

include <aws/core/auth/AWSCredentialsProvider.h>

include <aws/s3/S3Client.h>

include <aws/s3/model/PutObjectRequest.h>

include

include

int main() { const char *TEST_TAG = "PleaseUploadTag"; const Aws::String s3_key_id = "XXXXXXXXXXXXXXXXXXXX"; const Aws::String s3_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const Aws::String bucket_name = "testingbucket"; const Aws::String key_name = "testingkey";

std::cout << "AWS-SDK-CPP VERSION: " << Aws::Version::GetVersionString() << std::endl;

Aws::SDKOptions options;
Aws::InitAPI(options);

Aws::Client::ClientConfiguration config;
Aws::S3::S3Client s3_client(Aws::Auth::AWSCredentials(s3_key_id, s3_secret), config);

auto input_data = Aws::MakeShared<Aws::FStream>(TEST_TAG, "/path/to/file.jpg", std::ios_base::in);

Aws::S3::Model::PutObjectRequest put_object_request;
put_object_request.WithBucket(bucket_name).WithKey(key_name);
put_object_request.SetBody(input_data);

auto s3_put_outcome = s3_client.PutObject(put_object_request);
if (s3_put_outcome.IsSuccess()) {
    std::cout << "S3 IS GOOD!" << std::endl;
} else {
    std::cout << "S3...FAILED." << std::endl;
}

Aws::ShutdownAPI(options);

return 0;

} The program is compiled with g++ (GCC) 4.8.5 - g++ -g --std=c++11 -L/usr/local/lib -laws-cpp-sdk-core -laws-cpp-sdk-s3 -lstdc++ aws-test.cpp -o aws-test. Whether the SDK has been installed in full or just the needed services via -DBUILD_ONLY it still fails.

The relevant gdb output follows:

0 main () at aws-test.cpp:43

    s3_key_id = "XXXXXXXXXXXXXXXXXXXX"
    bucket_name = "testingbucket"
    key_name = "testingkey"
    s3_client = {<Aws::Client::AWSXMLClient> = {<Aws::Client::AWSClient> = {_vptr.AWSClient = 0x7ffff790d6b0 <vtable for Aws::S3::S3Client+16>, m_httpClient = std::shared_ptr (count 1, weak 0) 0x618a18, m_signer = std::shared_ptr (count 1, weak 0) 0x618328, m_errorMarshaller = 
std::shared_ptr (count 1, weak 0) 0x6182f8, m_retryStrategy = std::shared_ptr (count 2, weak 0) 0x618288, m_writeRateLimiter = std::shared_ptr (empty) 0x0, m_readRateLimiter = std::shared_ptr (empty) 0x0, m_userAgent = "aws-sdk-cpp/1.0.110 Linux/3.10.0-327.10.1.el7.x86_64 x86_64", m_hash = 
std::shared_ptr (count 1, weak 0) 0x6189e8, static s_refCount = {<std::__atomic_base<int>> = {_M_i = 1}, <No data fields>}}, <No data fields>}, m_baseUri = "s3.amazonaws.com", m_scheme = "https", m_executor = std::shared_ptr (count 2, weak 0) 0x6182c8, m_useVirtualAdressing = true}
    s3_put_outcome = {result = {m_expiration = <error reading variable: Cannot access memory at address 0xffffefbd7fafffe8>, m_eTag = <error reading variable: Cannot access memory at address 0xffffffffffffffec>, m_serverSideEncryption = (unknown: 4294959072), 
        m_versionId = "\000\220\222\367\377\177\000\000@\226\377\367\377\177\000\000 \366\334\367\377\177\000\000X\233\377\367\377\177\000\000\330\346\377\367\377\177\000\000h\226\377\367\377\177\000\000\000\000\000\000\000\000\000\000ؚ\377\367\377\177\000\000\000\000\000\000\000\000\000\000\240\366\334\367\377\177\000\000\200\367\334\367\377\177\000\000p\367\334\367\377\177\000\000\000\000\000\000\000\000\000\000\060\367\334\367\377\177\000\000@\367\334\367\377\177\000\000\260\367\334\367\377\177\000\000\300\367\334\367\377\177\000\000\320\367\334\367\377\177\000\000P\367\334\367\377\177\000\000`\367\334\367\377\177\000\000\300\366\334\367\377\177\000\000\320\366\334\367\377\177\000\000\260\366\334\367\377\177", '\000' <repeats 42 times>...<Address 0x7ffff7fff000 out of bounds>, 
        m_sSECustomerAlgorithm = "libz.so.1\000libstdc++.so.6\000libm.so.6\000libgcc_s.so.1\000libc.so.6\000__lxstat\000_edata\000__bss_start\000_end\000libaws-cpp-sdk-core.so", '\000' <repeats 17 times>, "GLIBC_2.2.5\000CXXABI_1.3\000GLIBCXX_3.4.11\000GLIBCXX_3.4.14\000GLIBCXX_3.4.9\000CXX"...<Address 0x7ffff7dfd000 out of bounds>, m_sSECustomerKeyMD5 = <error reading variable: Cannot access memory at address 0xffffffffbbdfffe8>, m_sSEKMSKeyId = <error reading variable: Cannot access memory at address 0xffffefbd7fafffe8>, m_requestCharged = (Aws::S3::Model::requester | unknown: 2)}, error = {
        m_errorType = 4294959072, 
        m_exceptionName = "\000\220\222\367\377\177\000\000@\226\377\367\377\177\000\000 \366\334\367\377\177\000\000X\233\377\367\377\177\000\000\330\346\377\367\377\177\000\000h\226\377\367\377\177\000\000\000\000\000\000\000\000\000\000ؚ\377\367\377\177\000\000\000\000\000\000\000\000\000\000\240\366\334\367\377\177\000\000\200\367\334\367\377\177\000\000p\367\334\367\377\177\000\000\000\000\000\000\000\000\000\000\060\367\334\367\377\177\000\000@\367\334\367\377\177\000\000\260\367\334\367\377\177\000\000\300\367\334\367\377\177\000\000\320\367\334\367\377\177\000\000P\367\334\367\377\177\000\000`\367\334\367\377\177\000\000\300\366\334\367\377\177\000\000\320\366\334\367\377\177\000\000\260\366\334\367\377\177", '\000' <repeats 42 times>...<Address 0x7ffff7fff000 out of bounds>, 
        m_message = "libcrypto.so.10\000libz.so.1\000libstdc++.so.6\000libm.so.6\000libgcc_s.so.1\000libc.so.6\000__lxstat\000_edata\000__bss_start\000_end\000libaws-cpp-sdk-core.so", '\000' <repeats 17 times>, "GLIBC_2.2.5\000CXXABI_1.3\000GLIBCXX_3.4.11\000GLIBCXX_3.4.14\000"...<Address 0x7ffff7dfd000 out of bounds>, m_responseHeaders = std::map with 140737348442292 elements = {[""] = ""<error reading variable: Cannot access memory at address 0x18>...}, m_isRetryable = 32}, success = 8}
    input_data = std::shared_ptr (count 2, weak 0) 0x618be8
    put_object_request = {<Aws::AmazonStreamingWebServiceRequest> = {<Aws::AmazonWebServiceRequest> = {_vptr.AmazonWebServiceRequest = 0x60b330 <vtable for Aws::S3::Model::PutObjectRequest+16>, 
          m_responseStreamFactory = {<std::_Maybe_unary_or_binary_function<std::basic_iostream<char, std::char_traits<char> >*>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff7b27037
 <Aws::Utils::Stream::DefaultResponseStreamFactoryMethod()>, _M_const_object = 0x7ffff7b27037 <Aws::Utils::Stream::DefaultResponseStreamFactoryMethod()>, _M_function_pointer = 0x7ffff7b27037 <Aws::Utils::Stream::DefaultResponseStreamFactoryMethod()>, 
                  _M_member_pointer = &virtual table offset 140737349054518}, _M_pod_data = "7p\262\367\377\177\000\000\000\000\000\000\000\000\000"}, _M_manager = 0x7ffff7ae9251
 <std::_Function_base::_Base_manager<std::iostream* (*)()>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation)>}, _M_invoker = 0x7ffff7ae9232 <std::_Function_handler<std::iostream* (), std::iostream* (*)()>::_M_invoke(std::_Any_data const&)>}, 
          m_onDataReceived = {<std::_Maybe_unary_or_binary_function<void, Aws::Http::HttpRequest const*, Aws::Http::HttpResponse*, long long>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x4042ee, 
                  _M_const_object = 0x4042ee, _M_function_pointer = 0x4042ee, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x4042ee, this adjustment 140737321389296}, _M_pod_data = "\356B@\000\000\000\000\000\360L\f\366\377\177\000"}, _M_manager = 0x0}, 
            _M_invoker = 0x100000000}, m_onDataSent = {<std::_Maybe_unary_or_binary_function<void, Aws::Http::HttpRequest const*, long long>> = {<std::binary_function<Aws::Http::HttpRequest const*, long long, void>> = {<No data fields>}, <No data fields>}, <std::_Function_base> = {
              static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x100000325, _M_const_object = 0x100000325, _M_function_pointer = 0x100000325, _M_member_pointer = &virtual table offset 4294968100, this adjustment 226670640}, 
                _M_pod_data = "%\003\000\000\001\000\000\000\060\270\202\r\000\000\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffe380}, 
          m_continueRequest = {<std::_Maybe_unary_or_binary_function<bool, Aws::Http::HttpRequest const*>> = {<std::unary_function<Aws::Http::HttpRequest const*, bool>> = {<No data fields>}, <No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {
                _M_unused = {_M_object = 0x1, _M_const_object = 0x1, _M_function_pointer = 0x1, _M_member_pointer = &virtual table offset 0, this adjustment 140737354011400}, _M_pod_data = "\001\000\000\000\000\000\000\000\b\023\376\367\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7ffff7ffe148}, 
          m_requestRetryHandler = {<std::_Maybe_unary_or_binary_function<void, Aws::AmazonWebServiceRequest const&>> = {<std::unary_function<Aws::AmazonWebServiceRequest const&, void>> = {<No data fields>}, <No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, 
              _M_functor = {_M_unused = {_M_object = 0x7ffff7de6caf <_dl_lookup_symbol_x+287>, _M_const_object = 0x7ffff7de6caf <_dl_lookup_symbol_x+287>, _M_function_pointer = 0x7ffff7de6caf <_dl_lookup_symbol_x+287>, _M_member_pointer = &virtual table offset 140737351937198}, 
                _M_pod_data = "\257l\336\367\377\177\000\000\000\000\000\000\000\000\000"}, _M_manager = 0x0}, _M_invoker = 0x7fff00000001}}, m_bodyStream = std::shared_ptr (count 2, weak 0) 0x618be8, m_contentType = "binary/octet-stream"}, m_aCL = Aws::S3::Model::NOT_SET, m_aCLHasBeenSet = false, 
      m_bucket = "testingbucket", m_bucketHasBeenSet = true, m_cacheControl = "", m_cacheControlHasBeenSet = false, m_contentDisposition = "", m_contentDispositionHasBeenSet = false, m_contentEncoding = "", m_contentEncodingHasBeenSet = false, m_contentLanguage = "", 
      m_contentLanguageHasBeenSet = false, m_contentLength = 0, m_contentLengthHasBeenSet = false, m_contentMD5 = "", m_contentMD5HasBeenSet = false, m_expires = {m_time = {__d = {__r = 0}}, m_valid = true}, m_expiresHasBeenSet = false, m_grantFullControl = "", m_grantFullControlHasBeenSet = false, 
      m_grantRead = "", m_grantReadHasBeenSet = false, m_grantReadACP = "", m_grantReadACPHasBeenSet = false, m_grantWriteACP = "", m_grantWriteACPHasBeenSet = false, m_key = "testingkey", m_keyHasBeenSet = true, m_metadata = std::map with 0 elements, m_metadataHasBeenSet = false, 
      m_serverSideEncryption = Aws::S3::Model::NOT_SET, m_serverSideEncryptionHasBeenSet = false, m_storageClass = Aws::S3::Model::NOT_SET, m_storageClassHasBeenSet = false, m_websiteRedirectLocation = "", m_websiteRedirectLocationHasBeenSet = false, m_sSECustomerAlgorithm = "", 
      m_sSECustomerAlgorithmHasBeenSet = false, m_sSECustomerKey = "", m_sSECustomerKeyHasBeenSet = false, m_sSECustomerKeyMD5 = "", m_sSECustomerKeyMD5HasBeenSet = false, m_sSEKMSKeyId = "", m_sSEKMSKeyIdHasBeenSet = false, m_requestPayer = Aws::S3::Model::NOT_SET, m_requestPayerHasBeenSet = false, 
      m_tagging = "", m_taggingHasBeenSet = false}

... Are there any known issues on CentOS? Have we missed something in using the SDK on Linux as opposed to macOS?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

imfranklin commented 7 years ago

Thanks for the super quick reply. Even when scoped, though, the same <error reading variable: Cannot access memory at address 0xffffffffffffffe8> for s3_put_outcome persist.

JonathanHenson commented 7 years ago

sorry, I missed the first several lines. You can't use ANY sdk types or functions prior to the initAPI call. It swaps the memory manager out from under you. can you move aws::string etc... after the init call and see if that helps?

Sent from my iPhone

On Apr 28, 2017, at 2:48 PM, imfranklin notifications@github.com wrote:

Thanks for the super quick reply. Even when scoped, though, the same <error reading variable: Cannot access memory at address 0xffffffffffffffe8> for s3_put_outcome persist.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

imfranklin commented 7 years ago

Moving the SDK types now yields a Python Exception(?):

Python Exception <type 'exceptions.ValueError'> Cannot find type const Aws::Http::HeaderValueCollection::_Rep_type: 
        headers = std::map with 0 elements
        awsDateHeaderIter = {first = <error reading variable: Cannot access memory at address 0xffffffffffffffe8>, second = ""}
        dateHeaderIter = {first = <error reading variable: Cannot access memory at address 0xffffffffffffffe8>, second = ""}
        diff = {__r = 0}
        outcome = {result = std::shared_ptr (empty) 0x0, error = {m_errorType = Aws::Client::NETWORK_CONNECTION, m_exceptionName = "", m_message = "Unable to connect to endpoint", m_responseHeaders = std::map with 0 elements, m_isRetryable = true}, success = false}
        retries = 0
#8  0x00007ffff7b075fc in Aws::Client::AWSXMLClient::MakeRequest (this=0x7fffffffdea0, uri="https://testingbucket/testingkey", request=..., method=Aws::Http::HTTP_PUT) at /var/nginx/aws-sdk-cpp-1.0.110/aws-cpp-sdk-core/source/client/AWSClient.cpp:618
        httpOutcome = {result = std::shared_ptr (expired, weak 0) 0x0, error = {m_errorType = 4160723800, 
            m_exceptionName = "\203\370\000\177\022\017\205H\002\000\000I\203\306\bM\213\016M\205\311u\236HDž0\377\377\377\000\000\000\000\017\037\200\000\000\000\000H\203\275p\377\377\377\000\017\204\230\003\000\000H\213\vH\205\311t\v\017\266A\005\203\340\003<\003toL\213\215x\377\377\377E1\366A\017\266\201\024\003\000\000\203\340\003<\002L\211\310\017\204=\b\000\000\213\220\314\003\000\000\205\322\017\204\240\004\000\000\213\025\363^!\000\367\302\004\b\000\000\017\205\235\004\000\000H\213\225p\377\377\377H\211\023H\215e\330[A\\A]A^A_]\303HDžP\377\377\377\005\025\000\000\351\230\376\377\377f\017\037D\000\000A\203\374\001\017\204,\004\000\000H\213\205\070\377\377\377"...<Address 0x7ffff7dfd000 out of bounds>, m_message = <error reading variable: Cannot access memory at address 0xffffffffffffffe8>, 
            m_responseHeaders = std::map with 6400104 elements<error reading variable: Cannot access memory at address 0x7fff00000019>, m_isRetryable = 232}, success = 184}

Python for this machine is unmodified system default, version 2.7.5.

imfranklin commented 7 years ago

In an attempt to rule out any unknown conflicts as well as lay out a fast and easily reproducible test (and in hopes that another distribution would magically solve everything), we set out to build only AWS example code - https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/cpp/example_code/s3/put_object.cpp - upon a fresh, new EC2 using ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20170414 (ami-80861296).

The results were still failures. Below is an annotated transcript - again, if we are missing any steps or if anything seems out of place please advise.

First, we got ourselves up-to-date, installed dependencies, and tested the awscli to rule out any networking issues:

sudo apt-get update
sudo apt-get install build-essential git cmake libcurl4-nss-dev libssl-dev zlib1g-dev pkgconf gdb awscli
AWS_ACCESS_KEY_ID='XXXXXXXXXXXXXXXXXXXX' AWS_SECRET_ACCESS_KEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' aws s3 cp ../FILENAME.JPG s3://BUCKET_NAME/KEY_PATH/FILENAME.JPG

The output was upload: ../FILENAME.JPG to s3://BUCKET_NAME/KEY_PATH/FILENAME.JPG and the file was confirmed to have made it to our bucket. Success! Next we moved onto the SDK and example:

wget https://github.com/aws/aws-sdk-cpp/archive/1.0.112.tar.gz
tar zxvf 1.0.112.tar.gz
cd aws-sdk-cpp-1.0.112/
mkdir BUILD
cd BUILD/
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_ONLY="core;s3" ..
make
sudo make install
cd ../..
wget https://raw.githubusercontent.com/awsdocs/aws-doc-sdk-examples/master/cpp/example_code/s3/put_object.cpp
g++ put_object.cpp -g --std=c++11 `pkg-config aws-cpp-sdk-s3 --cflags` -o put_object `pkg-config aws-cpp-sdk-s3 --libs`
AWS_ACCESS_KEY_ID='XXXXXXXXXXXXXXXXXXXX' AWS_SECRET_ACCESS_KEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ./put_object BUCKET_NAME KEY_PATH/FILENAME.JPG ../FILENAME.JPG

The output now, though, was sadly familiar:

Uploading ../FILENAME.JPG to S3 bucket BUCKET_NAME at key KEY_PATH/FILENAME.JPG
PutObject error:  Unable to connect to endpoint

And so, we fire up gdb:

AWS_ACCESS_KEY_ID='XXXXXXXXXXXXXXXXXXXX' AWS_SECRET_ACCESS_KEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' gdb ./put_object 
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./put_object...done.
(gdb) b 55
Breakpoint 1 at 0x405b3f: file put_object.cpp, line 55.
(gdb) r BUCKET_NAME KEY_PATH/FILENAME.JPG ../FILENAME.JPG
Starting program: /home/ubuntu/software/put_object BUCKET_NAME KEY_PATH/FILENAME.JPG ../FILENAME.JPG
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Uploading ../FILENAME.JPG to S3 bucket BUCKET_NAME at key KEY_PATH/FILENAME.JPG

Breakpoint 1, main (argc=4, argv=0x7fffffffe508) at put_object.cpp:55
55          auto put_object_outcome = s3_client.PutObject(object_request);
(gdb) bt full
#0  main (argc=4, argv=0x7fffffffe508) at put_object.cpp:55
        s3_client = {<Aws::Client::AWSXMLClient> = {<Aws::Client::AWSClient> = {_vptr.AWSClient = 0x7ffff7dbc4e8 <vtable for Aws::S3::S3Client+16>, m_httpClient = std::shared_ptr (count 1, weak 0) 0x646230, m_signer = std::shared_ptr (count 1, weak 0) 0x645c30, m_errorMarshaller = 
    std::shared_ptr (count 1, weak 0) 0x645490, m_retryStrategy = std::shared_ptr (count 1, weak 0) 0x645680, m_writeRateLimiter = std::shared_ptr (empty) 0x0, m_readRateLimiter = std::shared_ptr (empty) 0x0, m_userAgent = "aws-sdk-cpp/1.0.112 Linux/4.4.0-1013-aws x86_64", m_hash = 
    std::shared_ptr (count 1, weak 0) 0x645fd0, static s_refCount = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = 1}, <No data fields>}}, <No data fields>}, m_baseUri = "s3.amazonaws.com", m_scheme = "https", m_executor = std::shared_ptr (count 1, weak 0) 0x645470, 
          m_useVirtualAdressing = true}
        object_request = {<Aws::AmazonStreamingWebServiceRequest> = {<Aws::AmazonWebServiceRequest> = {_vptr.AmazonWebServiceRequest = 0x60c2e0 <vtable for Aws::S3::Model::PutObjectRequest+16>, 
              m_responseStreamFactory = {<std::_Maybe_unary_or_binary_function<std::basic_iostream<char, std::char_traits<char> >*>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff72c7b99
     <Aws::Utils::Stream::DefaultResponseStreamFactoryMethod()>, _M_const_object = 0x7ffff72c7b99 <Aws::Utils::Stream::DefaultResponseStreamFactoryMethod()>, _M_function_pointer = 0x7ffff72c7b99 <Aws::Utils::Stream::DefaultResponseStreamFactoryMethod()>, 
                      _M_member_pointer = &virtual table offset 140737340275608, this adjustment 47}, _M_pod_data = "\231{,\367\377\177\000\000/\000\000\000\000\000\000"}, _M_manager = 0x7ffff727fb67
     <std::_Function_base::_Base_manager<std::iostream* (*)()>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation)>}, _M_invoker = 0x7ffff727fb48 <std::_Function_handler<std::iostream* (), std::iostream* (*)()>::_M_invoke(std::_Any_data const&)>}, 
              m_onDataReceived = {<std::_Maybe_unary_or_binary_function<void, Aws::Http::HttpRequest const*, Aws::Http::HttpResponse*, long long>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7fffffffe038, 
                      _M_const_object = 0x7fffffffe038, _M_function_pointer = 0x7fffffffe038, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x7fffffffe038, this adjustment 9}, _M_pod_data = "8\340\377\377\377\177\000\000\t\000\000\000\000\000\000"}, 
                  _M_manager = 0x0}, _M_invoker = 0x7fffffff0031}, 
              m_onDataSent = {<std::_Maybe_unary_or_binary_function<void, Aws::Http::HttpRequest const*, long long>> = {<std::binary_function<Aws::Http::HttpRequest const*, long long, void>> = {<No data fields>}, <No data fields>}, <std::_Function_base> = {static _M_max_size = 16, 
                  static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x19ffffe100, _M_const_object = 0x19ffffe100, _M_function_pointer = 0x19ffffe100, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x19ffffe100, this adjustment 3000}, 
                    _M_pod_data = "\000\341\377\377\031\000\000\000\270\v\000\000\000\000\000"}, _M_manager = 0x0}, _M_invoker = 0x645680}, 
              m_continueRequest = {<std::_Maybe_unary_or_binary_function<bool, Aws::Http::HttpRequest const*>> = {<std::unary_function<Aws::Http::HttpRequest const*, bool>> = {<No data fields>}, <No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {
                    _M_unused = {_M_object = 0x645670, _M_const_object = 0x645670, _M_function_pointer = 0x645670, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x645670, this adjustment 140737488347264}, 
                    _M_pod_data = "pVd\000\000\000\000\000\200\340\377\377\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffe100}, 
              m_requestRetryHandler = {<std::_Maybe_unary_or_binary_function<void, Aws::AmazonWebServiceRequest const&>> = {<std::unary_function<Aws::AmazonWebServiceRequest const&, void>> = {<No data fields>}, <No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, 
                  _M_functor = {_M_unused = {_M_object = 0x7ffff7ffe4c0, _M_const_object = 0x7ffff7ffe4c0, _M_function_pointer = 0x7ffff7ffe4c0, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x7ffff7ffe4c0, this adjustment 140737488347296}, 
                    _M_pod_data = "\300\344\377\367\377\177\000\000\240\340\377\377\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x0}}, m_bodyStream = std::shared_ptr (count 2, weak 0) 0x646440, m_contentType = "binary/octet-stream"}, m_aCL = Aws::S3::Model::ObjectCannedACL::NOT_SET, 
          m_aCLHasBeenSet = false, m_bucket = "BUCKET_NAME", m_bucketHasBeenSet = true, m_cacheControl = "", m_cacheControlHasBeenSet = false, m_contentDisposition = "", m_contentDispositionHasBeenSet = false, m_contentEncoding = "", m_contentEncodingHasBeenSet = false, 
          m_contentLanguage = "", m_contentLanguageHasBeenSet = false, m_contentLength = 0, m_contentLengthHasBeenSet = false, m_contentMD5 = "", m_contentMD5HasBeenSet = false, m_expires = {m_time = {__d = {__r = 0}}, m_valid = true}, m_expiresHasBeenSet = false, m_grantFullControl = "", 
          m_grantFullControlHasBeenSet = false, m_grantRead = "", m_grantReadHasBeenSet = false, m_grantReadACP = "", m_grantReadACPHasBeenSet = false, m_grantWriteACP = "", m_grantWriteACPHasBeenSet = false, m_key = "KEY_PATH/FILENAME.JPG", m_keyHasBeenSet = true, m_metadata = std::map with 0 elements, 
          m_metadataHasBeenSet = false, m_serverSideEncryption = Aws::S3::Model::ServerSideEncryption::NOT_SET, m_serverSideEncryptionHasBeenSet = false, m_storageClass = Aws::S3::Model::StorageClass::NOT_SET, m_storageClassHasBeenSet = false, m_websiteRedirectLocation = "", 
          m_websiteRedirectLocationHasBeenSet = false, m_sSECustomerAlgorithm = "", m_sSECustomerAlgorithmHasBeenSet = false, m_sSECustomerKey = "", m_sSECustomerKeyHasBeenSet = false, m_sSECustomerKeyMD5 = "", m_sSECustomerKeyMD5HasBeenSet = false, m_sSEKMSKeyId = "", m_sSEKMSKeyIdHasBeenSet = false, 
          m_requestPayer = Aws::S3::Model::RequestPayer::NOT_SET, m_requestPayerHasBeenSet = false, m_tagging = "", m_taggingHasBeenSet = false}
        input_data = std::shared_ptr (count 2, weak 0) 0x646440
        put_object_outcome = {result = {m_expiration = "", m_eTag = <error reading variable: Cannot create a lazy string with address 0x0, and a non-zero length.>, m_serverSideEncryption = (unknown: -134291456), m_versionId = "", m_sSECustomerAlgorithm = "", m_sSECustomerKeyMD5 = "", m_sSEKMSKeyId = "", 
            m_requestCharged = (unknown: -134290192)}, error = {m_errorType = -157878097, m_exceptionName = <error reading variable: Cannot create a lazy string with address 0x0, and a non-zero length.>, m_message = "", 
            m_responseHeaders = std::map with 140737330454520 elements<error reading variable: Cannot access memory at address 0x14>, m_isRetryable = 56}, success = 240}
        options = {loggingOptions = {logLevel = Aws::Utils::Logging::LogLevel::Off, defaultLogPrefix = 0x40865d "aws_sdk_", logger_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr<Aws::Utils::Logging::LogSystemInterface> >> = {<No data fields>}, <std::_Function_base> = {
                static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x838, _M_const_object = 0x838, _M_function_pointer = 0x838, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x838, this adjustment 140737330454520}, 
                  _M_pod_data = "8\b\000\000\000\000\000\000\370\237\226\366\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffdf58}}, memoryManagementOptions = {memoryManager = 0x0}, httpOptions = {
            httpClientFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr<Aws::Http::HttpClientFactory> >> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff7de0e11 <do_lookup_x+369>, 
                    _M_const_object = 0x7ffff7de0e11 <do_lookup_x+369>, _M_function_pointer = 0x7ffff7de0e11 <do_lookup_x+369>, _M_member_pointer = &virtual table offset 140737351912976, this adjustment 140737334518472}, _M_pod_data = "\021\016\336\367\377\177\000\000Ȣ\324\366\377\177\000"}, 
                _M_manager = 0x0}, _M_invoker = 0x7ffff6d2ad80}, initAndCleanupCurl = true}, cryptoOptions = {md5Factory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr<Aws::Utils::Crypto::HashFactory> >> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, 
                static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x1c93965e, _M_const_object = 0x1c93965e, _M_function_pointer = 0x1c93965e, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x1c93965e, this adjustment 7491161}, 
                  _M_pod_data = "^\226\223\034\000\000\000\000YNr\000\000\000\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffe030}, sha256Factory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr<Aws::Utils::Crypto::HashFactory> >> = {<No data fields>}, <std::_Function_base> = {
                static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff6969ff8, _M_const_object = 0x7ffff6969ff8, _M_function_pointer = 0x7ffff6969ff8, 
                    _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x7ffff6969ff8, this adjustment 140737330400640}, _M_pod_data = "\370\237\226\366\377\177\000\000\200͕\366\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffe020}, 
            sha256HMACFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr<Aws::Utils::Crypto::HMACFactory> >> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff7fdea20, 
                    _M_const_object = 0x7ffff7fdea20, _M_function_pointer = 0x7ffff7fdea20, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x7ffff7fdea20, this adjustment 140733193388032}, _M_pod_data = " \352\375\367\377\177\000\000\000\000\000\000\377\177\000"}, 
                _M_manager = 0x0}, _M_invoker = 0x7fffffffdfb8}, aes_CBCFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr<Aws::Utils::Crypto::SymmetricCipherFactory> >> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {
                  _M_unused = {_M_object = 0x95fc16b8, _M_const_object = 0x95fc16b8, _M_function_pointer = 0x95fc16b8, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x95fc16b8}, _M_pod_data = "\270\026\374\225", '\000' <repeats 11 times>}, _M_manager = 0x0}, 
              _M_invoker = 0x7ffff7fee358}, aes_CTRFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr<Aws::Utils::Crypto::SymmetricCipherFactory> >> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {
                    _M_object = 0x7fffffffe0c0, _M_const_object = 0x7fffffffe0c0, _M_function_pointer = 0x7fffffffe0c0, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x7fffffffe0c0, this adjustment 140737353995584}, 
                  _M_pod_data = "\300\340\377\377\377\177\000\000@\325\375\367\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7ffff7de0c44 <check_match+324>}, 
            aes_GCMFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr<Aws::Utils::Crypto::SymmetricCipherFactory> >> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7fffffffe0e8, 
                    _M_const_object = 0x7fffffffe0e8, _M_function_pointer = 0x7fffffffe0e8, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x7fffffffe0e8, this adjustment 815}, _M_pod_data = "\350\340\377\377\377\177\000\000/\003\000\000\000\000\000"}, 
                _M_manager = 0x0}, _M_invoker = 0x7ffff695cd80}, aes_KeyWrapFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr<Aws::Utils::Crypto::SymmetricCipherFactory> >> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, 
                _M_functor = {_M_unused = {_M_object = 0x7ffff6969ff8, _M_const_object = 0x7ffff6969ff8, _M_function_pointer = 0x7ffff6969ff8, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x7ffff6969ff8, this adjustment 140737351914619}, 
                  _M_pod_data = "\370\237\226\366\377\177\000\000{\024\336\367\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7ffff6969ff8}, 
            secureRandomFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr<Aws::Utils::Crypto::SecureRandomFactory> >> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff7fee4f0, 
                    _M_const_object = 0x7ffff7fee4f0, _M_function_pointer = 0x7ffff7fee4f0, _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x7ffff7fee4f0, this adjustment 140737488347256}, _M_pod_data = "\360\344\376\367\377\177\000\000x\340\377\377\377\177\000"}, 
                _M_manager = 0x0}, _M_invoker = 0x7ffff7de0e11 <do_lookup_x+369>}, initAndCleanupOpenSSL = true}}
        bucket_name = "BUCKET_NAME"
        key_name = "KEY_PATH/FILENAME.JPG"
        file_name = "../FILENAME.JPG"
(gdb) c
Continuing.
[New Thread 0x7ffff030f700 (LWP 22926)]
[Thread 0x7ffff030f700 (LWP 22926) exited]
PutObject error:  Unable to connect to endpoint
[Inferior 1 (process 22921) exited normally]
(gdb) q

We note that the <error reading variable: Cannot create a lazy string with address 0x0, and a non-zero length.> bits look out of place, but have no clues as to their cause nor solution. Also worth noting is the same steps above on our development macOS machine still work as expected.

Any ideas?

yasushi-saito commented 7 years ago

Don't you have to set the region when constructing the s3_client?

Aws::Client::ClientConfiguration config; config.region = "us-west-1"; // for example Aws::S3::S3Client s3_client(config);

On Tue, May 2, 2017 at 1:16 PM, imfranklin notifications@github.com wrote:

In an attempt to rule out any unknown conflicts as well as lay out a fast and easily reproducible test (and in hopes that another distribution would magically solve everything), we set out to build only AWS example code - https://github.com/awsdocs/aws-doc-sdk-examples/blob/ master/cpp/example_code/s3/put_object.cpp - upon a fresh, new EC2 using ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20170414 (ami-80861296).

The results were still failures. Below is an annotated transcript - again, if we are missing any steps or if anything seems out of place please advise.

First, we got ourselves up-to-date, installed dependencies, and tested the awscli to rule out any networking issues:

sudo apt-get update sudo apt-get install build-essential git cmake libcurl4-nss-dev libssl-dev zlib1g-dev pkgconf gdb awscli AWS_ACCESS_KEY_ID='XXXXXXXXXXXXXXXXXXXX' AWS_SECRET_ACCESS_KEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' aws s3 cp ../FILENAME.JPG s3://BUCKET_NAME/KEY_PATH/FILENAME.JPG

The output was upload: ../FILENAME.JPG to s3://BUCKET_NAME/KEY_PATH/ FILENAME.JPG and the file was confirmed to have made it to our bucket. Success! Next we moved onto the SDK and example:

wget https://github.com/aws/aws-sdk-cpp/archive/1.0.112.tar.gz tar zxvf 1.0.112.tar.gzcd aws-sdk-cpp-1.0.112/ mkdir BUILDcd BUILD/ cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_ONLY="core;s3" .. make sudo make installcd ../.. wget https://raw.githubusercontent.com/awsdocs/aws-doc-sdk-examples/master/cpp/example_code/s3/put_object.cpp g++ put_object.cpp -g --std=c++11 pkg-config aws-cpp-sdk-s3 --cflags -o put_object pkg-config aws-cpp-sdk-s3 --libs AWS_ACCESS_KEY_ID='XXXXXXXXXXXXXXXXXXXX' AWS_SECRET_ACCESS_KEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ./put_object BUCKET_NAME KEY_PATH/FILENAME.JPG ../FILENAME.JPG

The output now, though, was sadly familiar:

Uploading ../FILENAME.JPG to S3 bucket BUCKET_NAME at key KEY_PATH/FILENAME.JPG PutObject error: Unable to connect to endpoint

And so, we fire up gdb:

AWS_ACCESS_KEY_ID='XXXXXXXXXXXXXXXXXXXX' AWS_SECRET_ACCESS_KEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' gdb ./put_object GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./put_object...done. (gdb) b 55 Breakpoint 1 at 0x405b3f: file put_object.cpp, line 55. (gdb) r BUCKET_NAME KEY_PATH/FILENAME.JPG ../FILENAME.JPG Starting program: /home/ubuntu/software/put_object BUCKET_NAME KEY_PATH/FILENAME.JPG ../FILENAME.JPG [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Uploading ../FILENAME.JPG to S3 bucket BUCKET_NAME at key KEY_PATH/FILENAME.JPG

Breakpoint 1, main (argc=4, argv=0x7fffffffe508) at put_object.cpp:5555 auto put_object_outcome = s3_client.PutObject(object_request); (gdb) bt full#0 main (argc=4, argv=0x7fffffffe508) at put_object.cpp:55 s3_client = { = { = {_vptr.AWSClient = 0x7ffff7dbc4e8 <vtable for Aws::S3::S3Client+16>, m_httpClient = std::shared_ptr (count 1, weak 0) 0x646230, m_signer = std::shared_ptr (count 1, weak 0) 0x645c30, m_errorMarshaller = std::shared_ptr (count 1, weak 0) 0x645490, m_retryStrategy = std::shared_ptr (count 1, weak 0) 0x645680, m_writeRateLimiter = std::shared_ptr (empty) 0x0, m_readRateLimiter = std::shared_ptr (empty) 0x0, m_userAgent = "aws-sdk-cpp/1.0.112 Linux/4.4.0-1013-aws x86_64", m_hash = std::shared_ptr (count 1, weak 0) 0x645fd0, static s_refCount = {<std::atomic_base> = {static _S_alignment = 4, _M_i = 1}, }}, }, m_baseUri = "s3.amazonaws.com", m_scheme = "https", m_executor = std::shared_ptr (count 1, weak 0) 0x645470, m_useVirtualAdressing = true} object_request = { = { = {_vptr.AmazonWebServiceRequest = 0x60c2e0 <vtable for Aws::S3::Model::PutObjectRequest+16>, m_responseStreamFactory = {<std::_Maybe_unary_or_binary_function<std::basic_iostream<char, std::char_traits >>> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff72c7b99 <Aws::Utils::Stream::DefaultResponseStreamFactoryMethod()>, _M_const_object = 0x7ffff72c7b99 <Aws::Utils::Stream::DefaultResponseStreamFactoryMethod()>, _M_function_pointer = 0x7ffff72c7b99 <Aws::Utils::Stream::DefaultResponseStreamFactoryMethod()>, _M_member_pointer = &virtual table offset 140737340275608, this adjustment 47}, _M_pod_data = "\231{,\367\377\177\000\000/\000\000\000\000\000\000"}, _M_manager = 0x7ffff727fb67 <std::_Function_base::_Base_manager<std::iostream ()()>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation)>}, _M_invoker = 0x7ffff727fb48 <std::_Function_handler<std::iostream (), std::iostream ()()>::_M_invoke(std::_Any_data const&)>}, m_onDataReceived = {<std::_Maybe_unary_or_binary_function<void, Aws::Http::HttpRequest const, Aws::Http::HttpResponse, long long>> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7fffffffe038, _M_const_object = 0x7fffffffe038, _M_function_pointer = 0x7fffffffe038, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x7fffffffe038, this adjustment 9}, _M_pod_data = "8\340\377\377\377\177\000\000\t\000\000\000\000\000\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffff0031}, m_onDataSent = {<std::_Maybe_unary_or_binary_function<void, Aws::Http::HttpRequest const, long long>> = {<std::binary_function<Aws::Http::HttpRequest const, long long, void>> = {}, }, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x19ffffe100, _M_const_object = 0x19ffffe100, _M_function_pointer = 0x19ffffe100, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x19ffffe100, this adjustment 3000}, _M_pod_data = "\000\341\377\377\031\000\000\000\270\v\000\000\000\000\000"}, _M_manager = 0x0}, _M_invoker = 0x645680}, m_continueRequest = {<std::_Maybe_unary_or_binary_function<bool, Aws::Http::HttpRequest const>> = {<std::unary_function<Aws::Http::HttpRequest const, bool>> = {}, }, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = { _M_unused = {_M_object = 0x645670, _M_const_object = 0x645670, _M_function_pointer = 0x645670, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x645670, this adjustment 140737488347264}, _M_pod_data = "pVd\000\000\000\000\000\200\340\377\377\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffe100}, m_requestRetryHandler = {<std::_Maybe_unary_or_binary_function<void, Aws::AmazonWebServiceRequest const&>> = {<std::unary_function<Aws::AmazonWebServiceRequest const&, void>> = {}, }, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff7ffe4c0, _M_const_object = 0x7ffff7ffe4c0, _M_function_pointer = 0x7ffff7ffe4c0, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x7ffff7ffe4c0, this adjustment 140737488347296}, _M_pod_data = "\300\344\377\367\377\177\000\000\240\340\377\377\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x0}}, m_bodyStream = std::shared_ptr (count 2, weak 0) 0x646440, m_contentType = "binary/octet-stream"}, m_aCL = Aws::S3::Model::ObjectCannedACL::NOT_SET, m_aCLHasBeenSet = false, m_bucket = "BUCKET_NAME", m_bucketHasBeenSet = true, m_cacheControl = "", m_cacheControlHasBeenSet = false, m_contentDisposition = "", m_contentDispositionHasBeenSet = false, m_contentEncoding = "", m_contentEncodingHasBeenSet = false, m_contentLanguage = "", m_contentLanguageHasBeenSet = false, m_contentLength = 0, m_contentLengthHasBeenSet = false, m_contentMD5 = "", m_contentMD5HasBeenSet = false, m_expires = {m_time = {d = {__r = 0}}, m_valid = true}, m_expiresHasBeenSet = false, m_grantFullControl = "", m_grantFullControlHasBeenSet = false, m_grantRead = "", m_grantReadHasBeenSet = false, m_grantReadACP = "", m_grantReadACPHasBeenSet = false, m_grantWriteACP = "", m_grantWriteACPHasBeenSet = false, m_key = "KEY_PATH/FILENAME.JPG", m_keyHasBeenSet = true, m_metadata = std::map with 0 elements, m_metadataHasBeenSet = false, m_serverSideEncryption = Aws::S3::Model::ServerSideEncryption::NOT_SET, m_serverSideEncryptionHasBeenSet = false, m_storageClass = Aws::S3::Model::StorageClass::NOT_SET, m_storageClassHasBeenSet = false, m_websiteRedirectLocation = "", m_websiteRedirectLocationHasBeenSet = false, m_sSECustomerAlgorithm = "", m_sSECustomerAlgorithmHasBeenSet = false, m_sSECustomerKey = "", m_sSECustomerKeyHasBeenSet = false, m_sSECustomerKeyMD5 = "", m_sSECustomerKeyMD5HasBeenSet = false, m_sSEKMSKeyId = "", m_sSEKMSKeyIdHasBeenSet = false, m_requestPayer = Aws::S3::Model::RequestPayer::NOT_SET, m_requestPayerHasBeenSet = false, m_tagging = "", m_taggingHasBeenSet = false} input_data = std::shared_ptr (count 2, weak 0) 0x646440 put_object_outcome = {result = {m_expiration = "", m_eTag = <error reading variable: Cannot create a lazy string with address 0x0, and a non-zero length.>, m_serverSideEncryption = (unknown: -134291456), m_versionId = "", m_sSECustomerAlgorithm = "", m_sSECustomerKeyMD5 = "", m_sSEKMSKeyId = "", m_requestCharged = (unknown: -134290192)}, error = {m_errorType = -157878097, m_exceptionName = <error reading variable: Cannot create a lazy string with address 0x0, and a non-zero length.>, m_message = "", m_responseHeaders = std::map with 140737330454520 elements<error reading variable: Cannot access memory at address 0x14>, m_isRetryable = 56}, success = 240} options = {loggingOptions = {logLevel = Aws::Utils::Logging::LogLevel::Off, defaultLogPrefix = 0x40865d "awssdk", logger_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = { static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x838, _M_const_object = 0x838, _M_function_pointer = 0x838, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x838, this adjustment 140737330454520}, _M_pod_data = "8\b\000\000\000\000\000\000\370\237\226\366\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffdf58}}, memoryManagementOptions = {memoryManager = 0x0}, httpOptions = { httpClientFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff7de0e11 <do_lookup_x+369>, _M_const_object = 0x7ffff7de0e11 <do_lookup_x+369>, _M_function_pointer = 0x7ffff7de0e11 <do_lookup_x+369>, _M_member_pointer = &virtual table offset 140737351912976, this adjustment 140737334518472}, _M_pod_data = "\021\016\336\367\377\177\000\000Ȣ\324\366\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7ffff6d2ad80}, initAndCleanupCurl = true}, cryptoOptions = {md5Factory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x1c93965e, _M_const_object = 0x1c93965e, _M_function_pointer = 0x1c93965e, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x1c93965e, this adjustment 7491161}, _M_pod_data = "^\226\223\034\000\000\000\000YNr\000\000\000\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffe030}, sha256Factory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = { static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff6969ff8, _M_const_object = 0x7ffff6969ff8, _M_function_pointer = 0x7ffff6969ff8, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x7ffff6969ff8, this adjustment 140737330400640}, _M_pod_data = "\370\237\226\366\377\177\000\000\200͕\366\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffe020}, sha256HMACFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff7fdea20, _M_const_object = 0x7ffff7fdea20, _M_function_pointer = 0x7ffff7fdea20, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x7ffff7fdea20, this adjustment 140733193388032}, _M_pod_data = " \352\375\367\377\177\000\000\000\000\000\000\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffdfb8}, aes_CBCFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = { _M_unused = {_M_object = 0x95fc16b8, _M_const_object = 0x95fc16b8, _M_function_pointer = 0x95fc16b8, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x95fc16b8}, _M_pod_data = "\270\026\374\225", '\000' <repeats 11 times>}, _M_manager = 0x0}, _M_invoker = 0x7ffff7fee358}, aes_CTRFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = { _M_object = 0x7fffffffe0c0, _M_const_object = 0x7fffffffe0c0, _M_function_pointer = 0x7fffffffe0c0, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x7fffffffe0c0, this adjustment 140737353995584}, _M_pod_data = "\300\340\377\377\377\177\000\000@\325\375\367\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7ffff7de0c44 <check_match+324>}, aes_GCMFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7fffffffe0e8, _M_const_object = 0x7fffffffe0e8, _M_function_pointer = 0x7fffffffe0e8, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x7fffffffe0e8, this adjustment 815}, _M_pod_data = "\350\340\377\377\377\177\000\000/\003\000\000\000\000\000"}, _M_manager = 0x0}, _M_invoker = 0x7ffff695cd80}, aes_KeyWrapFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff6969ff8, _M_const_object = 0x7ffff6969ff8, _M_function_pointer = 0x7ffff6969ff8, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x7ffff6969ff8, this adjustment 140737351914619}, _M_pod_data = "\370\237\226\366\377\177\000\000{\024\336\367\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7ffff6969ff8}, secureRandomFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff7fee4f0, _M_const_object = 0x7ffff7fee4f0, _M_function_pointer = 0x7ffff7fee4f0, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x7ffff7fee4f0, this adjustment 140737488347256}, _M_pod_data = "\360\344\376\367\377\177\000\000x\340\377\377\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7ffff7de0e11 <do_lookup_x+369>}, initAndCleanupOpenSSL = true}} bucket_name = "BUCKET_NAME" key_name = "KEY_PATH/FILENAME.JPG" file_name = "../FILENAME.JPG" (gdb) c Continuing. [New Thread 0x7ffff030f700 (LWP 22926)] [Thread 0x7ffff030f700 (LWP 22926) exited] PutObject error: Unable to connect to endpoint [Inferior 1 (process 22921) exited normally] (gdb) q

We note that the <error reading variable: Cannot create a lazy string with address 0x0, and a non-zero length.> bits look out of place, but have no clues as to their cause nor solution. Also worth noting is the same steps above on our development macOS machine still work as expected.

Any ideas?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aws/aws-sdk-cpp/issues/513#issuecomment-298748214, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhVs-LVleQykL7mAfjZmlJ80EXHn7KUks5r148KgaJpZM4NL-1x .

-- Yasushi Saito

yasushi-saito commented 7 years ago

.. and the credentials, if needed. I suspect you don't have default credentials set on your machine, but you do on macos.

On Tue, May 2, 2017 at 2:41 PM, Yasushi Saito yasushi.saito@gmail.com wrote:

Don't you have to set the region when constructing the s3_client?

Aws::Client::ClientConfiguration config; config.region = "us-west-1"; // for example Aws::S3::S3Client s3_client(config);

On Tue, May 2, 2017 at 1:16 PM, imfranklin notifications@github.com wrote:

In an attempt to rule out any unknown conflicts as well as lay out a fast and easily reproducible test (and in hopes that another distribution would magically solve everything), we set out to build only AWS example code - https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/ cpp/example_code/s3/put_object.cpp - upon a fresh, new EC2 using ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20170414 (ami-80861296).

The results were still failures. Below is an annotated transcript - again, if we are missing any steps or if anything seems out of place please advise.

First, we got ourselves up-to-date, installed dependencies, and tested the awscli to rule out any networking issues:

sudo apt-get update sudo apt-get install build-essential git cmake libcurl4-nss-dev libssl-dev zlib1g-dev pkgconf gdb awscli AWS_ACCESS_KEY_ID='XXXXXXXXXXXXXXXXXXXX' AWS_SECRET_ACCESS_KEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' aws s3 cp ../FILENAME.JPG s3://BUCKET_NAME/KEY_PATH/FILENAME.JPG

The output was upload: ../FILENAME.JPG to s3://BUCKET_NAME/KEY_PATH/FILE NAME.JPG and the file was confirmed to have made it to our bucket. Success! Next we moved onto the SDK and example:

wget https://github.com/aws/aws-sdk-cpp/archive/1.0.112.tar.gz tar zxvf 1.0.112.tar.gzcd aws-sdk-cpp-1.0.112/ mkdir BUILDcd BUILD/ cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_ONLY="core;s3" .. make sudo make installcd ../.. wget https://raw.githubusercontent.com/awsdocs/aws-doc-sdk-examples/master/cpp/example_code/s3/put_object.cpp g++ put_object.cpp -g --std=c++11 pkg-config aws-cpp-sdk-s3 --cflags -o put_object pkg-config aws-cpp-sdk-s3 --libs AWS_ACCESS_KEY_ID='XXXXXXXXXXXXXXXXXXXX' AWS_SECRET_ACCESS_KEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ./put_object BUCKET_NAME KEY_PATH/FILENAME.JPG ../FILENAME.JPG

The output now, though, was sadly familiar:

Uploading ../FILENAME.JPG to S3 bucket BUCKET_NAME at key KEY_PATH/FILENAME.JPG PutObject error: Unable to connect to endpoint

And so, we fire up gdb:

AWS_ACCESS_KEY_ID='XXXXXXXXXXXXXXXXXXXX' AWS_SECRET_ACCESS_KEY='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' gdb ./put_object GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./put_object...done. (gdb) b 55 Breakpoint 1 at 0x405b3f: file put_object.cpp, line 55. (gdb) r BUCKET_NAME KEY_PATH/FILENAME.JPG ../FILENAME.JPG Starting program: /home/ubuntu/software/put_object BUCKET_NAME KEY_PATH/FILENAME.JPG ../FILENAME.JPG [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Uploading ../FILENAME.JPG to S3 bucket BUCKET_NAME at key KEY_PATH/FILENAME.JPG

Breakpoint 1, main (argc=4, argv=0x7fffffffe508) at put_object.cpp:5555 auto put_object_outcome = s3_client.PutObject(object_request); (gdb) bt full#0 main (argc=4, argv=0x7fffffffe508) at put_object.cpp:55 s3_client = { = { = {_vptr.AWSClient = 0x7ffff7dbc4e8 <vtable for Aws::S3::S3Client+16>, m_httpClient = std::shared_ptr (count 1, weak 0) 0x646230, m_signer = std::shared_ptr (count 1, weak 0) 0x645c30, m_errorMarshaller = std::shared_ptr (count 1, weak 0) 0x645490, m_retryStrategy = std::shared_ptr (count 1, weak 0) 0x645680, m_writeRateLimiter = std::shared_ptr (empty) 0x0, m_readRateLimiter = std::shared_ptr (empty) 0x0, m_userAgent = "aws-sdk-cpp/1.0.112 Linux/4.4.0-1013-aws x86_64", m_hash = std::shared_ptr (count 1, weak 0) 0x645fd0, static s_refCount = {<std::atomic_base> = {static _S_alignment = 4, _M_i = 1}, }}, }, m_baseUri = "s3.amazonaws.com", m_scheme = "https", m_executor = std::shared_ptr (count 1, weak 0) 0x645470, m_useVirtualAdressing = true} object_request = { = { = {_vptr.AmazonWebServiceRequest = 0x60c2e0 <vtable for Aws::S3::Model::PutObjectRequest+16>, m_responseStreamFactory = {<std::_Maybe_unary_or_binary_function<std::basic_iostream<char, std::char_traits >>> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff72c7b99 <Aws::Utils::Stream::DefaultResponseStreamFactoryMethod()>, _M_const_object = 0x7ffff72c7b99 <Aws::Utils::Stream::DefaultResponseStreamFactoryMethod()>, _M_function_pointer = 0x7ffff72c7b99 <Aws::Utils::Stream::DefaultResponseStreamFactoryMethod()>, _M_member_pointer = &virtual table offset 140737340275608, this adjustment 47}, _M_pod_data = "\231{,\367\377\177\000\000/\000\000\000\000\000\000"}, _M_manager = 0x7ffff727fb67 <std::_Function_base::_Base_manager<std::iostream ()()>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation)>}, _M_invoker = 0x7ffff727fb48 <std::_Function_handler<std::iostream (), std::iostream ()()>::_M_invoke(std::_Any_data const&)>}, m_onDataReceived = {<std::_Maybe_unary_or_binary_function<void, Aws::Http::HttpRequest const, Aws::Http::HttpResponse, long long>> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7fffffffe038, _M_const_object = 0x7fffffffe038, _M_function_pointer = 0x7fffffffe038, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x7fffffffe038, this adjustment 9}, _M_pod_data = "8\340\377\377\377\177\000\000\t\000\000\000\000\000\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffff0031}, m_onDataSent = {<std::_Maybe_unary_or_binary_function<void, Aws::Http::HttpRequest const, long long>> = {<std::binary_function<Aws::Http::HttpRequest const, long long, void>> = {}, }, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x19ffffe100, _M_const_object = 0x19ffffe100, _M_function_pointer = 0x19ffffe100, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x19ffffe100, this adjustment 3000}, _M_pod_data = "\000\341\377\377\031\000\000\000\270\v\000\000\000\000\000"}, _M_manager = 0x0}, _M_invoker = 0x645680}, m_continueRequest = {<std::_Maybe_unary_or_binary_function<bool, Aws::Http::HttpRequest const>> = {<std::unary_function<Aws::Http::HttpRequest const, bool>> = {}, }, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = { _M_unused = {_M_object = 0x645670, _M_const_object = 0x645670, _M_function_pointer = 0x645670, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x645670, this adjustment 140737488347264}, _M_pod_data = "pVd\000\000\000\000\000\200\340\377\377\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffe100}, m_requestRetryHandler = {<std::_Maybe_unary_or_binary_function<void, Aws::AmazonWebServiceRequest const&>> = {<std::unary_function<Aws::AmazonWebServiceRequest const&, void>> = {}, }, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff7ffe4c0, _M_const_object = 0x7ffff7ffe4c0, _M_function_pointer = 0x7ffff7ffe4c0, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x7ffff7ffe4c0, this adjustment 140737488347296}, _M_pod_data = "\300\344\377\367\377\177\000\000\240\340\377\377\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x0}}, m_bodyStream = std::shared_ptr (count 2, weak 0) 0x646440, m_contentType = "binary/octet-stream"}, m_aCL = Aws::S3::Model::ObjectCannedACL::NOT_SET, m_aCLHasBeenSet = false, m_bucket = "BUCKET_NAME", m_bucketHasBeenSet = true, m_cacheControl = "", m_cacheControlHasBeenSet = false, m_contentDisposition = "", m_contentDispositionHasBeenSet = false, m_contentEncoding = "", m_contentEncodingHasBeenSet = false, m_contentLanguage = "", m_contentLanguageHasBeenSet = false, m_contentLength = 0, m_contentLengthHasBeenSet = false, m_contentMD5 = "", m_contentMD5HasBeenSet = false, m_expires = {m_time = {d = {__r = 0}}, m_valid = true}, m_expiresHasBeenSet = false, m_grantFullControl = "", m_grantFullControlHasBeenSet = false, m_grantRead = "", m_grantReadHasBeenSet = false, m_grantReadACP = "", m_grantReadACPHasBeenSet = false, m_grantWriteACP = "", m_grantWriteACPHasBeenSet = false, m_key = "KEY_PATH/FILENAME.JPG", m_keyHasBeenSet = true, m_metadata = std::map with 0 elements, m_metadataHasBeenSet = false, m_serverSideEncryption = Aws::S3::Model::ServerSideEncryption::NOT_SET, m_serverSideEncryptionHasBeenSet = false, m_storageClass = Aws::S3::Model::StorageClass::NOT_SET, m_storageClassHasBeenSet = false, m_websiteRedirectLocation = "", m_websiteRedirectLocationHasBeenSet = false, m_sSECustomerAlgorithm = "", m_sSECustomerAlgorithmHasBeenSet = false, m_sSECustomerKey = "", m_sSECustomerKeyHasBeenSet = false, m_sSECustomerKeyMD5 = "", m_sSECustomerKeyMD5HasBeenSet = false, m_sSEKMSKeyId = "", m_sSEKMSKeyIdHasBeenSet = false, m_requestPayer = Aws::S3::Model::RequestPayer::NOT_SET, m_requestPayerHasBeenSet = false, m_tagging = "", m_taggingHasBeenSet = false} input_data = std::shared_ptr (count 2, weak 0) 0x646440 put_object_outcome = {result = {m_expiration = "", m_eTag = <error reading variable: Cannot create a lazy string with address 0x0, and a non-zero length.>, m_serverSideEncryption = (unknown: -134291456), m_versionId = "", m_sSECustomerAlgorithm = "", m_sSECustomerKeyMD5 = "", m_sSEKMSKeyId = "", m_requestCharged = (unknown: -134290192)}, error = {m_errorType = -157878097, m_exceptionName = <error reading variable: Cannot create a lazy string with address 0x0, and a non-zero length.>, m_message = "", m_responseHeaders = std::map with 140737330454520 elements<error reading variable: Cannot access memory at address 0x14>, m_isRetryable = 56}, success = 240} options = {loggingOptions = {logLevel = Aws::Utils::Logging::LogLevel::Off, defaultLogPrefix = 0x40865d "awssdk", logger_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = { static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x838, _M_const_object = 0x838, _M_function_pointer = 0x838, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x838, this adjustment 140737330454520}, _M_pod_data = "8\b\000\000\000\000\000\000\370\237\226\366\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffdf58}}, memoryManagementOptions = {memoryManager = 0x0}, httpOptions = { httpClientFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff7de0e11 <do_lookup_x+369>, _M_const_object = 0x7ffff7de0e11 <do_lookup_x+369>, _M_function_pointer = 0x7ffff7de0e11 <do_lookup_x+369>, _M_member_pointer = &virtual table offset 140737351912976, this adjustment 140737334518472}, _M_pod_data = "\021\016\336\367\377\177\000\000Ȣ\324\366\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7ffff6d2ad80}, initAndCleanupCurl = true}, cryptoOptions = {md5Factory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x1c93965e, _M_const_object = 0x1c93965e, _M_function_pointer = 0x1c93965e, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x1c93965e, this adjustment 7491161}, _M_pod_data = "^\226\223\034\000\000\000\000YNr\000\000\000\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffe030}, sha256Factory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = { static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff6969ff8, _M_const_object = 0x7ffff6969ff8, _M_function_pointer = 0x7ffff6969ff8, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x7ffff6969ff8, this adjustment 140737330400640}, _M_pod_data = "\370\237\226\366\377\177\000\000\200͕\366\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffe020}, sha256HMACFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff7fdea20, _M_const_object = 0x7ffff7fdea20, _M_function_pointer = 0x7ffff7fdea20, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x7ffff7fdea20, this adjustment 140733193388032}, _M_pod_data = " \352\375\367\377\177\000\000\000\000\000\000\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7fffffffdfb8}, aes_CBCFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = { _M_unused = {_M_object = 0x95fc16b8, _M_const_object = 0x95fc16b8, _M_function_pointer = 0x95fc16b8, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x95fc16b8}, _M_pod_data = "\270\026\374\225", '\000' <repeats 11 times>}, _M_manager = 0x0}, _M_invoker = 0x7ffff7fee358}, aes_CTRFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = { _M_object = 0x7fffffffe0c0, _M_const_object = 0x7fffffffe0c0, _M_function_pointer = 0x7fffffffe0c0, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x7fffffffe0c0, this adjustment 140737353995584}, _M_pod_data = "\300\340\377\377\377\177\000\000@\325\375\367\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7ffff7de0c44 <check_match+324>}, aes_GCMFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7fffffffe0e8, _M_const_object = 0x7fffffffe0e8, _M_function_pointer = 0x7fffffffe0e8, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x7fffffffe0e8, this adjustment 815}, _M_pod_data = "\350\340\377\377\377\177\000\000/\003\000\000\000\000\000"}, _M_manager = 0x0}, _M_invoker = 0x7ffff695cd80}, aes_KeyWrapFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff6969ff8, _M_const_object = 0x7ffff6969ff8, _M_function_pointer = 0x7ffff6969ff8, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x7ffff6969ff8, this adjustment 140737351914619}, _M_pod_data = "\370\237\226\366\377\177\000\000{\024\336\367\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7ffff6969ff8}, secureRandomFactory_create_fn = {<std::_Maybe_unary_or_binary_function<std::shared_ptr >> = {}, = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {_M_object = 0x7ffff7fee4f0, _M_const_object = 0x7ffff7fee4f0, _M_function_pointer = 0x7ffff7fee4f0, _M_member_pointer = (void (std::_Undefined_class::)(std::_Undefined_class const)) 0x7ffff7fee4f0, this adjustment 140737488347256}, _M_pod_data = "\360\344\376\367\377\177\000\000x\340\377\377\377\177\000"}, _M_manager = 0x0}, _M_invoker = 0x7ffff7de0e11 <do_lookup_x+369>}, initAndCleanupOpenSSL = true}} bucket_name = "BUCKET_NAME" key_name = "KEY_PATH/FILENAME.JPG" file_name = "../FILENAME.JPG" (gdb) c Continuing. [New Thread 0x7ffff030f700 (LWP 22926)] [Thread 0x7ffff030f700 (LWP 22926) exited] PutObject error: Unable to connect to endpoint [Inferior 1 (process 22921) exited normally] (gdb) q

We note that the <error reading variable: Cannot create a lazy string with address 0x0, and a non-zero length.> bits look out of place, but have no clues as to their cause nor solution. Also worth noting is the same steps above on our development macOS machine still work as expected.

Any ideas?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aws/aws-sdk-cpp/issues/513#issuecomment-298748214, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhVs-LVleQykL7mAfjZmlJ80EXHn7KUks5r148KgaJpZM4NL-1x .

-- Yasushi Saito

-- Yasushi Saito

imfranklin commented 7 years ago

Your response is appreciated, @yasushi-saito, but the bucket in testing is in the default region "us-east-1". Both the simple AWS example code and my full application function on my development machine whether such is specified or not. On any EC2 nothing works, regions or no regions.

And, my development environment does not have default credentials set. I do receive authentication errors when running anything without the ENV variables, but when run as shown "it just works".

imfranklin commented 7 years ago

We've tried more distributions, building the complete SDK, and exhausted more avenues such as trying other VPCs and other AWS accounts. Still the same, nothing but failure. On every EC2 the aws-cpp-sdk-s3-integration-tests yields 0 passing (but of course it's fine on my local development machine).

[==========] 8 tests from 1 test case ran. (463477 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 8 tests, listed below:
[  FAILED  ] BucketAndObjectOperationTest.TestInterrupt
[  FAILED  ] BucketAndObjectOperationTest.TestBucketCreationAndListing
[  FAILED  ] BucketAndObjectOperationTest.TestBucketLocation
[  FAILED  ] BucketAndObjectOperationTest.TestObjectOperations
[  FAILED  ] BucketAndObjectOperationTest.TestKeysWithCrazyCharacterSets
[  FAILED  ] BucketAndObjectOperationTest.TestObjectOperationsWithPresignedUrls
[  FAILED  ] BucketAndObjectOperationTest.TestMultiPartObjectOperations
[  FAILED  ] BucketAndObjectOperationTest.TestThatErrorsParse

What could we be overlooking? Why can we get tests to pass everywhere except Amazon's own servers?

JonathanHenson commented 7 years ago

can you upload a trace level log?

imfranklin commented 7 years ago

Gladly, but I'm not familiar with gtests nor the SDK logging. Any pointers as to where/how logging could be added to either the integration tests or the example code would be greatly appreciated.

JonathanHenson commented 7 years ago

Check SDKOptions for your InitAPI() call. Just set the logging level to Trace and that will do the trick.

JonathanHenson commented 7 years ago

I will say this. We run these tests from public Ec2 instances, so there is nothing inherently preventing this from running on Ec2.

imfranklin commented 7 years ago

@JonathanHenson We, of course, assumed this was heavily tested upon EC2. Our experience so far, though, is zero for three when it comes to Linux distributions on EC2, from more than one VPC and AWS account.

Any info you could share on these tests? Which distributions? Exactly how was the SDK built and installed?

imfranklin commented 7 years ago

Attached is a Trace-level log from CentOS 7. We noted Curl returned error code 51: aws-sdk-cpp-centos-trace.txt Will track down output from other distributions known to have failed us.

JonathanHenson commented 7 years ago

Ok, so can you turn ssl verification off in your ClientConfiguration, and rerun your code, just to verify that's what's wrong.

If that succeeds you have a few options. Either a.) update the certs on the box that curl is using (in the location curl looks for them for your distribution), or b.) put the certs on the box anywhere and pass the ca_path or ca_file options to the clientConfiguration.

imfranklin commented 7 years ago

I would upload the Trace log from the same test on ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20170414 (ami-80861296) but it is nearly verbatim. The difference is Ubuntu went with Curl returned error code 77.

What is the process for updating these certificates? Happen to have a link to details?

And will being up-to-date on said certificates be a requirement? That would be a deal-breaking kinda of thing for a production application.

JonathanHenson commented 7 years ago

out of curiosity, what happens if you turn virtual style addressing off?

It's a constructor argument for S3Client.

Sent from my iPhone

On May 3, 2017, at 5:40 PM, imfranklin notifications@github.com wrote:

I would upload the Trace log from the same test on ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20170414 (ami-80861296) but it is nearly verbatim. The difference is Ubuntu went with Curl returned error code 77.

What is the process for updating these certificates? Happen to have a link to details?

And will being up-to-date on said certificates be a requirement? That would be a deal-breaking kinda of thing for a production application.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

JonathanHenson commented 7 years ago

ah!

Your bucket name has an underscore in it. I suspect it isn't working because with virtual style addressing the bucket name is part of the dns lookup. _ is not universally allowed for dns. Hopefully moving to path style addressing should fix the issue.

Sent from my iPhone

On May 3, 2017, at 5:40 PM, imfranklin notifications@github.com wrote:

I would upload the Trace log from the same test on ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20170414 (ami-80861296) but it is nearly verbatim. The difference is Ubuntu went with Curl returned error code 77.

What is the process for updating these certificates? Happen to have a link to details?

And will being up-to-date on said certificates be a requirement? That would be a deal-breaking kinda of thing for a production application.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

imfranklin commented 7 years ago

We only see, credentials, config, and signPayloads constructor args in the docs: http://sdk.amazonaws.com/cpp/api/LATEST/class_aws_1_1_s3_1_1_s3_client.html

Are you referring to something in the ClientConfiguration? Not sure which, if so.

JonathanHenson commented 7 years ago

Sorry, looks like my docs pipeline hasn't deployed with the latest change. I literally made this change on last Wednesday to use virtual bucket addressing.

https://github.com/aws/aws-sdk-cpp/blob/master/aws-cpp-sdk-s3/include/aws/s3/S3Client.h#L409

imfranklin commented 7 years ago

Looks like that worked!

Worth noting: regardless of bucket name characters (we've tested periods, underscores, or none at all), we did not have any success until useVirtualAdressing was set to false. This was the case on both CentOS and Ubuntu.

Let us know if any info on our testing environments would be useful for you.

marcomagdy commented 7 years ago

We've added DNS validation checks when useVirtualAddressing is set to true. If the DNS validation fails, S3Client will fallback to the URL based addressing instead.