"Unable to create catalog entry" on deploy?

Hey there! On a recent deploy we encountered something strange we’d like to understand better.

We’re using Ions, and our system uses a startup sequence that involves
calling datomic.client.api/create-database to ensure the database exists.

Today that codepath errored out on post-deploy startup with the following Cloudwatch error…

{"CognitectAnomaliesCategory": "CognitectAnomaliesFault",
 "DatomicCloudAwsAnomaliesError": {"Error": "Unable to create catalog entry",
                                   "Cause": {"Conflict":true}},
 "Msg": "Server Error",
 "Type": "Alert",
 "Tid":138,
 "Timestamp":1660929768805}

This was repeated in the logs as an IonLambdaException at irregular
intervals thereafter, roughly 25 times over the next 15 minutes.

Possibly related: just after the deploy printed its “SUCCEEDED”
routine to the console, I had created an AWS Eventbridge rule that
issues a request to a Lambda every minute.

The database in question already existed and was not new.

The error messages went away when I deployed HEAD~1, and when I
re-deployed HEAD after 20-30 minutes of troubleshooting, the error
messages did not come back.

It seems unlikely we’d need to worry about coordinating access to a
system during deployment, but the above seems to raise the question.

Datomic Cloud version: 781-9041.

1 Like

Hey @daemianmack long time no see!

Sorry for the late reply. The error you encountered can be thrown when a database already exists in the catalog, but also in instances where there is a bad connection to the client such as a corrupt config. You should not need to worry about coordinating access to a system during deploy.

I think the bigger concern your description raises for me is why are you using create-database in your startup sequence? If this is just a check to see that the DB is there, have you explored using list-databases? I am concerned that this approach might create empty DBs or be prone to other problems. But perhaps you have a specific reason for calling that I am missing.