-
-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error parsing database password in database.yml #402
Comments
Hi @rezan83, can you provide more info about your setup? At least your OS and the database used. Thanks! |
ubuntu 19.04, postgres 11.4 |
the output of buffalo info: App InformationPwd=/home/rezan/go/src/github.com/buffalo_project/first Go Versiongo version go1.12.6 linux/amd64 Go EnvGOARCH="amd64" Node Versionv10.15.2 NPM Version6.9.0 Yarn Version1.12.3 PostgreSQL VersionPostgreSQL Not Found MySQL VersionMySQL Not Found SQLite Version3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt1 Dep Versioncould not find a Gopkg.toml file Dep Statuscould not find a Gopkg.toml file config/buffalo-app.tomlname = "first" config/buffalo-plugins.toml[[plugin]] [[plugin]] |
This issue bit me as well while using postgres. Turns out it was an "issue" with lib/pq's use of net/url to parse connection strings that contain reserved characters (see RFC 3986). Reserved characters in a connection string need to be URL encoded for things to work properly. This comment in lib/pq pointed me in the right direction: lib/pq#787 (comment) Also, here's a go playground illustrating the issue in case it helps: https://play.golang.org/p/bqArco_cMyP Changing pop/connection_details_test.go Lines 13 to 21 in aab726f
following the breadcrumbs... Lines 78 to 80 in aab726f
Line 214 in aab726f
Line 18 in aab726f
then, over in lib/pq, The next question is what to do about the situation. I can understand the use of the underlying url parsing library, but it seems clear that some users (myself included) expect to be able to use an unaltered password when specifying connection details. Is a note in the documentation visible enough as a solution? Should something be responsible for encoding any passwords that include reserved characters so that things just work? |
Hey Andrew, you are on the right track. I just had to solve the same problem where my password used a reserved character. The solution is you put all the address string information into url.URL struct. You can put userinfo into url.URL.User = url.UserPassword(user, password). You can print out the final constructed url string and can see that it is encoded to verify. |
Description
my database pass was something like this: longname#?
when running dev it failed to make transaction giving the error: could not create new transaction: dial tcp: address tcp/longname: unknown port
Expected Behavior
one should be able to make whatever password he wants for the database
Actual Behavior
because there was no actual tcp with the name tcp/longname I thought that its a parsing problem with the #? part of the password. I have no idea why and how!
Info
for me, I simply solved the problem with changing the password and delete the #? part and using only ordinary characters and that's how I made sure that that was the problem
The text was updated successfully, but these errors were encountered: