Forum

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    EndCrawler Guest

    Solved SERVER: Removing clients without deleting group entries

    CRITICAL BUG! THIS CAN DESTROY YOUR DATABASE!

    BUG IN: Server
    BUG NAME: Removing clients without deleting group entries
    BUG ENVIRONMENT:
    • System: Ubuntu 12.04.3 LTS (vServer, using OpenVZ)
    • TS3-Server: 3.0.10.2 (using MySQL)
    • MySQL Permissions: ALL (NOT: GRANT, CREATE TEMPORARY TABLES, LOCK TABLES)




    BUG DESCRIPTION:
    Is seems like the server didn't delete group entries for the user from the table "group_server_to_client" when the client was deleted from the "clients" table with TeamSpeak (not manuallly!). If you want to list all clients from a server group and this group owns one of the "dead" entries, the client will throw out a "invalid CLIENTID()" error and you will see no clients.

    HOW I FIX IT:
    You have to enter your MySQL Admin Panel and execute the following command (stop your server before):
    You have to change "USE teamspeak;" to your database. (e.g.: "USE mytsdatabase;")

    LIST ALL DEAD ENTRIES
    Code:
    USE teamspeak;
    SELECT * FROM group_server_to_client WHERE id1 NOT IN (SELECT client_id FROM teamspeak.clients);
    DELETE THIS ENTRIES
    Code:
    USE teamspeak;
    DELETE FROM group_server_to_client WHERE id1 NOT IN (SELECT client_id FROM teamspeak.clients);

    FOR DEVS:
    Why does this bug appears? I didn't delete any user from the database with mysql admin cp. Only with TS3-Client.
    Is this a "ONE-TIME" bug or a global problem?

  2. #2
    Join Date
    April 2011
    Location
    Germany
    Posts
    1,248
    Can't reproduce... I deleted some clients without removing them from server groups and their group membership was cleanly deleted. Did you, just maybe, against all comon sense add a client to the "admin sever query" group and then deleted this client?!

  3. #3
    EndCrawler Guest
    Quote Originally Posted by Barungar View Post
    Can't reproduce... I deleted some clients without removing them from server groups and their group membership was cleanly deleted. Did you, just maybe, against all comon sense add a client to the "admin sever query" group and then deleted this client?!
    No. I have checked that before. There was no dead entrie for those groups and only I am able to assign query (with console) and i didn't do this. It was a normal member, because this affected normal clans groups on my server.

  4. #4
    Join Date
    June 2011
    Location
    Germany
    Posts
    3,121
    I can confirm this bug. I had this on SQLite.

  5. #5
    Join Date
    April 2011
    Location
    Germany
    Posts
    1,248
    Strange, I delete clients a lot and never remove them from their server groups ahead of deletion. Today I deleted about 10 clients. And never did such a situation occur on any server I use.

  6. #6
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,370
    I could not reproduce this error... Please copy and paste the contents of the following file:

    Code:
    /path/to/ts3server/sql/client_delete.sql
    It should look like this:

    Code:
    delete from clients where client_id=:client_id:;
    delete from client_properties where id=:client_id:;
    delete from messages where message_to_client_id=:client_id:;
    delete from complains where complain_to_client_id=:client_id:;
    delete from group_channel_to_client where id1=:client_id:;
    delete from group_server_to_client where id1=:client_id:;
    delete from perm_client where id1=:client_id:;
    delete from perm_channel_clients where id2=:client_id:;
    delete from custom_fields where client_id=:client_id:;

  7. #7
    EndCrawler Guest
    I know how to use SQL and I don't have any bug like this. But I think this appears if you edit servergroup options and delete clients at the same times. This locks the tables maybe so different "entries" will not be deleted.

    WHAT does TeamSpeak say?

  8. #8
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,370
    Quote Originally Posted by EndCrawler View Post
    I know how to use SQL and I don't have any bug like this. But I think this appears if you edit servergroup options and delete clients at the same times. This locks the tables maybe so different "entries" will not be deleted.

    WHAT does TeamSpeak say?
    I'm still unable to reproduce the error on my end... and I've tested the server on any platform available (Windows, OS X, Linux and FreeBSD) with both SQLite and MySQL backends. I've been using the latest server release (3.0.10.2) with clean installations.

    Have you guys modified the value for the max number of db connections (defaults to 10)?
    Are you running multiple server instances running the same database?

    The only thing I can imagine causing this... well... the statements in the client_delete.sql file I pasted above will delete the entry from the clients table before deleting the depending stuff from other tables. Could this be a very rare timing issue limited to some systems/configs? I'm assuming that SQL statements from the same file are executed in a single step tho... so this shouldn't be a table locking issue.

  9. #9
    Join Date
    April 2011
    Location
    Germany
    Posts
    1,248
    Quote Originally Posted by ScP View Post
    The only thing I can imagine causing this... well... the statements in the client_delete.sql file I pasted above will delete the entry from the clients table before deleting the depending stuff from other tables.
    Viewed in terms of the database there is no depending stuff. client_id is only primary key in the clients table, to all other tables client_id is a simple field not part of a combined key or even a key by itself.

  10. #10
    EndCrawler Guest
    I only run 1 database but i have changed the nunber of connections

  11. #11
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,370
    Quote Originally Posted by Barungar View Post
    Viewed in terms of the database there is no depending stuff. client_id is only primary key in the clients table, to all other tables client_id is a simple field not part of a combined key or even a key by itself.
    I know how relational databases work... thank you.



    Quote Originally Posted by EndCrawler View Post
    I only run 1 database but i have changed the nunber of connections
    Have you tried restoring the default value for that setting? Does the crash happen every single time for you?
    Last edited by ScP; December 25th, 2013 at 08:37 PM.

  12. #12
    Join Date
    June 2008
    Posts
    14,586
    We can not reproduce that a user wasn't deleted from the database.
    When sending me private messages: Please make sure to include reference link to your forum thread or post.

    TeamSpeak FAQ || What should i report, when i open a client thread? ||NPL (Registration)

  13. #13
    Join Date
    June 2011
    Location
    Germany
    Posts
    3,121
    I had this after deploying a snapshot on (=overwriting) a server. One user wasn't deleted from Admin Server Query. I know, I mustn't do that, but I'm doing it on my own risk.

  14. #14
    Join Date
    June 2008
    Posts
    14,586
    *sigh* nothing we do support at all.
    I put that on my to test list, to see what is happeing there.
    When sending me private messages: Please make sure to include reference link to your forum thread or post.

    TeamSpeak FAQ || What should i report, when i open a client thread? ||NPL (Registration)

  15. #15
    EndCrawler Guest
    Maybe it will appear if the database connection is not stable.
    An idea: You can collect all "clean" scripts and run them every time the TS starts.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [No Bug] [BUG] Removing clients from server group query.
    By hunterpl in forum Bug Reports [EN/DE]
    Replies: 4
    Last Post: October 29th, 2014, 07:07 AM
  2. Removing a server group
    By ermluca in forum Tools / Web Based
    Replies: 1
    Last Post: November 26th, 2013, 06:57 AM
  3. Replies: 0
    Last Post: June 28th, 2011, 01:59 AM
  4. [No bugs] Some context menu entries disabled on telnet clients
    By Stefan1200 in forum Bug Reports [EN/DE]
    Replies: 2
    Last Post: August 16th, 2010, 12:01 PM
  5. Are you sure? When removing clients from groups ;-)
    By jashan in forum Suggestions and Feedback
    Replies: 5
    Last Post: January 9th, 2010, 10:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •