liquibase: Waiting for changelog lock

cybero8 years ago

Hello all,

I stopped the server and then started it, using stopDaemon.sh and startDaemon.sh and now my Traccar server does not work.

I've seen this solution here: https://github.com/tananaev/traccar/issues/2047

They say to apply this fix:

update DATABASECHANGELOGLOCK
set locked = 0

But I've never worked before with liquibase and I don't know how and where write those 2 commands.

Can anyone help me please?

If I delete "database.trace.db" and " database.mv.db" and then start traccar server than everything is working, but this is not a solution for me, because I don't want to lose all my data and configurations.

Anton Tananaev8 years ago

Have you checked the logs to see why server doesn't start? If the problem is that database is locked then it probably means that you stopped service in the middle of the update and the database is likely in an invalid state. The easiest option is to restore it from backup and start service again. If you don't have a backup, the only option is to manually fix the database. You can only do if you have some SQL knowledge, but from your comment it doesn't seem like it's the case.

cybero8 years ago

I know SQL, but I've always worked with MySQL Server and phpmyadmin to manage my databases.
Never worked with liquibase before, so I don't know how to get a console into this db, or which software do I have to use to manage and modify this db.

Anton Tananaev8 years ago

You are comparing apples and oranges. Liquibase is not a database, it's just a library that helps to create and update database schema.

sisal6 years ago

Just in case anyone else gets here because this is google #1 result for traccar liquibase: Waiting for changelog lock only to find that it does not really help, here you go:
Liquibase is not the database, its kinda the language that descibes the database and how to use it. You delete the lock in whatever backend you chose.

You connect to your DB of personal choice and run the command mentioned in post 1. If you use MySQL or MariaDB:

sis@web01:~$ mysql -utraccar -p traccar
Enter password:
...
MariaDB [traccar]> update DATABASECHANGELOGLOCK set locked = 0;
Query OK, 1 rows affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [traccar]>
Castillo6 years ago

Thanks you very much @sisal, it works!

gberron6 years ago

Thanks, it works

Enrique Luis 5 years ago

@sisal
Thank you very much, it works

Dean Longstaff5 years ago
update DATABASECHANGELOGLOCK set locked = 0;

Worked for me too in MySQL, thanks!

Crystian3 years ago

FIXED Waiting for changelog lock
Thanks @sisal . I got the same error and solved it adding some more things as follows.
I have Traccar 4.14 and Installed on a Droplet in Digital Ocean. Since I followed the the video https://www.youtube.com/watch?v=mnF4aqN8NQM 'Install Traccar on DigitalOcean VPS' I had different user and password for the database so I did this:

$ mysql -u root -p

Then the password is 'root' as well
To see the list of databases and choose traccar

mysql> SHOW DATABASES;   
mysql> use traccar;

Finally from post 1 and exit to leave mysql

mysql> update DATABASECHANGELOGLOCK set locked = 0;
mysql> exit

Then

$ sudo systemctl stop traccar
$ sudo systemctl restart mysql
$ sudo systemctl start traccar

Thank you very much, it worked.

Aakansha3 years ago

Thankyou it worked
for Postgres

update DATABASECHANGELOGLOCK set locked = false;
David2 years ago

Lo puse solucionar, muchas gracias ;

update DATABASECHANGELOGLOCK set locked = false;
Nelson2 years ago
update DATABASECHANGELOGLOCK set locked = 0;

Works for me, Funciona para mi