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

Failed to start mattermost web after restart #263

Closed
maxlazio opened this issue Jul 28, 2015 · 6 comments
Closed

Failed to start mattermost web after restart #263

maxlazio opened this issue Jul 28, 2015 · 6 comments
Assignees

Comments

@maxlazio
Copy link

Hi all,

this is my first time installing mattermost so please tell me if I missed something(I did try reading through the docs).

I've setup mattermost from source and it is running on PostgreSQL. I am starting it with /go/bin/godep go run mattermost.go and all was running correctly on the first start. However, once I've stopped go web and started it again I can no longer get mattermost to run:

07/28/15 13:35:04] [CRIT] Failed to create index pq: relation "idx_teams_name" already exists
panic: Failed to create index pq: relation "idx_teams_name" already exists

goroutine 1 [running]:
github.com/mattermost/platform/store.SqlStore.createIndexIfNotExists(0xc208040780, 0xc208038048, 0x1, 0x1, 0x7f72e92d5bf0, 0xc208038060, 0x7f72e92d5c40, 0xc2080380e0, 0x7f72e92d5cf0, 0xc208038130, ...)
    /go/src/github.com/mattermost/platform/store/sql_store.go:244 +0x543
github.com/mattermost/platform/store.SqlStore.CreateIndexIfNotExists(0xc208040780, 0xc208038048, 0x1, 0x1, 0x7f72e92d5bf0, 0xc208038060, 0x7f72e92d5c40, 0xc2080380e0, 0x7f72e92d5cf0, 0xc208038130, ...)
    /go/src/github.com/mattermost/platform/store/sql_store.go:217 +0xa6
github.com/mattermost/platform/store.SqlTeamStore.CreateIndexesIfNotExists(0xc20807a180)
    /go/src/github.com/mattermost/platform/store/sql_team_store.go:44 +0x8c
github.com/mattermost/platform/store.NewSqlStore(0x0, 0x0)
    /go/src/github.com/mattermost/platform/store/sql_store.go:67 +0x678
github.com/mattermost/platform/api.NewServer()
    /go/src/github.com/mattermost/platform/api/server.go:30 +0x15a
main.main()
    /go/src/github.com/mattermost/platform/mattermost.go:27 +0x1bd

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

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

goroutine 7 [chan receive]:
code.google.com/p/log4go.ConsoleLogWriter.run(0xc2080402a0, 0x7f72e92d3ff0, 0xc208038008)
    /go/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
    /go/src/github.com/mattermost/platform/Godeps/_workspace/src/code.google.com/p/log4go/termlog.go:19 +0x6b

goroutine 8 [select]:
code.google.com/p/log4go.func·002()
    /go/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
    /go/src/github.com/mattermost/platform/Godeps/_workspace/src/code.google.com/p/log4go/filelog.go:116 +0x3da

goroutine 9 [chan receive]:
database/sql.(*DB).connectionOpener(0xc208043680)
    /usr/src/go/src/database/sql/sql.go:589 +0x4c
created by database/sql.Open
    /usr/src/go/src/database/sql/sql.go:452 +0x31c
exit status 2
godep: go exit status 1

What am I doing wrong?

@jwilander
Copy link
Member

Hi maxlazio,

Which version of Postgres are you running? My guess is it's below 9.4 and that's causing the issue. Specifically, if I'm correct, it's being caused by the query we use to check for existing indexes in PostgreSQL. We're doing a SELECT to_regclass(stuff) and to_regclass looks like it's new in PostgreSQL 9.4+.

I imagine this is an issue for you guys and we need to support lower versions of PostgreSQL. If you can give me the lowest version of PostgreSQL that you need to support I can go and make sure we support that as well.

@maxlazio
Copy link
Author

@jwilander Thanks for the quick response.

We are running 9.2(.10) by default, going lower than that version is unlikely to happen.

@jwilander
Copy link
Member

Sounds good, I'll go make sure we can support at least 9.2. I'll link the PR to this issue when it's going in. Hopefully it should only take me an hour or two at most.

@maxlazio
Copy link
Author

@jwilander awesome, no rush as there is enough to keep me occupied anyway :)

@jwilander
Copy link
Member

Ok @maxlazio the fix has been merged into master and I also made sure nothing else would break with PostgreSQL 9.2.

Let me know if it works for you and I'll close the issue.

Also feel free to let me know if you need help with anything else :)

@maxlazio
Copy link
Author

Works now, thanks for the quick turnaround!

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

2 participants