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

When running migration, the database tables are not created. #6531

Closed
ohyoona opened this issue Nov 26, 2024 · 3 comments
Closed

When running migration, the database tables are not created. #6531

ohyoona opened this issue Nov 26, 2024 · 3 comments
Assignees
Labels
community-edition-setup Issues related to installing & setting up community edition migration

Comments

@ohyoona
Copy link

ohyoona commented Nov 26, 2024

2024-11-26 104131

> {"L":"info","timestamp":"2024-11-26T10:27:34.960+0900","C":"signozschemamigrator/main.go:231","M":"Opened connection"}

{"L":"info","timestamp":"2024-11-26T10:27:34.961+0900","C":"signozschemamigrator/main.go:249","M":"Migrating up"}
{"L":"info","timestamp":"2024-11-26T10:27:34.961+0900","C":"schema_migrator/manager.go:682","M":"Running migrations up async"}
{"L":"info","timestamp":"2024-11-26T10:27:34.961+0900","C":"schema_migrator/manager.go:551","M":"Checking if migration should run","db":"signoz_traces","migration_id":1000,"versions":[]}
{"L":"info","timestamp":"2024-11-26T10:27:34.961+0900","C":"schema_migrator/manager.go:568","M":"Fetching migration status","query":"SELECT * FROM signoz_traces.schema_migrations_v2 WHERE migration_id = 1000 SETTINGS final = 1;"}
{"L":"error","timestamp":"2024-11-26T10:27:34.998+0900","C":"schema_migrator/manager.go:576","M":"Failed to fetch migration status","error":"code: 81, message: Database signoz_traces does not exist","S":"github.com/SigNoz/signoz-otel-collector/cmd/signozschemamigrator/schema_migrator.(*MigrationManager).sho
e.func1\n\tD:/om-collector/cmd/signozschemamigrator/main.go:250\ngithub.com/spf13/cobra.(*Command).execute\n\tC:/Users/IN/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:985\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tC:/Users/IN/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117\ngithu

goroutine 1 [running]:
github.com/SigNoz/signoz-otel-collector/cmd/signozschemamigrator/schema_migrator.(*MigrationManager).shouldRunMigration(0xc000149380, {0x165fdc2, 0xd}, 0x3e8, {0x1d7a5e0, 0x0, 0x0})
D:/om-collector/cmd/signozschemamigrator/schema_migrator/manager.go:577 +0xb86
github.com/SigNoz/signoz-otel-collector/cmd/signozschemamigrator/schema_migrator.(*MigrationManager).MigrateUpAsync(0xc000149380, {0x17c7ac0, 0x1d7a5e0}, {0x1d7a5e0, 0x0, 0x0})
D:/om-collector/cmd/signozschemamigrator/schema_migrator/manager.go:684 +0x113
main.registerAsyncMigrate.func1(0xc00017c908, {0x165bf62?, 0x4?, 0x165bf66?})
D:/om-collector/cmd/signozschemamigrator/main.go:250 +0xf69
github.com/spf13/cobra.(*Command).execute(0xc00017c908, {0xc0000b6100, 0x4, 0x4})
C:/Users/IN/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:985 +0xaca
github.com/spf13/cobra.(*Command).ExecuteC(0xc00017c308)
C:/Users/IN/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
C:/Users/IN/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041
main.main()
D:/om-collector/cmd/signozschemamigrator/main.go:70 +0x1f9

**1. Launch ClickHouse with Docker.
2. I only want to test the signozschema migrator, so I run only the signozschemamigrator locally.

My environment is Windows.**

@srikanthccv
Copy link
Member

You are running async migrations; the sync migrations should have run first and created databases.

@pranay01
Copy link
Collaborator

@ohyoona Did the above suggestion solve your issue?

@pranay01 pranay01 added the community-edition-setup Issues related to installing & setting up community edition label Dec 4, 2024
@srikanthccv
Copy link
Member

Please run the sync migrator and then run async, then you will not run into "Database X does not exist".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-edition-setup Issues related to installing & setting up community edition migration
Projects
None yet
Development

No branches or pull requests

4 participants