Skip to content
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

Channel Listener SQL Error: a foreign key constraint fails #6283

Open
Silmerias opened this issue Dec 16, 2023 · 6 comments
Open

Channel Listener SQL Error: a foreign key constraint fails #6283

Silmerias opened this issue Dec 16, 2023 · 6 comments
Labels
bug A bug (error) in the software server

Comments

@Silmerias
Copy link

Silmerias commented Dec 16, 2023

Description

Murmur crashed with an SQL error after a while. It is related to channel listener see log.

QMYSQL3: Unable to execute statement
Cannot add or update a child row: a foreign key constraint fails

Steps to reproduce

  • Create a temporary channel
  • Create a listener

Mumble version

1.5.517

Mumble component

Server

OS

Linux

Reproducible?

Yes

Additional information

This is from a database that is 10 years old.
Murmur did the SQL update at first startup.

Relevant log output

<F>2023-12-15 22:12:55.025 SQL Error [INSERT INTO `channel_listeners` (`server_id`, `user_id`, `channel_id`) VALUES (?, ?, ?)]: Cannot add or update a child row: a foreign key constraint fails (`mydatabase`.`channel_listeners`, CONSTRAINT `channel_listeners_del_channel` FOREIGN KEY (`server_id`, `channel_id`) REFERENCES `channels` (`server_id`, `channel_id`) ON DELETE CASCADE) QMYSQL3: Unable to execute statement
!! 12/15/23 22:12:55.026 error: communicator not destroyed during global destruction.

Screenshots

No response

@Silmerias Silmerias added bug A bug (error) in the software triage This issue is waiting to be triaged by one of the project members labels Dec 16, 2023
@Krzmbrzl
Copy link
Member

It seems like a non-existing channel was referenced. However, without a repro this is not really actionable for us and since the DB Backend has been entirely rewritten in #6263 I'll have to assume that the underlying issue has been fixed by that.

@Krzmbrzl Krzmbrzl reopened this Dec 16, 2023
@Krzmbrzl Krzmbrzl added server and removed triage This issue is waiting to be triaged by one of the project members labels Dec 16, 2023
@Silmerias
Copy link
Author

Ok, I'll update if this happen again.

@Silmerias
Copy link
Author

Silmerias commented Dec 16, 2023

@Krzmbrzl ok we found the issue, 100% reproductible.

Steps to reproduce:

  • Create a temporary channel
  • Create a listener

@Hartmnt
Copy link
Member

Hartmnt commented Dec 31, 2023

I can not reproduce this with a 1.5.517 server/client and a Sqlite database.

So this issue either only occurs with the current mysql driver, or something else has to be true to trigger this bug.

@Krzmbrzl
Copy link
Member

Krzmbrzl commented Jan 2, 2024

I can not reproduce this with a 1.5.517 server/client and a Sqlite database.

SQLite doesn't enfore foreign key constraints by default due to backwards compatibility issues (iirc their first implementation had a bug that prevented checking and then they decided to keep it that way to not break existing tables). Thus, you'll never see a foreign key constraint error with Mumble's current DB implementation.

However, with the new implementation foreign key checks for SQLite are enabled as well.

@Silmerias thank you very much for the repro. I'll ensure that the issue will by fixed in the new DB impl!

@Silmerias
Copy link
Author

Silmerias commented Jan 5, 2024

I sould have mentioned this is happening with the MySQL driver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug (error) in the software server
Projects
None yet
Development

No branches or pull requests

3 participants