The database disappeared

Andres 3 years ago

Hello, greetings to all.

I have a question, yesterday 09-01-2022 all records from the database were deleted, it should be clarified that only I have access to it and the server.

Server 5.3
5 devices
2 GB Ram
Mysql

I found this in the Logs but I don't understand why the entire database was deleted:

2022-09-01 22:33:25  INFO: [T43b1ec16] id: 359857082361650, time: 2022-09-01 22:20:05, lat: 4.76081, lon: -74.06510, course: 0.0
2022-09-01 22:33:35  INFO: [Tf4afdcc8: gt06 < 193.152.92.108] 78780a13040503000201fa16f70d0a
...
2022-09-01 22:43:33  INFO: [T18474b33] connected
2022-09-01 22:43:33  INFO: [T18474b33: meiligao < 106.75.49.60] 16030100ee010000ea0303d44844eebdf75d18b92f4cd6f943180378e9dc67959174e048e50fd3b991345720a6129a8059dbb73b05a464fa2d3b8a729b783816be6575bfb9a13211dce982fd0026cca8cca9c02fc030c02bc02cc013c009c014c00a009c009d002f0035c012000a1303130113020100007b000500050100000000000a000a0008001d001700180019000b00020100000d001a0018080404030807080508060401050106010503060302010203ff0100010000120000002b0009080304030303020301003300260024001d002023f232aaa5e098d4408299cee142e6e10ac33c17ae9413289099d7e32bac4e30
2022-09-01 22:43:35  INFO: [Tf4afdcc8: gt06 < 193.152.92.108] 78780a13040503000201fc73c10d0a
2022-09-01 22:43:35  INFO: [Tf4afdcc8: gt06 > 193.152.92.108] 7878051301fcdc430d0a
2022-09-01 22:43:35  WARN: Update device status error - Table 'traccar.tc_devices' doesn't exist - SQLSyntaxErrorException (... < QueryBuilder:473 < DatabaseStorage:108 < ConnectionManager:282 < ...)
2022-09-01 22:43:35  WARN: Failed to store position - Table 'traccar.tc_positions' doesn't exist - SQLSyntaxErrorException (... < QueryBuilder:473 < DatabaseStorage:89 < DefaultDataHandler:45 < ...)
2022-09-01 22:43:35  WARN: Failed to update device - Table 'traccar.tc_devices' doesn't exist - SQLSyntaxErrorException (... < QueryBuilder:473 < DatabaseStorage:108 < MainEventHandler:90 < ...)
2022-09-01 22:43:35  INFO: [Tf4afdcc8] id: 359857082374323, time: 2022-09-01 22:29:06, lat: 7.87611, lon: -72.52787, course: 0.0
2022-09-01 22:43:41  INFO: [T18474b33] disconnected
2022-09-01 22:43:41  INFO: [T2d5ec5ac] connected
2022-09-01 22:43:49  INFO: [T2d5ec5ac] disconnected
2022-09-01 22:43:49  INFO: [T88c061ef] connected
2022-09-01 22:43:49  INFO: [T88c061ef: meiligao < 106.75.49.60] 5553455220616e6f6e796d6f75730d0a
2022-09-01 22:43:57  INFO: [T88c061ef] disconnected
2022-09-01 22:44:59  INFO: Operating system name: Linux version: 5.4.0-124-generic architecture: amd64
2022-09-01 22:44:59  INFO: Java runtime name: OpenJDK 64-Bit Server VM vendor: ojdkbuild version: 11.0.15+10-LTS
2022-09-01 22:45:00  INFO: Memory limit heap: 479mb non-heap: 0mb
2022-09-01 22:45:00  INFO: Character encoding: UTF-8 charset: UTF-8
2022-09-01 22:45:00  INFO: Version: 5.3
2022-09-01 22:45:00  INFO: Starting server...
2022-09-01 22:45:00  INFO: HikariPool-1 - Starting...
2022-09-01 22:45:01  WARN: Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
2022-09-01 22:45:02  INFO: HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@159e366
2022-09-01 22:45:02  INFO: HikariPool-1 - Start completed.
2022-09-01 22:45:03  INFO: Clearing database change log checksums
2022-09-01 22:45:04  INFO: Successfully acquired change log lock
2022-09-01 22:45:04  INFO: Creating database history table with name: traccar.DATABASECHANGELOG
2022-09-01 22:45:05  INFO: Successfully released change log lock
2022-09-01 22:45:05  INFO: Successfully acquired change log lock
2022-09-01 22:45:05  INFO: Cannot load service: liquibase.parser.ChangeLogParser: liquibase.parser.core.json.JsonChangeLogParser Unable to get public no-arg constructor
2022-09-01 22:45:05  INFO: Cannot load service: liquibase.parser.ChangeLogParser: liquibase.parser.core.yaml.YamlChangeLogParser Unable to get public no-arg constructor
2022-09-01 22:45:09  INFO: Reading from traccar.DATABASECHANGELOG
2022-09-01 22:45:11  INFO: Cannot load service: liquibase.hub.HubService: Provider liquibase.hub.core.StandardHubService could not be instantiated
2022-09-01 22:45:11  INFO: Table tc_attributes created
2022-09-01 22:45:11  INFO: Table tc_calendars created
...
2022-09-01 22:45:21  INFO: Columns fixedemail(BOOLEAN) added to tc_users
2022-09-01 22:45:21  INFO: Columns expirationtime(TIMESTAMP) added to tc_devices
2022-09-01 22:45:21  INFO: Table tc_keystore created
2022-09-01 22:45:21  INFO: Index idx_users_token dropped from table tc_users
2022-09-01 22:45:21  INFO: Column tc_users.token dropped
2022-09-01 22:45:21  INFO: ChangeSet changelog-5.3::changelog-5.3::author ran successfully in 327ms
2022-09-01 22:45:21  INFO: Successfully released change log lock
2022-09-01 22:45:22  INFO: Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system instability.
2022-09-01 22:45:27  INFO: jetty-10.0.7; built: 2021-10-06T19:34:02.766Z; git: da8a4553af9dd84080931fa0f8c678cd2d60f3d9; jvm 11.0.15+10-LTS
2022-09-01 22:45:28  INFO: Started o.t.w.@531ec2ca{/,null,AVAILABLE}
2022-09-01 22:45:28  INFO: Session workerName=node0
2022-09-01 22:45:28  INFO: [T9072a152] connected
2022-09-01 22:45:28  INFO: [T9072a152: gt06 < 193.152.92.108] 78780d01035985708237432301fdae880d0a
2022-09-01 22:45:28  WARN: Unknown device - 359857082374323 (193.152.92.108)
2022-09-01 22:45:29  WARN: JAXBContext implementation could not be found. WADL feature is disabled.
2022-09-01 22:45:30  INFO: [T317cb979] connected
2022-09-01 22:45:30  INFO: [T317cb979: gt06 < 95.127.172.78] 78780d010359857082361650011c87b60d0a
2022-09-01 22:45:30  WARN: Unknown device - 359857082361650 (95.127.172.78)
2022-09-01 22:45:31  INFO: Started o.e.j.s.ServletContextHandler@37ade216{/,null,AVAILABLE}
2022-09-01 22:45:31  INFO: Started ServerConnector@2cd3fc29{HTTP/1.1, (http/1.1)}{0.0.0.0:8082}
2022-09-01 22:45:31  INFO: Started Server@110620d{STARTING}[10.0.7,sto=0] @34583ms
2022-09-01 22:45:31  INFO: Health check enabled with period 480000
2022-09-01 22:45:49  INFO: [Tfab9abbe] connected
2022-09-01 22:45:49  INFO: [Tfab9abbe: gt06 < 95.127.172.85] 78780d010359857082361122005257550d0a
2022-09-01 22:45:49  WARN: Unknown device - 359857082361122 (95.127.172.85)
2022-09-01 22:45:52  INFO: [T2ae80fd5] connected
2022-09-01 22:45:52  INFO: [T2ae80fd5: gt06 < 179.18.18.93] 78780d010358899055295466004826d00d0a
2022-09-01 22:45:52  WARN: Unknown device - 358899055295466 (179.18.18.93)
2022-09-01 22:45:58  INFO: [T9072a152: gt06 < 193.152.92.108] 78780d01035985708237432301fdae880d0`
Anton Tananaev 3 years ago

What's the question? Check your MySQL logs to see who removed it. Traccar doesn't have any code that can remove the database.

Andres 3 years ago

Thanks for your prompt response Anton, you already made it clear to me that Traccar would never delete the database, I did some research and found that a thief entered and stole the database, it had the default mysql password so it was easy to access, no I have problems with this because it is only test data, so I proceed to establish security in the database.