TraccarDB automatically deleted.

Amal Kumar3 months ago

Hello, Today suddenly my traccar service was not working and when i checked logs it was showing error as -

ERROR: Main method error - Unknown database 'traccardb' - CJException (... < DatabaseModule:79 < <gener:-1 < *:-1 < ... < MainModule:126 < ...)

Also when i checked Databases in MYSQL then traccardb was not present there.

Anton Tananaev3 months ago

Traccar does not create or delete databases.

Amal Kumar3 months ago

Then what can I do recover the error

Anton Tananaev3 months ago

Probably restore from a backup. Or create a new database.

Amal Kumar3 months ago

The database seems to have been removed after this errors.

2024-02-07 02:26:07  INFO: [T6cd1f175: gt06 > 106.209.213.203] 787805130144e5800d0a
2024-02-07 02:26:08  INFO: [T25bf0101: gt06 < 42.111.6.67] 78780a13050602000200b70e220d0a
2024-02-07 02:26:08  INFO: [T796ce479: gt06 < 42.111.7.117] 78781f12180206143807c902cdf8d0092879f000449901954613c50074fc0c35caa30d0a
2024-02-07 02:26:08  INFO: [T629b77cb: gt06 < 42.111.6.248] 78781f12180206143807cc02c1bcb40918fdc000545f019546154e00d11119d8ac290d0a
2024-02-07 02:26:09  WARN: Update device status error - Unknown database 'traccardb' - SQLSyntaxErrorException (... < QueryBuilder:469 < DatabaseStorage:115 < ConnectionManager:268 < ...)
2024-02-07 02:26:09  WARN: Update device status error - Unknown database 'traccardb' - SQLSyntaxErrorException (... < QueryBuilder:469 < DatabaseStorage:115 < ConnectionManager:268 < ...)
2024-02-07 02:26:09  WARN: Update device status error - Unknown database 'traccardb' - SQLSyntaxErrorException (... < QueryBuilder:469 < DatabaseStorage:115 < ConnectionManager:268 < ...)
2024-02-07 02:26:09  INFO: [T629b77cb] error - Unknown database 'traccardb' - SQLSyntaxErrorException (... < QueryBuilder:413 < DatabaseStorage:76 < CommandsManager:108 < ...)
2024-02-07 02:26:09  INFO: [T629b77cb] disconnected
2024-02-07 02:26:09  INFO: [T796ce479] error - Unknown database 'traccardb' - SQLSyntaxErrorException (... < QueryBuilder:413 < DatabaseStorage:76 < CommandsManager:108 < ...)
2024-02-07 02:26:09  INFO: [T796ce479] disconnected
2024-02-07 02:26:09  WARN: Event save error - Unknown database 'traccardb' - SQLSyntaxErrorException (... < QueryBuilder:469 < DatabaseStorage:95 < NotificationManager:78 < ...)
2024-02-07 02:26:09  WARN: Event save error - Unknown database 'traccardb' - SQLSyntaxErrorException (... < QueryBuilder:469 < DatabaseStorage:95 < NotificationManager:78 < ...)
Track-trace3 months ago

So, your database is gone.

If you have a backup you could restore it.

If you wonder how this could happen, you might think about a mysql user who has acces rights to delete the database. Or a system user Who has deleted it. Or might it have been a drive / system faillure which cause. Is the a way to find out what caused it ? Meaby, other server logs, or actual drive can give you more info.

Amal Kumar3 months ago

Yeah i am restoring the database but it's getting deleted again and again. I haven't even done any changes on server recently and today i am getting this error out of nowhere.

Track-trace3 months ago

Meaby enable mysql server logging if it isnt already? So you might be able to see what is happening?

Amal Kumar3 months ago

@Anton Tananaev
I tried restoring database again and again , but still somehow whole database getting deleted. Please help

Anton Tananaev3 months ago

Again, official Traccar does not delete databases.