# Apparent bug in logstash-output-mongodb plugin v 3.1.7 for logstash logstash-7.17.17

**URL:** <https://discuss.elastic.co/t/apparent-bug-in-logstash-output-mongodb-plugin-v-3-1-7-for-logstash-logstash-7-17-17/352819>\
**Category:** Logstash\
**Created:** [February 8, 2024, 5:05am UTC](https://discuss.elastic.co/t/apparent-bug-in-logstash-output-mongodb-plugin-v-3-1-7-for-logstash-logstash-7-17-17/352819 "2024-02-08T05:05:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaigaut](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaigaut/32/131539_2.png) [@shaigaut](https://discuss.elastic.co/u/shaigaut)\
**Post date:** [February 8, 2024, 5:05am UTC](https://discuss.elastic.co/t/apparent-bug-in-logstash-output-mongodb-plugin-v-3-1-7-for-logstash-logstash-7-17-17/352819/1 "2024-02-08T05:05:10Z")

</div>

I recently migrated from mongodb 3.0 to mongodb 6.0 and logstash plugin 3.1.5 was no longer working, I upgraded the plugin to 3.1.7 and I keep getting this error in logstash logs:

```auto
n] MONGODB | Error checking 127.0.0.1:27017: ArgumentError: wrong number of arguments (given 2, expected 1)
n] MONGODB | Failed to handshake with 127.0.0.1:27017: ArgumentError: wrong number of arguments (given 2, expected 1)
n] MONGODB | Error checking 127.0.0.1:27017: ArgumentError: wrong number of arguments (given 2, expected 1)
n] MONGODB | Failed to handshake with 127.0.0.1:27017: ArgumentError: wrong number of arguments (given 2, expected 1)
n] MONGODB | Error checking 127.0.0.1:27017: ArgumentError: wrong number of arguments (given 2, expected 1)

```

Here's my logstash configuration:

```auto
input {
  file {
    path => "/home/shaigaut/logstash.log"
    type => "log"
  }
}

output {
  mongodb {
    collection => "testplugin"
    database => "iris"
    uri => "mongodb://127.0.0.1:27017"
    codec => json { }
  }
}

```

I've been reading about this error and it seems like a bug, would love to know if there is any workaround possible to connect logstash output to mongoDB

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 8, 2024, 5:42am UTC](https://discuss.elastic.co/t/apparent-bug-in-logstash-output-mongodb-plugin-v-3-1-7-for-logstash-logstash-7-17-17/352819/2 "2024-02-08T05:42:17Z")

</div>

I would guess that [this](https://github.com/logstash-plugins/logstash-output-mongodb/commit/f6d3a73735d0871bc765afd2a8cff00152e36e73) PR is related. Perhaps downgrade to 3.1.6?

---

<div class="post-metadata">

**Author:** ![shaigaut](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaigaut/32/131539_2.png) [@shaigaut](https://discuss.elastic.co/u/shaigaut)\
**Post date:** [February 8, 2024, 9:38am UTC](https://discuss.elastic.co/t/apparent-bug-in-logstash-output-mongodb-plugin-v-3-1-7-for-logstash-logstash-7-17-17/352819/3 "2024-02-08T09:38:17Z")

</div>

This does not seem to fix the issue.

I downloaded logstash-output-mongodb: 3.1.7 from rubygems and reinstalled but no luck. See the same behavior with 3.1.6.

---

<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:** [March 7, 2024, 9:38am UTC](https://discuss.elastic.co/t/apparent-bug-in-logstash-output-mongodb-plugin-v-3-1-7-for-logstash-logstash-7-17-17/352819/4 "2024-03-07T09:38:56Z")

</div>

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