Konathala Chaitanya
07/30/2025, 10:34 AMINFO i.a.d.i.c.m.V1_1_1_008__AddPendingStatusIndexToWorkload(migrate):17 - Running migration: V1_1_1_008__AddPendingStatusIndexToWorkload
2025-07-30 10:30:11,701 [main] ERROR o.f.c.i.l.s.Slf4jLog(error):49 - Migration of schema "public" to version "1.1.1.008 - AddPendingStatusIndexToWorkload" failed! Changes successfully rolled back.
2025-07-30 10:30:11,705 [main] ERROR i.a.b.ApplicationKt(main):28 - Unable to bootstrap Airbyte environment.
org.flywaydb.core.internal.exception.FlywayMigrateException: Migration failed !
at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:399)
at org.flywaydb.core.internal.command.DbMigrate.lambda$applyMigrations$1(DbMigrate.java:283)
at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:59)
at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:282)
at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:255)
at org.flywaydb.core.internal.command.DbMigrate.lambda$migrateAll$0(DbMigrate.java:153)
at org.flywaydb.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:77)
at org.flywaydb.database.postgresql.PostgreSQLAdvisoryLockTemplate.lambda$execute$0(PostgreSQLAdvisoryLockTemplate.java:60)
at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:59)
at org.flywaydb.database.postgresql.PostgreSQLAdvisoryLockTemplate.execute(PostgreSQLAdvisoryLockTemplate.java:60)
at org.flywaydb.database.postgresql.PostgreSQLConnection.lock(PostgreSQLConnection.java:105)
at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:149)
at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:153)
at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:104)
at org.flywaydb.core.Flyway.lambda$migrate$1(Flyway.java:231)
at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:213)
at org.flywaydb.core.Flyway.migrate(Flyway.java:177)
at io.airbyte.db.instance.FlywayDatabaseMigrator.migrate(FlywayDatabaseMigrator.kt:35)
at io.airbyte.bootloader.Bootloader.runFlywayMigration(Bootloader.kt:305)
at io.airbyte.bootloader.Bootloader.load(Bootloader.kt:89)
at io.airbyte.bootloader.ApplicationKt.main(Application.kt:25)
Caused by: org.flywaydb.core.api.FlywayException: Migration failed !
at org.flywaydb.core.internal.resolver.java.JavaMigrationExecutor.executeOnce(JavaMigrationExecutor.java:85)
at org.flywaydb.core.internal.resolver.java.JavaMigrationExecutor.lambda$execute$0(JavaMigrationExecutor.java:61)
at org.flywaydb.core.internal.database.DefaultExecutionStrategy.execute(DefaultExecutionStrategy.java:31)
at org.flywaydb.core.internal.resolver.java.JavaMigrationExecutor.execute(JavaMigrationExecutor.java:60)
at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:391)
... 20 common frames omitted
Caused by: org.jooq.exception.DataAccessException: SQL [CREATE INDEX IF NOT EXISTS workload_pending_status_by_dataplane_group_idx ON workload(status, dataplane_group) where status = 'pending']; ERROR: permission denied for schema public
at org.jooq_3.19.18.POSTGRES.debug(Unknown Source)
at org.jooq.impl.Tools.translate(Tools.java:3621)
at org.jooq.impl.Tools.translate(Tools.java:3609)
at org.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:827)
at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:362)
at io.airbyte.db.instance.configs.migrations.V1_1_1_008__AddPendingStatusIndexToWorkload.migrate(V1_1_1_008__AddPendingStatusIndexToWorkload.kt:24)
at org.flywaydb.core.internal.resolver.java.JavaMigrationExecutor.executeOnce(JavaMigrationExecutor.java:71)
... 24 common frames omitted
Caused by: org.postgresql.util.PSQLException: ERROR: permission denied for schema public
but it did not cause any issue for 1.5 version ... i am using same postgres db which was used in v1.5 by mekapa.ai
07/30/2025, 10:34 AMCaused by: org.jooq.exception.DataAccessException: SQL [CREATE INDEX IF NOT EXISTS workload_pending_status_by_dataplane_group_idx ON workload(status, dataplane_group) where status = 'pending']; ERROR: permission denied for schema public ... Caused by: org.postgresql.util.PSQLException: ERROR: permission denied for schema public indicates that the database user running the migration does not have sufficient privileges to create an index in the public schema. This is a permissions issue at the PostgreSQL level, not a bug in Airbyte itself. Why did it work in 1.5 but not 1.7? - Airbyte 1.7 introduces a new migration (V1_1_1_008__AddPendingStatusIndexToWorkload) that attempts to create an index on the workload table. If your database user lacks CREATE privileges on the public schema, this migration will fail. - Previous versions (like 1.5) may not have required this specific privilege for their migrations, which is why you did not encounter the issue before. How to fix: You need to grant the necessary privileges to your Airbyte database user. Specifically, you should grant CREATE and USAGE on the public schema. This is consistent with other documented Airbyte and Postgres permission issues: sql GRANT CREATE, USAGE ON SCHEMA public TO airbyte_user; Replace airbyte_user with the actual username your Airbyte instance uses to connect to the database. This type of permission issue is also reported in other contexts, such as when using external databases or deploying on managed Postgres services, and the solution is always to ensure the Airbyte user has the correct schema-level privileges. Without these, migrations that create indexes, tables, or other schema objects will fail with "permission denied for schema public" errors [Document additional grants needed for designation Postgres](https://github.com/airbytehq/airbyte/issues/32926), [Docs: Document grants requried for external airbyte database](https://github.com/airbytehq/airbyte/issues/60244). Summary: Grant your Airbyte database user CREATE and USAGE privileges on the public schema, then re-run the migration. This should resolve the error and allow the upgrade to complete.