-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permission denied when creating schema for primary/replicas #9556
Labels
Comments
Experienced this issue as well. Schema tool is trying to execute statements on replicas (which are in read-only mode in my setup). It should only be executed on primary only. |
+1 |
Same issue with "php bin/console doctrine:schema:update" since update form doctrine 2.3 to 2.8. |
+1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Summary
Creating the schema from the command line fails if a primary/replica configuration is used.
SQL commands are sent to the replica instead of the primary db.
The culprit is SchemaTool
It executes CREATE statements with
executeQuery($sql)
instead ofexecuteStatement($sql)
.Current behavior
Creating the schema fails due to CREATE statement being denied on replica. The replica is read only. The schema can't be created on the replica.
How to reproduce
Unless you have two db servers configured as master/slave, the setup can be replicated on a single db server. Create a R/W user to simulate the primary and a R/O user with SELECT permission to simulate the replica.
Run the command:
Expected behavior
SQL CREATE statements must be sent to the primary.
CREATE statements are not queries. SchemaTool must call
executeStatement($sql)
.The text was updated successfully, but these errors were encountered: