Skip to content
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

Can't use special character in password in the DataSource property #1541

Closed
renannprado opened this issue Nov 29, 2015 · 4 comments
Closed

Comments

@renannprado
Copy link

I tried the below string (password was a bit different)

"DataSource": "postgres://mmuser:*$fh3@#@127.0.0.1:5432/mattermost?sslmode=disable&connect_timeout=10",

It only started to work when I changed to a password containing only letters and numbers
I know that the @ character is used to tell ip/port and so on. But after some research, I couldn't find a way to escape the password so it could contain pretty much anything.
I wonder if it is a limitation of the connection string parser API or mattermost itself.

Error log:

[11/28/15 19:55:06] [CRIT] Failed to ping db err:dial tcp: unknown port tcp/'*
panic: Failed to open sql connection dial tcp: unknown port tcp/'*

goroutine 1 [running]:
github.com/mattermost/platform/store.setupConnection(0xb89090, 0x6, 0xc20800bcd8, 0x8, 0xc208052120, 0x59, 0xa, 0xa, 0x0, 0x1)
    /home/travis/gopath/src/github.com/mattermost/platform/store/sql_store.go:178 +0x581
github.com/mattermost/platform/store.NewSqlStore(0x0, 0x0)
    /home/travis/gopath/src/github.com/mattermost/platform/store/sql_store.go:59 +0x109
github.com/mattermost/platform/api.NewServer()
    /home/travis/gopath/src/github.com/mattermost/platform/api/server.go:33 +0x15a
main.main()
    /home/travis/gopath/src/github.com/mattermost/platform/mattermost.go:55 +0x4d8

goroutine 8 [select]:
code.google.com/p/log4go.func·002()
    /home/travis/gopath/src/github.com/mattermost/platform/Godeps/_workspace/src/code.google.com/p/log4go/filelog.go:84 +0xa53
created by code.google.com/p/log4go.NewFileLogWriter
    /home/travis/gopath/src/github.com/mattermost/platform/Godeps/_workspace/src/code.google.com/p/log4go/filelog.go:116 +0x3da

goroutine 6 [syscall]:
os/signal.loop()
    /usr/local/go/src/os/signal/signal_unix.go:21 +0x1f
created by os/signal.init·1
    /usr/local/go/src/os/signal/signal_unix.go:27 +0x35

goroutine 7 [chan receive]:
code.google.com/p/log4go.ConsoleLogWriter.run(0xc208052240, 0x7f0fdc26a030, 0xc20802a008)
    /home/travis/gopath/src/github.com/mattermost/platform/Godeps/_workspace/src/code.google.com/p/log4go/termlog.go:27 +0x7a
created by code.google.com/p/log4go.NewConsoleLogWriter
    /home/travis/gopath/src/github.com/mattermost/platform/Godeps/_workspace/src/code.google.com/p/log4go/termlog.go:19 +0x6b

goroutine 9 [chan receive]:
database/sql.(*DB).connectionOpener(0xc20803b5e0)
    /usr/local/go/src/database/sql/sql.go:589 +0x4c
created by database/sql.Open
    /usr/local/go/src/database/sql/sql.go:452 +0x31c

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1
@coreyhulen
Copy link
Contributor

Thanks for the report. I suspect it's a problem with the underlying driver either github.com/go-sql-driver/mysql or github.com/lib/pq since we're just setting the connection string as seen at https://github.com/mattermost/platform/blob/master/store/sql_store.go#L168

@renannprado
Copy link
Author

Newer versions of go-sql-driver/mysql don't have this issue. I've just tried with mattermost 1.4 and it worked. You can close this issue.

@it33 it33 closed this as completed Jan 26, 2016
@jbfriedrich
Copy link

I have this issue with mattermost 1.4 and Ubuntu 14.04.3. Also with other special characters like #.

@kunthar
Copy link

kunthar commented Sep 23, 2016

Special chars in password problem is still alive.
in mattermost-3.4.0-linux-amd64.tar.gz for ubuntu trusty.
i had to change the password with "?" in it.

Quick guidance to change postgresql password;
sudo -u postgres psql
postgres=# \c mattermost
ALTER USER mmuser WITH PASSWORD 'new_password';
no restart needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants