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

Setting up a fresh hydra installation results in panic #1137

Closed
someone1 opened this issue Oct 29, 2018 · 2 comments
Closed

Setting up a fresh hydra installation results in panic #1137

someone1 opened this issue Oct 29, 2018 · 2 comments
Labels
bug Something is not working.
Milestone

Comments

@someone1
Copy link
Contributor

Describe the bug
Trying to test something in hydra (does the script test-e2e-jwt.sh work when NOT using the memory databse? May need to open separate issue) and get an error when trying to setup the tables:

panic: runtime error: index out of range

goroutine 1 [running]:
github.com/ory/hydra/cmd/cli.getDBUrl(0x160a560, 0x167bf28, 0x0, 0x0, 0x0, 0xc4200f4d00, 0xc420223c78)
	/home/workspace/src/github.com/ory/hydra/cmd/cli/handler_migrate.go:100 +0x39a
github.com/ory/hydra/cmd/cli.(*MigrateHandler).MigrateSQL(0xc42000e720, 0x160a560, 0x167bf28, 0x0, 0x0)
	/home/workspace/src/github.com/ory/hydra/cmd/cli/handler_migrate.go:149 +0x62
github.com/ory/hydra/cmd/cli.(*MigrateHandler).MigrateSQL-fm(0x160a560, 0x167bf28, 0x0, 0x0)
	/home/workspace/src/github.com/ory/hydra/cmd/migrate_sql.go:43 +0x52
...

To Reproduce
Steps to reproduce the behavior:

  1. mkdir -p $HOME/workspace/hydra
  2. export GOPATH=$HOME/workspace/hydra
  3. go get -u -d github.com/ory/hydra
  4. cd $GOPATH/src/github.com/ory/hydra
  5. export GO111MODULE=on
  6. go install .
  7. docker run --name postgres -e POSTGRES_USER=hydra -e POSTGRES_PASSWORD=secret -e POSTGRES_DB=hydra -d -p 5432:5432 postgres:9.6
  8. DATABASEURL="postgres://hydra:secret@localhost:5432/hydra?sslmode=disable" $GOPATH/bin/hydra migrate sql

Expected behavior
No panics - tables created

Version:

  • Environment: [e.g. Docker, Kubernetes, ...]: Ubuntu 18.04.1/ go version go1.11.1 linux/amd64
  • Version [e.g. v1.0.0]: Commit 48b2a22
@aeneasr
Copy link
Member

aeneasr commented Oct 29, 2018

You forgot -e in DATABASEURL="postgres://hydra:secret@localhost:5432/hydra?sslmode=disable" $GOPATH/bin/hydra migrate sql, it should be DATABASEURL="postgres://hydra:secret@localhost:5432/hydra?sslmode=disable" $GOPATH/bin/hydra migrate sql -e but obviously not panic.

@aeneasr aeneasr added the bug Something is not working. label Oct 29, 2018
@aeneasr aeneasr added this to the v1.0.0-rc.1 milestone Oct 29, 2018
@someone1
Copy link
Contributor Author

I've done this so many times and yet I didn't realize ...Mondays, amirite?

Also should have been DATABASE_URL

aeneasr added a commit that referenced this issue Nov 3, 2018
aeneasr added a commit that referenced this issue Nov 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

2 participants