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

[BUG] Duplicate Database Creation #3845

Open
2 tasks done
Yicheng-Lu-llll opened this issue Jul 7, 2023 · 2 comments
Open
2 tasks done

[BUG] Duplicate Database Creation #3845

Yicheng-Lu-llll opened this issue Jul 7, 2023 · 2 comments
Assignees
Labels
bug Something isn't working flyteadmin Issue for FlyteAdmin Service good first issue Good for newcomers sandbox

Comments

@Yicheng-Lu-llll
Copy link
Member

Yicheng-Lu-llll commented Jul 7, 2023

Describe the bug

When first running:

flytectl demo start --dev
# Under flyte repo
make compile
POD_NAMESPACE=flyte ./flyte start --config flyte-single-binary-local.yaml

The following errors may occurs.

{"json":{"src":"start.go:63"},"level":"info","msg":"Running Database Migrations...","ts":"2023-07-07T05:13:37Z"}
{"json":{"src":"initialize.go:41"},"level":"warning","msg":"Database [flyte] does not exist, trying to create it now","ts":"2023-07-07T05:13:37Z"}
{"json":{"src":"database.go:123"},"level":"warning","msg":"Database [flyte] does not exist","ts":"2023-07-07T05:13:37Z"}
{"json":{"src":"database.go:136"},"level":"info","msg":"Creating database flyte","ts":"2023-07-07T05:13:37Z"}
{"json":{"src":"handle.go:59"},"level":"info","msg":"Creating Database flyte since it does not exist","ts":"2023-07-07T05:13:37Z"}
{"json":{"src":"initialize.go:54"},"level":"error","msg":"Failed to create DB flyte err ERROR: duplicate key value violates unique constraint \"pg_database_datname_index\" (SQLSTATE 23505)","ts":"2023-07-07T05:13:37Z"}
panic: ERROR: duplicate key value violates unique constraint "pg_database_datname_index" (SQLSTATE 23505)

It seems that during initialization, the process attempts to create the flyte database twice.
this isn't a big issue as it can be resolved by simply rerunning the command POD_NAMESPACE=flyte ./flyte start --config flyte-single-binary-local.yaml.
It will not encounter the same issue on subsequent runs as the flyte database will already exist.

Expected behavior

No errors when first running POD_NAMESPACE=flyte ./flyte start --config flyte-single-binary-local.yaml.

Additional context to reproduce

No response

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@Yicheng-Lu-llll Yicheng-Lu-llll added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Jul 7, 2023
@welcome
Copy link

welcome bot commented Jul 7, 2023

Thank you for opening your first issue here! 🛠

@eapolinario eapolinario self-assigned this Jul 7, 2023
@pingsutw pingsutw added good first issue Good for newcomers flyteadmin Issue for FlyteAdmin Service sandbox and removed untriaged This issues has not yet been looked at by the Maintainers labels Dec 22, 2023
@Terryhung
Copy link
Contributor

I think this issue had been resolved by: #4474.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flyteadmin Issue for FlyteAdmin Service good first issue Good for newcomers sandbox
Projects
None yet
Development

No branches or pull requests

4 participants