Skip to content

Kinesis PutRecordsRequest failed! #395

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

Closed
arc1986 opened this issue Dec 31, 2016 · 6 comments
Closed

Kinesis PutRecordsRequest failed! #395

arc1986 opened this issue Dec 31, 2016 · 6 comments
Labels
help wanted We are asking the community to submit a PR to resolve this issue.

Comments

@arc1986
Copy link

arc1986 commented Dec 31, 2016

Hi, Kinesis PutRecordsRequest failing with the following error,

i have checked with AWS-CLI and its working as excepted. But in my own code am getting this error.

am running in Ubuntu machine.

error:
terminate called after throwing an instance of 'std::system_error'
what(): Resource temporarily unavailable
Aborted (core dumped)

code:
function :
void StreamData(const Aws::Vector& data)
{
PutRecordsRequest putRecordsRequest;
putRecordsRequest.SetStreamName(m_streamName);

    for(auto& datum : data)
    {
        PutRecordsRequestEntry putRecordsRequestEntry;
        putRecordsRequestEntry.WithData(datum)
                .WithPartitionKey(m_partition);

        putRecordsRequest.AddRecords(putRecordsRequestEntry);
    }

    m_client->PutRecordsAsync(putRecordsRequest,
           std::bind(&KinesisProducer::OnPutRecordsAsyncOutcomeReceived, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4));
}

caller
Aws::String LogDataHead("AP Logs");;
Aws::String LogData;

  while (true){
  producer.StreamData( {
                               ByteBuffer((unsigned char*)LogDataHead.c_str(), LogDataHead.length()),
                               ByteBuffer((unsigned char*)LogData.c_str(), LogData.length())
                       });
  }
@JonathanHenson
Copy link
Contributor

JonathanHenson commented Dec 31, 2016 via email

@arc1986
Copy link
Author

arc1986 commented Jan 1, 2017

Thanks Jona, This is the valgrind output,

.so)
==1582== by 0x540D453: void std::_Bind_simple<std::function<void ()> ()>::_M_invoke<>(std::_Index_tuple<>) (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)
==1582== by 0x540D3A9: std::_Bind_simple<std::function<void ()> ()>::operator()() (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)
==1582== by 0x540D339: std::thread::_Impl<std::_Bind_simple<std::function<void ()> ()> >::_M_run() (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)
==1582== by 0x5774C7F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==1582== by 0x60246B9: start_thread (pthread_create.c:333)
==1582== by 0x5D5A82C: clone (clone.S:109)

Thread 492: status = VgTs_WaitSys (lwpid 2316)
==1582== at 0x5D4EB5D: ??? (syscall-template.S:84)
==1582== by 0x90AA154: send_dg (res_send.c:1162)
==1582== by 0x90AA154: __libc_res_nsend (res_send.c:538)
==1582== by 0x90A7D61: __libc_res_nquery (res_query.c:227)
==1582== by 0x90A88F7: __libc_res_nquerydomain (res_query.c:597)
==1582== by 0x90A88F7: __libc_res_nsearch (res_query.c:381)
==1582== by 0x15ED3B88: _nss_dns_gethostbyname4_r (dns-host.c:326)
==1582== by 0x5D3F077: gaih_inet (getaddrinfo.c:870)
==1582== by 0x5D4217D: getaddrinfo (getaddrinfo.c:2425)
==1582== by 0x6276EA6: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x6281CE9: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x627F47A: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x60246B9: start_thread (pthread_create.c:333)
==1582== by 0x5D5A82C: clone (clone.S:109)

Thread 493: status = VgTs_WaitSys (lwpid 2318)
==1582== at 0x5D4EB5D: ??? (syscall-template.S:84)
==1582== by 0x90AA154: send_dg (res_send.c:1162)
==1582== by 0x90AA154: __libc_res_nsend (res_send.c:538)
==1582== by 0x90A7D61: __libc_res_nquery (res_query.c:227)
==1582== by 0x90A88F7: __libc_res_nquerydomain (res_query.c:597)
==1582== by 0x90A88F7: __libc_res_nsearch (res_query.c:381)
==1582== by 0x15ED3B88: _nss_dns_gethostbyname4_r (dns-host.c:326)
==1582== by 0x5D3F077: gaih_inet (getaddrinfo.c:870)
==1582== by 0x5D4217D: getaddrinfo (getaddrinfo.c:2425)
==1582== by 0x6276EA6: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x6281CE9: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x627F47A: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x60246B9: start_thread (pthread_create.c:333)
==1582== by 0x5D5A82C: clone (clone.S:109)

Thread 494: status = VgTs_WaitSys (lwpid 2319)
==1582== at 0x5D4EB5D: ??? (syscall-template.S:84)
==1582== by 0x90AA154: send_dg (res_send.c:1162)
==1582== by 0x90AA154: __libc_res_nsend (res_send.c:538)
==1582== by 0x90A7D61: __libc_res_nquery (res_query.c:227)
==1582== by 0x90A88F7: __libc_res_nquerydomain (res_query.c:597)
==1582== by 0x90A88F7: __libc_res_nsearch (res_query.c:381)
==1582== by 0x15ED3B88: _nss_dns_gethostbyname4_r (dns-host.c:326)
==1582== by 0x5D3F077: gaih_inet (getaddrinfo.c:870)
==1582== by 0x5D4217D: getaddrinfo (getaddrinfo.c:2425)
==1582== by 0x6276EA6: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x6281CE9: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x627F47A: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x60246B9: start_thread (pthread_create.c:333)
==1582== by 0x5D5A82C: clone (clone.S:109)

Thread 495: status = VgTs_WaitSys (lwpid 2320)
==1582== at 0x5D4EB5D: ??? (syscall-template.S:84)
==1582== by 0x90AA154: send_dg (res_send.c:1162)
==1582== by 0x90AA154: __libc_res_nsend (res_send.c:538)
==1582== by 0x90A7D61: __libc_res_nquery (res_query.c:227)
==1582== by 0x90A88F7: __libc_res_nquerydomain (res_query.c:597)
==1582== by 0x90A88F7: __libc_res_nsearch (res_query.c:381)
==1582== by 0x15ED3B88: _nss_dns_gethostbyname4_r (dns-host.c:326)
==1582== by 0x5D3F077: gaih_inet (getaddrinfo.c:870)
==1582== by 0x5D4217D: getaddrinfo (getaddrinfo.c:2425)
==1582== by 0x6276EA6: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x6281CE9: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x627F47A: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x60246B9: start_thread (pthread_create.c:333)
==1582== by 0x5D5A82C: clone (clone.S:109)

Thread 496: status = VgTs_WaitSys (lwpid 2321)
==1582== at 0x602A360: pthread_cond_wait@@GLIBC_2.3.2 (pthread_cond_wait.S:185)
==1582== by 0x576F91B: std::condition_variable::wait(std::unique_lockstd::mutex&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==1582== by 0x5421627: void std::condition_variable::wait<Aws::Utils::ExclusiveOwnershipResourceManager<void*>::Acquire()::{lambda()#1}>(std::unique_lockstd::mutex&, Aws::Utils::ExclusiveOwnershipResourceManager<void*>::Acquire()::{lambda()#1}) (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)
==1582== by 0x5420FF2: Aws::Utils::ExclusiveOwnershipResourceManager<void*>::Acquire() (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)
==1582== by 0x54203F4: Aws::Http::CurlHandleContainer::AcquireCurlHandle() (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)
==1582== by 0x541D649: Aws::Http::CurlHttpClient::MakeRequest(Aws::Http::HttpRequest&, Aws::Utils::RateLimits::RateLimiterInterface*, Aws::Utils::RateLimits::RateLimiterInterface*) const (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)
==1582== by 0x53E9A5F: Aws::Client::AWSClient::AttemptOneRequest(std::__cxx11::basic_string<char, std::char_traits, Aws::Allocator > const&, Aws::AmazonWebServiceRequest const&, Aws::Http::HttpMethod) const (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)
==1582== by 0x53E89D9: Aws::Client::AWSClient::AttemptExhaustively(std::__cxx11::basic_string<char, std::char_traits, Aws::Allocator > const&, Aws::AmazonWebServiceRequest const&, Aws::Http::HttpMethod) const (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)
==1582== by 0x53EACD0: Aws::Client::AWSJsonClient::MakeRequest(std::__cxx11::basic_string<char, std::char_traits, Aws::Allocator > const&, Aws::AmazonWebServiceRequest const&, Aws::Http::HttpMethod) const (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)
==1582== by 0x4F5A294: Aws::Kinesis::KinesisClient::PutRecords(Aws::Kinesis::Model::PutRecordsRequest const&) const (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-kinesis/libaws-cpp-sdk-kinesis.so)
==1582== by 0x4F5A7C8: Aws::Kinesis::KinesisClient::PutRecordsAsyncHelper(Aws::Kinesis::Model::PutRecordsRequest const&, std::function<void (Aws::Kinesis::KinesisClient const*, Aws::Kinesis::Model::PutRecordsRequest const&, Aws::Utils::Outcome<Aws::Kinesis::Model::PutRecordsResult, Aws::Client::AWSErrorAws::Kinesis::KinesisErrors > const&, std::shared_ptr<Aws::Client::AsyncCallerContext const> const&)> const&, std::shared_ptr<Aws::Client::AsyncCallerContext const> const&) const (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-kinesis/libaws-cpp-sdk-kinesis.so)
==1582== by 0x4F5A617: Aws::Kinesis::KinesisClient::PutRecordsAsync(Aws::Kinesis::Model::PutRecordsRequest const&, std::function<void (Aws::Kinesis::KinesisClient const*, Aws::Kinesis::Model::PutRecordsRequest const&, Aws::Utils::Outcome<Aws::Kinesis::Model::PutRecordsResult, Aws::Client::AWSErrorAws::Kinesis::KinesisErrors > const&, std::shared_ptr<Aws::Client::AsyncCallerContext const> const&)> const&, std::shared_ptr<Aws::Client::AsyncCallerContext const> const&) const::{lambda()#1}::operator()() const (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-kinesis/libaws-cpp-sdk-kinesis.so)
==1582== by 0x4F6E74D: void std::_Bind<Aws::Kinesis::KinesisClient::PutRecordsAsync(Aws::Kinesis::Model::PutRecordsRequest const&, std::function<void (Aws::Kinesis::KinesisClient const*, Aws::Kinesis::Model::PutRecordsRequest const&, Aws::Utils::Outcome<Aws::Kinesis::Model::PutRecordsResult, Aws::Client::AWSErrorAws::Kinesis::KinesisErrors > const&, std::shared_ptr<Aws::Client::AsyncCallerContext const> const&)> const&, std::shared_ptr<Aws::Client::AsyncCallerContext const> const&) const::{lambda()#1} ()>::__call(std::tuple<>&&, std::_Index_tuple<>) (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-kinesis/libaws-cpp-sdk-kinesis.so)
==1582== by 0x4F6BFEE: void std::_Bind<Aws::Kinesis::KinesisClient::PutRecordsAsync(Aws::Kinesis::Model::PutRecordsRequest const&, std::function<void (Aws::Kinesis::KinesisClient const*, Aws::Kinesis::Model::PutRecordsRequest const&, Aws::Utils::Outcome<Aws::Kinesis::Model::PutRecordsResult, Aws::Client::AWSErrorAws::Kinesis::KinesisErrors > const&, std::shared_ptr<Aws::Client::AsyncCallerContext const> const&)> const&, std::shared_ptr<Aws::Client::AsyncCallerContext const> const&) const::{lambda()#1} ()>::operator()<, void>() (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-kinesis/libaws-cpp-sdk-kinesis.so)
==1582== by 0x4F66F55: std::_Function_handler<void (), std::_Bind<Aws::Kinesis::KinesisClient::PutRecordsAsync(Aws::Kinesis::Model::PutRecordsRequest const&, std::function<void (Aws::Kinesis::KinesisClient const*, Aws::Kinesis::Model::PutRecordsRequest const&, Aws::Utils::Outcome<Aws::Kinesis::Model::PutRecordsResult, Aws::Client::AWSErrorAws::Kinesis::KinesisErrors > const&, std::shared_ptr<Aws::Client::AsyncCallerContext const> const&)> const&, std::shared_ptr<Aws::Client::AsyncCallerContext const> const&) const::{lambda()#1} ()> >::_M_invoke(std::_Any_data const&) (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-kinesis/libaws-cpp-sdk-kinesis.so)
==1582== by 0x5407E09: std::function<void ()>::operator()() const (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)
==1582== by 0x540D453: void std::_Bind_simple<std::function<void ()> ()>::_M_invoke<>(std::_Index_tuple<>) (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)
==1582== by 0x540D3A9: std::_Bind_simple<std::function<void ()> ()>::operator()() (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)
==1582== by 0x540D339: std::thread::_Impl<std::_Bind_simple<std::function<void ()> ()> >::_M_run() (in /home/arunc/openwrt/only_kin/bls/aws-cpp-sdk-core/libaws-cpp-sdk-core.so)
==1582== by 0x5774C7F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==1582== by 0x60246B9: start_thread (pthread_create.c:333)
==1582== by 0x5D5A82C: clone (clone.S:109)

Thread 497: status = VgTs_WaitSys (lwpid 2322)
==1582== at 0x5D4EB5D: ??? (syscall-template.S:84)
==1582== by 0x90AA154: send_dg (res_send.c:1162)
==1582== by 0x90AA154: __libc_res_nsend (res_send.c:538)
==1582== by 0x90A7D61: __libc_res_nquery (res_query.c:227)
==1582== by 0x90A88F7: __libc_res_nquerydomain (res_query.c:597)
==1582== by 0x90A88F7: __libc_res_nsearch (res_query.c:381)
==1582== by 0x15ED3B88: _nss_dns_gethostbyname4_r (dns-host.c:326)
==1582== by 0x5D3F077: gaih_inet (getaddrinfo.c:870)
==1582== by 0x5D4217D: getaddrinfo (getaddrinfo.c:2425)
==1582== by 0x6276EA6: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x6281CE9: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x627F47A: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x60246B9: start_thread (pthread_create.c:333)
==1582== by 0x5D5A82C: clone (clone.S:109)

Thread 498: status = VgTs_WaitSys (lwpid 2323)
==1582== at 0x5D4EB5D: ??? (syscall-template.S:84)
==1582== by 0x90AA154: send_dg (res_send.c:1162)
==1582== by 0x90AA154: __libc_res_nsend (res_send.c:538)
==1582== by 0x90A7D61: __libc_res_nquery (res_query.c:227)
==1582== by 0x90A88F7: __libc_res_nquerydomain (res_query.c:597)
==1582== by 0x90A88F7: __libc_res_nsearch (res_query.c:381)
==1582== by 0x15ED3B88: _nss_dns_gethostbyname4_r (dns-host.c:326)
==1582== by 0x5D3F077: gaih_inet (getaddrinfo.c:870)
==1582== by 0x5D4217D: getaddrinfo (getaddrinfo.c:2425)
==1582== by 0x6276EA6: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x6281CE9: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x627F47A: ??? (in /usr/lib/x86_64-linux-gnu/libcurl1.so)
==1582== by 0x60246B9: start_thread (pthread_create.c:333)
==1582== by 0x5D5A82C: clone (clone.S:109)

Thread 499: status = VgTs_Init (lwpid 0)
==1582== at 0x5D5A7F1: clone (clone.S:81)

Note: see also the FAQ in the source distribution.
It contains workarounds to several common problems.
In particular, if Valgrind aborted or crashed after
identifying problems in your program, there's a good chance
that fixing those problems will prevent Valgrind aborting or
crashing, especially if it happened in m_mallocfree.c.

If that doesn't help, please report this bug to: www.valgrind.org

@arc1986
Copy link
Author

arc1986 commented Jan 1, 2017

plz let me know if we need more logs....

@JonathanHenson
Copy link
Contributor

This trace looks to me like you haven't called InitAPI(). Can you verify that InitAPI is getting called before this code is invoked?

@arc1986
Copy link
Author

arc1986 commented Jan 19, 2017

Yes , Am calling InitAPI and shut API also,

@singku
Copy link
Contributor

singku commented Mar 25, 2019

It's been two years without further information and investigation. So close this for now. Reopen if you still have problem.

@singku singku closed this as completed Mar 25, 2019
@singku singku reopened this Mar 25, 2019
@singku singku closed this as completed Mar 25, 2019
@justnance justnance added help wanted We are asking the community to submit a PR to resolve this issue. and removed help wanted labels Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We are asking the community to submit a PR to resolve this issue.
Projects
None yet
Development

No branches or pull requests

5 participants