vertica/vertica-sql-go

Invalid username or password but vsql runs without a problem

Closed this issue · 5 comments

I m getting the following message, when I run my program:

Jan 31 12:51:26.659784 ERROR driver: Error: [28000] Invalid username or password
Jan 31 12:51:26.660209 FATAL samplecode: Error: [28000] Invalid username or password

vsql runs fine from the same host.

I m connecting using:

onnDB, err := sql.Open("vertica", vertica://" + user + ":" + pass + ":@" + host + ":5433/db")

Is there any kind of configuration I need to do prior to that ?

Could you try making is 'pass + "@" + host' instead of 'pass + ":@" + host'? Haven't verified, but am pretty sure that colon before the "@" isn't correct and is probably making the Go URL parser code think you don't have a password.

Sadly, still the same:

Jan 31 14:01:19.379286 ERROR driver: Error: [28000] Invalid username or password
Jan 31 14:01:19.379743 FATAL samplecode: Error: [28000] Invalid username or password

Interesting. I've not seen this problem anywhere else. Can you provide the following:?

  1. A sanitized copy of the URL value being passed in to the sql.Open() call.
  2. Your Vertica version.
  3. Your Go version.

Thanks to your suggestion, I figured out the problem, unrelated to vertica-go:
the password contained `\n' character causing it to fail authentication.
Not a bug, stupid mistake on my end :shame:

Cool. No shame there. Glad it all worked out for you!