3.8 installation error

MoroccoDev7 years ago

i want to install traccar 3.8 on a ubunto server, i changed the traccar.xml to support mysql database and i create an empty db

traccar.xml :

<properties>

    <entry key="config.default">./conf/default.xml</entry>

<entry key="database.driver">com.mysql.jdbc.Driver</entry>
    <entry key="database.dataSource">com.mysql.jdbc.jdbc2.optional.MysqlDataSource</entry>
    <entry key="database.url">jdbc:mysql://localhost/xxxxxx?allowMultiQueries=true&amp;autoReconnect=true</entry>
    <entry key='database.user'>xxxxx</entry>
    <entry key='database.password'>xxxxxxx</entry>
</properties>

i have this exception when creating database :

INFO|1553/0|Service traccar|17-09-27 22:20:45|SEVERE 9/27/17 10:20 PM: liquibase: ./schema/changelog-master.xml: changelog-3.3::changelog-3.3::author: Change Set changelog-3.3::changelog-3.3::author failed.  Error: Invalid default value for 'devicetime' [Failed SQL: CREATE TABLE trakini.positions (id INT AUTO_INCREMENT NOT NULL, protocol VARCHAR(128) NULL, deviceid INT NOT NULL, servertime timestamp NOT NULL, devicetime timestamp NOT NULL, fixtime timestamp NOT NULL, valid BIT(1) NOT NULL, latitude DOUBLE NOT NULL, longitude DOUBLE NOT NULL, altitude FLOAT NOT NULL, speed FLOAT NOT NULL, course FLOAT NOT NULL, address VARCHAR(512) NULL, attributes VARCHAR(4096) NOT NULL, CONSTRAINT PK_POSITIONS PRIMARY KEY (id))]
INFO|1553/0|Service traccar|17-09-27 22:20:45|INFO 9/27/17 10:20 PM: liquibase: changelog-3.3::changelog-3.3::author: Successfully released change log lock
INFO|1553/0|Service traccar|17-09-27 22:20:45|java.lang.reflect.InvocationTargetException
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at java.lang.reflect.Method.invoke(Method.java:498)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at org.rzo.yajsw.app.WrapperJVMMain.executeMain(WrapperJVMMain.java:60)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at org.rzo.yajsw.app.WrapperJVMMain.main(WrapperJVMMain.java:43)
INFO|1553/0|Service traccar|17-09-27 22:20:45|Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set changelog-3.3::changelog-3.3::author:
INFO|1553/0|Service traccar|17-09-27 22:20:45|     Reason: liquibase.exception.DatabaseException: Invalid default value for 'devicetime' [Failed SQL: CREATE TABLE trakini.positions (id INT AUTO_INCREMENT NOT NULL, protocol VARCHAR(128) NULL, deviceid INT NOT NULL, servertime timestamp NOT NULL, devicetime timestamp NOT NULL, fixtime timestamp NOT NULL, valid BIT(1) NOT NULL, latitude DOUBLE NOT NULL, longitude DOUBLE NOT NULL, altitude FLOAT NOT NULL, speed FLOAT NOT NULL, course FLOAT NOT NULL, address VARCHAR(512) NULL, attributes VARCHAR(4096) NOT NULL, CONSTRAINT PK_POSITIONS PRIMARY KEY (id))]
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:619)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at liquibase.Liquibase.update(Liquibase.java:214)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at liquibase.Liquibase.update(Liquibase.java:192)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at liquibase.Liquibase.update(Liquibase.java:188)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at org.traccar.database.DataManager.initDatabaseSchema(DataManager.java:142)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at org.traccar.database.DataManager.<init>(DataManager.java:68)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at org.traccar.Context.init(Context.java:167)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at org.traccar.Main.main(Main.java:35)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	... 6 more
INFO|1553/0|Service traccar|17-09-27 22:20:45|Caused by: liquibase.exception.DatabaseException: Invalid default value for 'devicetime' [Failed SQL: CREATE TABLE trakini.positions (id INT AUTO_INCREMENT NOT NULL, protocol VARCHAR(128) NULL, deviceid INT NOT NULL, servertime timestamp NOT NULL, devicetime timestamp NOT NULL, fixtime timestamp NOT NULL, valid BIT(1) NOT NULL, latitude DOUBLE NOT NULL, longitude DOUBLE NOT NULL, altitude FLOAT NOT NULL, speed FLOAT NOT NULL, course FLOAT NOT NULL, address VARCHAR(512) NULL, attributes VARCHAR(4096) NOT NULL, CONSTRAINT PK_POSITIONS PRIMARY KEY (id))]
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:309)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:113)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1277)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1259)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:582)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	... 15 more
INFO|1553/0|Service traccar|17-09-27 22:20:45|Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Invalid default value for 'devicetime'
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at com.mysql.jdbc.Util.getInstance(Util.java:408)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2503)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:839)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:739)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:307)
INFO|1553/0|Service traccar|17-09-27 22:20:45|	... 20 more

PS : i have a database backup for the same version 3.8 but also i have a different exception when i try to excute

help plz

thanks

Anton Tananaev7 years ago

Why do you want to install an old version?

MoroccoDev7 years ago

i have an other server windows (PROD) and im trying migration to ubunto server so i can upgrade after

FYI i already try to install v3.14 with an existing database v3,8 but im having exceptions

Anton Tananaev7 years ago

Can I see the database URL that you are using?

MoroccoDev7 years ago
jdbc:mysql://localhost/traccar?allowMultiQueries=true&autoReconnect=true
Anton Tananaev7 years ago

That's exactly what's causing your problem.

What is the reason for not using officially recommended configuration?

https://www.traccar.org/mysql/

MoroccoDev7 years ago

sorry antony , i used the same url in prod im going to change booth of them

thanks so much

MoroccoDev7 years ago

when installing new instance it's ok now, but if i use existing database i receive this exception :

INFO|4853/0|Service traccar|17-09-28 07:22:04|INFO 9/28/17 7:22 AM: liquibase: ./schema/changelog-master.xml: changelog-3.7::changelog-3.7::author: Data updated in groups
INFO|4853/0|Service traccar|17-09-28 07:22:04|SEVERE 9/28/17 7:22 AM: liquibase: ./schema/changelog-master.xml: changelog-3.7::changelog-3.7::author: Change Set changelog-3.7::changelog-3.7::author failed.  Error: Duplicate column name 'attributes' [Failed SQL: ALTER TABLE trakini.devices ADD attributes VARCHAR(4096) NULL]
INFO|4853/0|Service traccar|17-09-28 07:22:04|INFO 9/28/17 7:22 AM: liquibase: changelog-3.7::changelog-3.7::author: Successfully released change log lock
INFO|4853/0|Service traccar|17-09-28 07:22:04|java.lang.reflect.InvocationTargetException
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at java.lang.reflect.Method.invoke(Method.java:498)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at org.rzo.yajsw.app.WrapperJVMMain.executeMain(WrapperJVMMain.java:60)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at org.rzo.yajsw.app.WrapperJVMMain.main(WrapperJVMMain.java:43)
INFO|4853/0|Service traccar|17-09-28 07:22:04|Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set changelog-3.7::changelog-3.7::author:
INFO|4853/0|Service traccar|17-09-28 07:22:04|     Reason: liquibase.exception.DatabaseException: Duplicate column name 'attributes' [Failed SQL: ALTER TABLE trakini.devices ADD attributes VARCHAR(4096) NULL]
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:619)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at liquibase.Liquibase.update(Liquibase.java:214)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at liquibase.Liquibase.update(Liquibase.java:192)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at liquibase.Liquibase.update(Liquibase.java:188)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at org.traccar.database.DataManager.initDatabaseSchema(DataManager.java:142)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at org.traccar.database.DataManager.<init>(DataManager.java:68)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at org.traccar.Context.init(Context.java:167)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at org.traccar.Main.main(Main.java:35)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	... 6 more
INFO|4853/0|Service traccar|17-09-28 07:22:04|Caused by: liquibase.exception.DatabaseException: Duplicate column name 'attributes' [Failed SQL: ALTER TABLE trakini.devices ADD attributes VARCHAR(4096) NULL]
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:309)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:113)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1277)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1259)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:582)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	... 15 more
INFO|4853/0|Service traccar|17-09-28 07:22:04|Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate column name 'attributes'
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at com.mysql.jdbc.Util.getInstance(Util.java:408)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2503)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:839)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:739)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:307)
INFO|4853/0|Service traccar|17-09-28 07:22:04|	... 20 more
INFO|wrapper|Service traccar|17-09-28 07:22:05|waitpid 4853 59136
INFO|wrapper|Service traccar|17-09-28 07:22:05|exit code posix process: 59136 application: 0
MoroccoDev7 years ago

why changelog detect difference in databases version but its the same

MoroccoDev7 years ago

RESOLVED

On Unix, table names are case sensitive. On Windows, they are not. Fun, isn't it?

and traccar have create DATABASECHANGELOG and DATABASECHANGELOGLOCK in capital letter so he duplicate creation in ubunto server and reexecute all scripts