Hi there, I am still running into this issue deplo...
# ask-ai
b
Hi there, I am still running into this issue deploying on GKE with Helm and I'm unable to proceed with deploying Airbyte. https://airbytehq.slack.com/archives/C01AHCD885S/p1683221371096399 I've tried deploying it manually, recreating the entire database, etc and the
temporal
pod continues to log the error "temporal database already exists" and fail to configure the docker config file. As far as I can tell,
temporal
is successfully creating the temporal DB, so I'm at a loss for why it is then erroring out saying it failed to create it.
k
A message from kapa.ai
m
Hey, have you tried deploying it on different cluster to different cloud sql instance? It worked for me
k
Hmm, I don't know enough to give you a confident answer yet. However, I can point you to a similar issue discussed in a previous support conversation on Slack [here](https://airbytehq.slack.com/archives/C021JANJ6TY/p1673217066302239). The user was able to resolve the issue by manually creating the
temporal
and
temporal_visibility
databases and granting privileges to the Airbyte user. You can try the following code if you're connecting to the Postgres server using psql:
Copy code
create database temporal; grant all privileges on database temporal to airbyte;  create database temporal_visibility; grant all privileges on database temporal_visibility to airbyte;
If this doesn't help, I recommend checking the [Airbyte documentation](https://docs.airbyte.com) and [Airbyte community forum](https://discuss.airbyte.io) for more information and assistance.
b
@Mateusz Kijewski I have not, I was going to move on to try it on another cluster that is pending deployment today and see if it made a difference.
m
Try this one
b
I might try this as well
Copy code
create database temporal;
grant all privileges on database temporal to airbyte;

create database temporal_visibility;
grant all privileges on database temporal_visibility to airbyte;
That privilege grant didn't make a difference but deploying it in another cluster did work...
m
Yea exactly the same as in my case
r
Is it a new external database along with the custer?
b
Yeah
m
I haven’t checked if new database solved the issue or new cluster
r
I assume that if I allow it to create the databases itself it will work, at least until rebooted. I created the databases myself as template1 is non-standard for our primary application, but I might just reset it to defaults as it doesn't really need to be different anymore. The databases I created have the 'airbyte' user as owner of both the db and the public schema, but privileges don't seem to be the issue anyway.
b
I had to create the DB first in order for the bootstrapper to work. But I let temporal create the tables every time
r
Looking at the source for temporal-sql-tool, it shouldn't try to create the database if it already exists... It must be getting a different error message back than it expects. https://github.com/temporalio/temporal/blob/3b982585bf0124839e697952df4bba01fe4d9543/common/persistence/sql/sqlplugin/postgresql/admin.go#L134
Nope, I get exactly the right error code when I try to make the DB again: 42P04 duplicate_database
b
Recreating my external DB instance did the trick!
r
I imagine that just deleted the existing DB and reset everything to default in postgres. I would expect that to work, but sadly not really a solution.
b
Yeah unfortunately not...
r
The really old version of Temporal used by Airbyte doesn't include the code that gracefully fails when the database already exists. Updating to a newer version of temporal would completely fix this issue. https://github.com/temporalio/temporal/blob/6cbfa2a3a569fcc856788b37616876538d904b3d/common/persistence/sql/sqlplugin/postgresql/admin.go#L132