# Logstash's Kinesis input plugin doesn't able to access aws credentials file

**URL:** https://discuss.elastic.co/t/logstashs-kinesis-input-plugin-doesnt-able-to-access-aws-credentials-file/159804
**Category:** Logstash
**Created:** [December 6, 2018, 9:03pm UTC](https://discuss.elastic.co/t/logstashs-kinesis-input-plugin-doesnt-able-to-access-aws-credentials-file/159804 "2018-12-06T21:03:24Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![vnallamothu](https://avatars.discourse-cdn.com/v4/letter/v/35a633/32.png) [@vnallamothu](https://discuss.elastic.co/u/vnallamothu)
#### Post date: [December 6, 2018, 9:03pm UTC](https://discuss.elastic.co/t/logstashs-kinesis-input-plugin-doesnt-able-to-access-aws-credentials-file/159804/1 "2018-12-06T21:03:24Z")

</div>

I was trying to send my logs from AWS Kinesis Firehose to my self managed Elasticsearch cluster through logstash and logstash's kinesis input plugin.

My conf file looks like the following:

```
input {
        kinesis {
                kinesis_stream_name => "Findings-monitor"
                region => "us-west-2"
                profile => "~/.aws/credentials"
                codec => "json"
         }
}
output {
        elasticsearch {
                hosts => "XX.XX.XX.XX:9200"
                index => "sample-index"
                             }
           }

```

I've added my aws credentials to the "~/.aws/credentials" file and also installed kinesis input plugin. But, when I ran the bin/logstash -f /etc/logstash/conf.d/test.conf --path.settings /etc/logstash command, I'm getting the following error:

```
SEVERE: Unable to initialize after 20 attempts. Shutting down.
java.lang.RuntimeException: java.lang.IllegalArgumentException: profile file cannot be null
        at com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.initialize(Worker.java:664)
        at com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.run(Worker.java:564)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:438)
        at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:302)
        at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:36)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:131)
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:339)
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:83)
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:338)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:314)
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:83)
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:338)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:314)
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
        at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
        at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
        at org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:73)
        at org.jruby.runtime.Block.call(Block.java:124)
        at org.jruby.RubyProc.call(RubyProc.java:289)
        at org.jruby.RubyProc.call(RubyProc.java:246)
        at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:104)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: profile file cannot be null

```

Can anyone explain whats my fault?

---

<div class="post-metadata">

### Author: ![Raywon\_Teja\_Kari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raywon_teja_kari/32/12250_2.png) [@Raywon\_Teja\_Kari](https://discuss.elastic.co/u/Raywon_Teja_Kari)
#### Post date: [December 7, 2018, 9:16pm UTC](https://discuss.elastic.co/t/logstashs-kinesis-input-plugin-doesnt-able-to-access-aws-credentials-file/159804/2 "2018-12-07T21:16:56Z")

</div>

Hi,

here you need to use the profile name defined in your credentials file, not the path to this, if I'm not wrong...

for example: default is the profile name here

```
[default]
aws_access_key_id = XX
aws_secret_access_key = XX
```

---

<div class="post-metadata">

### Author: ![vnallamothu](https://avatars.discourse-cdn.com/v4/letter/v/35a633/32.png) [@vnallamothu](https://discuss.elastic.co/u/vnallamothu)
#### Post date: [December 7, 2018, 9:48pm UTC](https://discuss.elastic.co/t/logstashs-kinesis-input-plugin-doesnt-able-to-access-aws-credentials-file/159804/3 "2018-12-07T21:48:16Z")

</div>

Hi,

Thank you for the reply. Even if I changed the profile value to the default, it is throwing the same error. Also, I tried exporting those values as environmental variables and deleted the profile =\> default line. Still no luck.

---

<div class="post-metadata">

### Author: ![Raywon\_Teja\_Kari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raywon_teja_kari/32/12250_2.png) [@Raywon\_Teja\_Kari](https://discuss.elastic.co/u/Raywon_Teja_Kari)
#### Post date: [December 7, 2018, 9:56pm UTC](https://discuss.elastic.co/t/logstashs-kinesis-input-plugin-doesnt-able-to-access-aws-credentials-file/159804/4 "2018-12-07T21:56:38Z")

</div>

- What error did you get when you used profile =\> "default"?
- How did you set environment variables and what did you set?
- What error did you get when you used environment variables?

---

<div class="post-metadata">

### Author: ![vnallamothu](https://avatars.discourse-cdn.com/v4/letter/v/35a633/32.png) [@vnallamothu](https://discuss.elastic.co/u/vnallamothu)
#### Post date: [December 7, 2018, 10:02pm UTC](https://discuss.elastic.co/t/logstashs-kinesis-input-plugin-doesnt-able-to-access-aws-credentials-file/159804/5 "2018-12-07T22:02:33Z")

</div>

In all the cases, I got the same error that I've listed in my first post.

```
SEVERE: Unable to initialize after 20 attempts. Shutting down.
java.lang.RuntimeException: java.lang.IllegalArgumentException: profile file cannot be null
        at com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.initialize(Worker.java:664)
        at com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker.run(Worker.java:564)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:438)
        at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:302)
        at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:36)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:131)
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:339)
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:83)
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:338)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:314)
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:83)
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:338)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:314)
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:73)
        at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
        at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
        at org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:73)
        at org.jruby.runtime.Block.call(Block.java:124)
        at org.jruby.RubyProc.call(RubyProc.java:289)
        at org.jruby.RubyProc.call(RubyProc.java:246)
        at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:104)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: profile file cannot be null

```

I've set my ACCESS KEY ID and Secret access key ID as environmental variables. with commands:  
export AWS\_ACCESS\_KEY\_ID=your\_access\_key\_id  
export AWS\_SECRET\_ACCESS\_KEY=your\_secret\_access\_key

---

<div class="post-metadata">

### Author: ![vnallamothu](https://avatars.discourse-cdn.com/v4/letter/v/35a633/32.png) [@vnallamothu](https://discuss.elastic.co/u/vnallamothu)
#### Post date: [December 7, 2018, 11:47pm UTC](https://discuss.elastic.co/t/logstashs-kinesis-input-plugin-doesnt-able-to-access-aws-credentials-file/159804/6 "2018-12-07T23:47:11Z")

</div>

Do I need to create a DynamoDB table or the logstash configuration will create one? Do you have any idea?

---

<div class="post-metadata">

### Author: ![vnallamothu](https://avatars.discourse-cdn.com/v4/letter/v/35a633/32.png) [@vnallamothu](https://discuss.elastic.co/u/vnallamothu)
#### Post date: [December 10, 2018, 6:09pm UTC](https://discuss.elastic.co/t/logstashs-kinesis-input-plugin-doesnt-able-to-access-aws-credentials-file/159804/7 "2018-12-10T18:09:48Z")

</div>

if I run sudo bin/logstash -e /etc/logstash/conf.d/test.conf --path.settings /etc/logstash, instead of the parameter "-f" it is throwing the error:  
`[2018-12-10T16:30:17,624][ERROR][logstash.agent] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, input, filter, output at line 3, column 1 (byte 76) after ", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:42:in`compile\_imperative'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:50:in `compile_graph'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:12:in`block in compile\_sources'", "org/jruby/RubyArray.java:2486:in `map'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:11:in`compile\_sources'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:51:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:169:in`initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline\_action/create.rb:40:in `execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:315:in`block in converge\_state'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:141:in `with_pipelines'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:312:in`block in converge\_state'", "org/jruby/RubyArray.java:1734:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:299:in`converge\_state'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:166:in `block in converge_state_and_update'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:141:in`with\_pipelines'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:164:in `converge_state_and_update'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:90:in`execute'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:348:in `block in execute'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24:in`block in initialize'"]}`

---

<div class="post-metadata">

### Author: ![vnallamothu](https://avatars.discourse-cdn.com/v4/letter/v/35a633/32.png) [@vnallamothu](https://discuss.elastic.co/u/vnallamothu)
#### Post date: [December 11, 2018, 3:50pm UTC](https://discuss.elastic.co/t/logstashs-kinesis-input-plugin-doesnt-able-to-access-aws-credentials-file/159804/8 "2018-12-11T15:50:22Z")

</div>

My mistake is that I am running the bin/logstash command with sudo privileges but didn't assign environmental variables in root user profile.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [January 8, 2019, 3:50pm UTC](https://discuss.elastic.co/t/logstashs-kinesis-input-plugin-doesnt-able-to-access-aws-credentials-file/159804/9 "2019-01-08T15:50:26Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
