# JDBC password filepath issue

**URL:** https://discuss.elastic.co/t/jdbc-password-filepath-issue/90620
**Category:** Logstash
**Created:** [June 23, 2017, 10:52am UTC](https://discuss.elastic.co/t/jdbc-password-filepath-issue/90620 "2017-06-23T10:52:35Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sanuj5](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@sanuj5](https://discuss.elastic.co/u/sanuj5)
#### Post date: [June 23, 2017, 10:52am UTC](https://discuss.elastic.co/t/jdbc-password-filepath-issue/90620/1 "2017-06-23T10:52:35Z")

</div>

I am getting invalid username/password when I configure my JDBC connection to retrieve password from file. I have provided enough permission to the password file. It works well when I provide password in config itself. Below is my configuration. I am using logstash version 5.2.2.

```
    jdbc {
                jdbc_validate_connection => true
                jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
                jdbc_connection_string => "jdbc:oracle:thin:XXXXXXXX:port/SID"
                jdbc_user => "username"
                jdbc_password_filepath => "/opt/elk/Password"
                #jdbc_password => "password"
                schedule => "40 6 * * * America/New_York"
                type => "jdbc"
                statement => "query"
        }

```

Below is the exception.

```
[ERROR][logstash.agent] Pipeline aborted due to error {:exception=>#<Sequel::DatabaseConnectionError: Java::JavaSql::SQLException: ORA-01017: invalid username/password; logon denied
>
```

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [June 26, 2017, 5:31am UTC](https://discuss.elastic.co/t/jdbc-password-filepath-issue/90620/2 "2017-06-26T05:31:41Z")

</div>

Have you tried bumping Logstash's log level to find out more about what it's doing? You could also try sniffing the network traffic to see if you can get any clues (assuming the Oracle protocol isn't encrypted).

---

<div class="post-metadata">

### Author: ![sanuj5](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@sanuj5](https://discuss.elastic.co/u/sanuj5)
#### Post date: [June 27, 2017, 9:42am UTC](https://discuss.elastic.co/t/jdbc-password-filepath-issue/90620/3 "2017-06-27T09:42:07Z")

</div>

Thank you.

Changing log level to TRACE wasn't helpful and can't run network sniffer in current environment.

I updated logstash to 5.4.2, started the logstash with same configuration. Getting different error now and looks like a bug. It reads password correctly(which is "password" in this case) from the file but fails on String.value method call.

```
 258162 error:
 258162 258162
 258162 NoMethodError
 258162 undefined method `value' for "password":String
 258162 /logstash-5.4.2/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.2.0/lib/logstash/plugin_mixins/jdbc.rb:103:in `jdbc_connect'
 258162 /logstash-5.4.2/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.2.0/lib/logstash/plugin_mixins/jdbc.rb:159:in `open_jdbc_connection'
 258162 /logstash-5.4.2/vendor/bundle/jruby/1.9/gems/logstash-input-jdbc-4.2.0/lib/logstash/plugin_mixins/jdbc.rb:217:in `execute_statement'
```

---

<div class="post-metadata">

### Author: ![Drea](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@Drea](https://discuss.elastic.co/u/Drea)
#### Post date: [July 13, 2017, 1:27pm UTC](https://discuss.elastic.co/t/jdbc-password-filepath-issue/90620/4 "2017-07-13T13:27:00Z")

</div>

Hi,

We are having the same issue! Is there anyone who can tell me what's going on here?  
Logstash reads the password but seems to be unable to confert it to a string?

NoMethodError undefined method `value' for "password123":String

Anyone??

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [July 13, 2017, 2:23pm UTC](https://discuss.elastic.co/t/jdbc-password-filepath-issue/90620/5 "2017-07-13T14:23:27Z")

</div>

Apparently a known bug for which a PR has been posted:

> <https://github.com/logstash-plugins/logstash-input-jdbc/pull/217>

---

<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: [August 10, 2017, 2:23pm UTC](https://discuss.elastic.co/t/jdbc-password-filepath-issue/90620/6 "2017-08-10T14:23:46Z")

</div>

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