<@U04S8PLJWMT> ``` INFO i.a.d.i.c.m.V1_1_1_008__A...
# ask-ai
k
@kapa.ai
Copy code
INFO	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
why it is using public schema
k
Airbyte uses the public schema in PostgreSQL by default for its database objects, including tables and indexes. This is evident from multiple migration logs and error messages in the knowledge sources, where Airbyte attempts to create or modify objects in the public schema, such as:
Copy code
ERROR: permission denied for schema public
and
Copy code
Migrating schema "public" to version ...
This default behavior is not unique to Airbyte; in PostgreSQL, unless otherwise specified, new objects are created in the public schema. Airbyte's database initialization and migrations are designed to operate within this schema unless you have explicitly configured it otherwise. If you encounter permission errors for the public schema, it typically means the database user configured for Airbyte does not have sufficient privileges on that schema. This is a common issue when using managed databases or custom users, as highlighted in several user reports and issues. The solution is to grant the necessary permissions to the Airbyte user on the public schema, for example:
Copy code
sql GRANT CREATE, USAGE ON SCHEMA public TO airbyte_user;
This grant is required in addition to any database-level privileges, as noted in the documentation and user reports. Without it, Airbyte migrations that attempt to create indexes, tables, or other objects in the public schema will fail with permission errors, as seen in your log and in the knowledge sources [[Document additional grants needed for designation Postgres](https://github.com/airbytehq/airbyte/issues/32926)]. If you want Airbyte to use a different schema, you would need to configure that explicitly in your Airbyte setup and ensure the user has the appropriate permissions on that schema. However, by default, Airbyte expects to use the public schema for its operations.