I am having an issue with a particular AG where I am adding a DB (test123 below) to the AG and on primary it will show everything OK as follows:
However, on secondary it shows with an exclamation mark as follows and is not added to the list of DBs on the secondary instance:
I also see this message in the error log:
Unable to access availability database 'test123' because the database replica is not in the PRIMARY or SECONDARY role. Connections to an availability database is permitted only when the database replica is in the PRIMARY or SECONDARY role. Try the operation again later. Nonqualified transactions are being rolled back in database test123 for an Always On Availability Groups state change. Estimated rollback completion: 100%. This is an informational message only. No user action is required.
I'm using automatic seeding to populate the database on the secondary.
I have added the same DB to a different AG and this issue did not happen and it was added successfully.
The DB is in full recovery model and a full backup has been taken as well and it meets prerequisites. AG and listener looks fine, any ideas what can be the cause of this?