alfio-event / alf.io

alf.io - The open source ticket reservation system for conferences, trade shows, workshops, meetups
https://alf.io
GNU General Public License v3.0
1.4k stars 346 forks source link

violates foreign key constraint when deleting an event #1320

Closed iCodr8 closed 7 months ago

iCodr8 commented 8 months ago

Describe the bug I want do delete an event and get an error.

To Reproduce Delete an event.

This is the log, when I want to delete an event Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "ticket_field_configuration" violates foreign key constraint "ticket_field_value_ticket_field_configuration_id_fk_fkey" on table "ticket_field_value" Detail: Key (id)=(13) is still referenced from table "ticket_field_value". at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2565) ~[postgresql-42.2.25.jar:42.2.25] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2297) ~[postgresql-42.2.25.jar:42.2.25] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:322) ~[postgresql-42.2.25.jar:42.2.25] at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:481) ~[postgresql-42.2.25.jar:42.2.25] at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:401) ~[postgresql-42.2.25.jar:42.2.25] at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:164) ~[postgresql-42.2.25.jar:42.2.25] at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:130) ~[postgresql-42.2.25.jar:42.2.25] at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) ~[HikariCP-4.0.3.jar:?] at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) ~[HikariCP-4.0.3.jar:?] at org.springframework.jdbc.core.JdbcTemplate.lambda$update$2(JdbcTemplate.java:965) ~[spring-jdbc-5.3.18.jar:5.3.18] at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:651) ~[spring-jdbc-5.3.18.jar:5.3.18] ... 135 more

syjer commented 8 months ago

hi @iCodr8 , could you specify which version are you using?

iCodr8 commented 8 months ago

We are using this docker image tag: https://hub.docker.com/layers/alfio/alf.io/2.0-M4-2304/images/sha256-68c386350f9a4a15d9670ac6bf56d379ab818f929dbf32bd80aca491fac21658?context=explore

syjer commented 8 months ago

@iCodr8 thank you for the information, I've fixed this specific problem, it will be available in the new release.