JDBC password filepath issue

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
>

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).

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'

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??

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

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