pact-foundation / pact_broker

Enables your consumer driven contracts workflow
http://pactflow.io
MIT License
708 stars 177 forks source link

Mysql error publishing contracts #678

Closed spekdrum closed 3 months ago

spekdrum commented 6 months ago

Hi,

We are getting this error trying to publish contracts:

Cause: Mysql2::Error: You can't specify target table 'integrations' for update in FROM clause

This error seems to be related to a Mysql limitation described here. So, maybe Pact Broker is doing any query not fully compatible with mysql when working in "mysql mode".

        env:
        - name: PACT_BROKER_DATABASE_ADAPTER
          value: mysql2

Using:

This is happening in a shared environment we have, running Pact container. I tried to reproduce this error locally, dumping the database, etc. But I'm unable to reproduce it. I even tried deleting the integration related with the application in our shared enviroment but the error still happens.

YOU54F commented 3 months ago

Hey, we support mysql anymore, as of 2021

You'll note in the documentation

MySQL was supported for the native Ruby application until around 2021, but the official pactfoundation/pact-broker Docker image does not support it. New features will not be optimised for MySQL, and some new features may not even be supported on it (eg. the database clean feature).

We do test the ruby gem with mysql, but an older version, only for backwards compatibility reasons

https://github.com/pact-foundation/pact_broker/blob/master/docker-compose-ci-mysql.yml

The pact-broker docker image docs dropped recommendations in 2021

https://github.com/pact-foundation/pact-broker-docker/commit/e9b819b9c73a4ca39fc5c3aab6c4c1831fefed09