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

Error opening database: invalid bool value: true while using parseTime and multiStatements in DATABASE_URL #360

Open
shubham0204 opened this issue Dec 2, 2023 · 0 comments

Comments

@shubham0204
Copy link

shubham0204 commented Dec 2, 2023

While setting gotrue on a Azure VM, I was using the following variable in a .env file,

DATABASE_URL="root:root@tcp(localhost)/gotrue?parseTime=true&multiStatements=true"

and after running the Docker image,

$> docker run --rm --env-file .env gotrue
time="2023-12-02T14:23:17.843345898Z" level=debug msg="Set log level to: debug"
time="2023-12-02T14:23:17Z" level=fatal msg="Error opening database: invalid bool value: true\"\nthe URL '\"root:root@tcp(localhost)/gotrue?parseTime=true&multiStatements=true\"' is not supported by MySQL driver\ngithub.com/gobuffalo/pop/v5.urlParserMySQL\n\t/go/pkg/mod/github.com/gobuffalo/pop/[email protected]/dialect_mysql.go:204\ngithub.com/gobuffalo/pop/v5.(*ConnectionDetails).withURL\n\t/go/pkg/mod/github.com/gobuffalo/pop/[email protected]/connection_details.go:101\ngithub.com/gobuffalo/pop/v5.(*ConnectionDetails).Finalize\n\t/go/pkg/mod/github.com/gobuffalo/pop/[email protected]/connection_details.go:137\ngithub.com/gobuffalo/pop/v5.NewConnection\n\t/go/pkg/mod/github.com/gobuffalo/pop/[email protected]/connection.go:60\ngithub.com/netlify/gotrue/storage.Dial\n\t/go/src/github.com/netlify/gotrue/storage/dial.go:31\ngithub.com/netlify/gotrue/cmd.serve\n\t/go/src/github.com/netlify/gotrue/cmd/serve_cmd.go:24\ngithub.com/netlify/gotrue/cmd.execWithConfig\n\t/go/src/github.com/netlify/gotrue/cmd/root_cmd.go:37\ngithub.com/netlify/gotrue/cmd.glob..func4\n\t/go/src/github.com/netlify/gotrue/cmd/root_cmd.go:15\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:844\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:945\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:885\nmain.main\n\t/go/src/github.com/netlify/gotrue/main.go:10\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:204\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1374\nopening database connection\ngithub.com/netlify/gotrue/storage.Dial\n\t/go/src/github.com/netlify/gotrue/storage/dial.go:36\ngithub.com/netlify/gotrue/cmd.serve\n\t/go/src/github.com/netlify/gotrue/cmd/serve_cmd.go:24\ngithub.com/netlify/gotrue/cmd.execWithConfig\n\t/go/src/github.com/netlify/gotrue/cmd/root_cmd.go:37\ngithub.com/netlify/gotrue/cmd.glob..func4\n\t/go/src/github.com/netlify/gotrue/cmd/root_cmd.go:15\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:844\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:945\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:885\nmain.main\n\t/go/src/github.com/netlify/gotrue/main.go:10\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:204\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1374"

The example.env also has a similar value for DATABASE_URL. I tried removing the parameters parseTime and multiStatements from the URL, but then the warnings persist.

MySQL version: mysql Ver 8.0.35-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))

Update

DATABASE_URL when provided with the docker run command works without any error:

$> sudo docker run --rm --env-file .env -e DATABASE_URL="root:root@tcp(127.0.0.1:3306)/gotrue_development?parseTime=true&multiStatements=true" gotrue
time="2023-12-02T14:39:40.58839382Z" level=debug msg="Set log level to: debug"
time="2023-12-02T14:39:40Z" level=info msg="GoTrue API started on: localhost:9999"
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

1 participant