Skip to content

Add error info when 'unable to init db' #78

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

Closed
dor-utila opened this issue Jul 6, 2022 · 3 comments · Fixed by #77
Closed

Add error info when 'unable to init db' #78

dor-utila opened this issue Jul 6, 2022 · 3 comments · Fixed by #77

Comments

@dor-utila
Copy link
Contributor

Currently, I get this error, without any useful information:

panic: localpg: failed to start PgSQL: unable to init database using: /tmp/go_embedded_pgsql_binaries_3773798719/bin/initdb -A password -U username -D /tmp/go_embedded_pgsql_runtime_2105005878/data --pwfile=/tmp/go_embedded_pgsql_runtime_2105005878/pwfile --locale=en_US.UTF-8
@jacmacmod
Copy link

I get this error when I try to run psql.Start()

I am using an alpine 12.6 postgres container

		psql := epsql.NewDatabase(epsql.DefaultConfig().
		Username(username).
		Password(password).
		Port(port).
		RuntimePath(fmt.Sprintf("/tmp/encourage_epsql_%d", getInstanceID())).
		Logger(nil),
	)

	c := make(chan os.Signal)
	signal.Notify(c, os.Interrupt)

	go func() {
		select {
		case sig := <-c:
			fmt.Printf("Got %s signal. Aborting...\n", sig)
			psql.Stop()
			os.Exit(1)
		}
	}()

	err = psql.Start()
go run gen/modelgen/*.go
panic: no version found matching 12.6.0

@fergusstrange
Copy link
Owner

Hey @OnigiriJack what embedded-postgres version/tag are you running? I assume it's https://github.com/fergusstrange/embedded-postgres/releases/tag/v1.5.0 as I think that matched Postgres 12.6.

@fergusstrange
Copy link
Owner

Just confirmed this version is from before we had Alpine linux support, which was introduced in the very next version 1.6.0.

There's been lots releases since this even, so I'd recommend trying to stay up to date to get the best support. You can see all releases here.

Thanks

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

Successfully merging a pull request may close this issue.

3 participants