# Error: uninitialized constant Aws::Client::Errors

**URL:** <https://discuss.elastic.co/t/error-uninitialized-constant-aws-client-errors/64923>\
**Category:** Logstash\
**Created:** [November 3, 2016, 5:30pm UTC](https://discuss.elastic.co/t/error-uninitialized-constant-aws-client-errors/64923 "2016-11-03T17:30:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![swebask](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@swebask](https://discuss.elastic.co/u/swebask)\
**Post date:** [November 3, 2016, 5:30pm UTC](https://discuss.elastic.co/t/error-uninitialized-constant-aws-client-errors/64923/1 "2016-11-03T17:30:07Z")

</div>

I'm trying got move json files from s3 to elastic search and I get the following error:

Error: uninitialized constant Aws::Client::Errors

Here is my .conf file

input {  
s3 {  
bucket =\> "xxxxxxx"  
access\_key\_id =\> "xxxxxxxxxxxxxxxxxxxxxxx"  
secret\_access\_key =\> "xxxxxxxxxxxxxxxxxxx"  
codec =\> "json"  
}  
}

output {  
elasticsearch {  
hosts =\> "xxxxxxxxxxxxxxxxxxxxxxxx"  
ssl =\> false  
flush\_size =\> 250000  
codec =\> "json"  
}  
}

The weird part is it works fine for a different S3 bucket. Any suggestions?

---

<div class="post-metadata">

**Author:** ![zoellner](https://avatars.discourse-cdn.com/v4/letter/z/e8c25b/32.png) [@zoellner](https://discuss.elastic.co/u/zoellner)\
**Post date:** [November 3, 2016, 11:34pm UTC](https://discuss.elastic.co/t/error-uninitialized-constant-aws-client-errors/64923/2 "2016-11-03T23:34:00Z")

</div>

Having the same issue

```
[2016-11-03T23:22:37,565][ERROR][logstash.pipeline] A plugin had an unrecoverable error. Will restart this plugin.
  Plugin: <LogStash::Inputs::S3 bucket=>"my-bucket", region=>"us-east-1", prefix=>"prefix/", exclude_pattern=>"_temporary", delete=>true, backup_add_prefix=>"logstashed/", backup_to_bucket=>"my-bucket", interval=>60, type=>"message", id=>"d75fedeb20a07924471e768423feb6c6c8053d54-1", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_43d6abe1-f961-41e3-af17-aae7f6e51581", enable_metric=>true, charset=>"UTF-8">, temporary_directory=>"/tmp/logstash">
  Error: uninitialized constant Aws::Client::Errors

```

Using logstash from within a docker container on AWS. I do see activity on the ES instance but none of the S3 files gets deleted or moved to the backup folder.

My input config:

```
input {
  s3 {
    bucket => "${S3_BUCKET_NAME:my-bucket}"
    region => "${S3_REGION:us-east-1}"
    prefix => "${S3_PREFIX:prefix/}"
    exclude_pattern => "_temporary"
    delete => true
    backup_add_prefix => "${S3_BACKUP_PREFIX:logstashed/}"
    backup_to_bucket => "${S3_BUCKET_NAME:my-bucket}"
    interval => 60
    type => "message"
  }
}
```

---

<div class="post-metadata">

**Author:** ![zoellner](https://avatars.discourse-cdn.com/v4/letter/z/e8c25b/32.png) [@zoellner](https://discuss.elastic.co/u/zoellner)\
**Post date:** [November 3, 2016, 11:48pm UTC](https://discuss.elastic.co/t/error-uninitialized-constant-aws-client-errors/64923/3 "2016-11-03T23:48:45Z")

</div>

I just noticed that the readme of the logstash-input-s3 plugin is missing some information:  
The s3:PutObject action is also required in the case a backup bucket is used.

So I'd assume that is error generally has to do with insufficient permissions for the particular S3 bucket.

---

<div class="post-metadata">

**Author:** ![yanso](https://avatars.discourse-cdn.com/v4/letter/y/9dc877/32.png) [@yanso](https://discuss.elastic.co/u/yanso)\
**Post date:** [November 15, 2016, 8:41pm UTC](https://discuss.elastic.co/t/error-uninitialized-constant-aws-client-errors/64923/4 "2016-11-15T20:41:34Z")

</div>

Same here. Have you managed to this problem?

---

<div class="post-metadata">

**Author:** ![modsaid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/modsaid/32/13367_2.png) [@modsaid](https://discuss.elastic.co/u/modsaid)\
**Post date:** [November 23, 2016, 2:16pm UTC](https://discuss.elastic.co/t/error-uninitialized-constant-aws-client-errors/64923/5 "2016-11-23T14:16:05Z")

</div>

This actually seems like an issue with the underlying JRuby

> <https://github.com/jruby/jruby/issues/3645>

---

<div class="post-metadata">

**Author:** ![Adam\_Caldwell](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@Adam\_Caldwell](https://discuss.elastic.co/u/Adam_Caldwell)\
**Post date:** [January 11, 2017, 5:18pm UTC](https://discuss.elastic.co/t/error-uninitialized-constant-aws-client-errors/64923/6 "2017-01-11T17:18:41Z")

</div>

Just in case anyone else finds this post the same way I did, this particular issue can be a permissions problem ([https://github.com/logstash-plugins/logstash-input-s3/issues/99](https://github.com/logstash-plugins/logstash-input-s3/issues/99)). The way I diagnosed this was with awscli -- i did an aws s3 ls bucket/prefix/ and that worked, but an aws s3 cp s3://bucket/prefix/file /tmp/x didn't work. It tuns out that your policy needs to look something like this:

```
"Action": [
  "s3:DeleteObject",
  "s3:GetObject",
   "s3:ListBucket"
],
"Resource": [
   "arn:aws:s3:::bucket_name_here",
   "arn:aws:s3:::bucket_name_here/*"
]

```

The first resource is needed for ListBucket to work and the second is needed to allow it to download files

---

<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:** [July 6, 2017, 4:29am UTC](https://discuss.elastic.co/t/error-uninitialized-constant-aws-client-errors/64923/7 "2017-07-06T04:29:26Z")

</div>


