traccar not starting on a fresh installation

Alan Lobo2 years ago

I have a fresh installation of traccar on a new VM.
I changed the DB parameters as follows.

    <entry key='database.driver'>org.postgresql.Driver</entry>
    <entry key='database.url'>jdbc:postgresql://db-postgresql-xxxz-nnnnn-do-user-nnnnnn-0.db.ondigitalocean.com:25060/traccar?sslmode=require</entry>
    <entry key='database.user'>traccar</entry>
    <entry key='database.password'>xxxx</entry>`

Traccar refuses to start with the following error

ERROR: Main method error - Database is in a locked state. It could be due to early service termination on a previous launch. To unlock you can run this query: 'UPDATE DATABASECHANGELOGLOCK SET locked = 0'. Make sure the schema is up to date before unlocking the database. - DatabaseLockException (DatabaseModule:102 < <gener:-1 < *:-1 < ... < MainModule:128 < ...)
Anton Tananaev2 years ago

Have you read the error message before asking for help?

Alan Lobo2 years ago

yes. I tried looking around for answers.
The thing is that the database is fresh with no tables in it.
The table DATABASECHANGELOGLOCK doesnt exist.
My expectation is that traccar will create the entire database upon starting the service ( since I cannot find any command to manually create the tables )

Anton Tananaev2 years ago

If the database is empty, it won't give you think error.

Alan Lobo2 years ago

maybe this is a postgres bug ? unable to detect an empty database ?

Anton Tananaev2 years ago

I very much doubt it. I think the error is exactly what it says it is.

Alan Lobo2 years ago

I checked the database through a client. The public schema is empty

Alan Lobo2 years ago

can I create the data tables manually ? or run some sort of script / command to create the tables ?

Anton Tananaev2 years ago

Traccar should create everything automatically.

Alan Lobo2 years ago

after alot of debugging, it turned out that I couldnt see the tables because the database ownership was with another user.
after changing the ownership, i can now see the tables and it is working fine.

unknown8 months ago

what creds did you use to connect on mysql ? Because I am unable to connect with any known user or password

Alan Lobo8 months ago

is your mysql a local instance / installed by you / provided by some provider like amazon etc ?

unknown8 months ago

I used the default install.

On a local VM. didn't build anything my self what ever the installer did.

Thank you in advance

Anton Tananaev8 months ago

Default installation doesn't use MySQL. What makes you think that it does?

unknown8 months ago

well I get the same message ... in the logs ...

eroro 1.png