Traccar 4.6 - Could not acquire change log lock - Multiple LOCKED

T_ps 6 years ago

Hi there,
I have found a really good GPS solution here. But I am failed to install 4.6 version at my linux machine. I followed the installation instructions and I am getting following error:

root@GpsDev:~# tail -f /opt/traccar/logs/tracker-server.log 
2019-12-02 11:52:48  INFO: SELECT `LOCKED` FROM traccar.DATABASECHANGELOGLOCK WHERE ID=1
2019-12-02 11:52:48  INFO: Waiting for changelog lock....
2019-12-02 11:52:58  INFO: SELECT `LOCKED` FROM traccar.DATABASECHANGELOGLOCK WHERE ID=1
2019-12-02 11:52:58  INFO: Waiting for changelog lock....
2019-12-02 11:53:08  INFO: SELECT `LOCKED` FROM traccar.DATABASECHANGELOGLOCK WHERE ID=1
2019-12-02 11:53:08  INFO: Waiting for changelog lock....
2019-12-02 11:53:18  INFO: SELECT `LOCKED` FROM traccar.DATABASECHANGELOGLOCK WHERE ID=1
2019-12-02 11:53:18  INFO: Waiting for changelog lock....
2019-12-02 11:53:28  INFO: SELECT ID,`LOCKED`,LOCKGRANTED,LOCKEDBY FROM traccar.DATABASECHANGELOGLOCK WHERE ID=1
2019-12-02 11:53:28 ERROR: Main method error - Could not acquire change log lock.  Currently locked by 2607:fcd0:100:4600:0:0:5:4690%eth0 (2607:fcd0:100:4600:0:0:5:4690%eth0) since 12/2/19, 6:55 AM - LockException (... < DataManager:310 < *:90 < Context:292 < Main:110 < ...)

Can you tell me solution for this problem and I tried to search on forum but they could not resolve it?

Anton Tananaev 6 years ago

Have you tried searching forum? It has been discussed many times.

T_ps 6 years ago

@Anton, I am using mysql database as **"traccar"**and I set it to "update traccar.DATABASECHANGELOGLOCK set locked = 0;" as I had seen in a forum answer results. But it did not resolve it. Can you mention forum link what the solution is for this problem?

Anton Tananaev 6 years ago

Your query looks correct.

chuflo326 6 years ago

@T_ps que version de Linux estas utilizando? y que distro?

T_ps 6 years ago

Hi @Anton,
I tried with above MySQL query but it did not resolve it. And server was got hung up after sometime cause of CPU 99% usage.

Hey @chuflo326,
I am using Ubuntu 19.04. And please use english.

chuflo326 6 years ago

@T_ps I spend exactly the same with version 19 and 18 of ubuntu, so I used ubuntu server 16.04 again, some incompatibility must be found, because I did not find a solution. I reinstalled version 16.04 and version 4.6 of traccar and everything works fine

Anton Tananaev 6 years ago

It has nothing to do with Linux version.

T_ps 6 years ago

Hi,
I have solved by this query -> UPDATE traccar.DATABASECHANGELOGLOCK SET LOCKED=FALSE WHERE ID=1;.
And one more thing is that I had 512MB RAM in my VPS and I upgraded it to 1GB (After resolving DATABASECHANGELOGLOCK problem, it was being hung up and giving Hikari-pool Error: Thread starvation) because it was using more than 300MB memory so the resource allocation was the problem for this also.

I found out it needs at least 1GB RAM for thread starvation problem. Now it is working well.

Castillo 6 years ago

Thank you @T_ps, it works!

I did:

sudo mysql -u root -p
use traccarDB;
UPDATE traccarDB.DATABASECHANGELOGLOCK SET LOCKED=FALSE WHERE ID=1;

To future visitors.... This thread is useful too:
https://www.traccar.org/forums/topic/how-to-remove-lock-databasechangeloglock-default-h2-database/