I cant connect to Traccar after Mysql migration

Anton Tananaev7 years ago

Your config is incorrect. Next time please read official documentation before asking for help on the forum:

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

Sandram7 years ago

Anton,

Would you Point out where is incorrect , so I stop chasing my tail please .

Thanks in advance

Sandra

chserguei7 years ago

As I see there are some mistakes in logs
Here is log

...
INFO|wrapper|Service traccar|17-07-05 23:55:36|posix_spawn pid 8619
INFO|wrapper|Service traccar|17-07-05 23:55:36|started process 8619
INFO|wrapper|Service traccar|17-07-05 23:55:36|started process with pid 8619
INFO|8619/0|Service traccar|17-07-05 23:55:43|[INFO] StandardFileSystemManager - Using "/tmp/vfs_cache" as temporary files store.
INFO|8619/0|Service traccar|17-07-05 23:55:45|java.lang.reflect.InvocationTargetException
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at java.lang.reflect.Method.invoke(Method.java:606)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at org.rzo.yajsw.app.WrapperJVMMain.executeMain(WrapperJVMMain.java:60)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at org.rzo.yajsw.app.WrapperJVMMain.main(WrapperJVMMain.java:43)
INFO|8619/0|Service traccar|17-07-05 23:55:45|Caused by: java.util.InvalidPropertiesFormatException: org.xml.sax.SAXParseException; lineNumber: 31; columnNumber: 14; The content of element type "properties" must match "(comment?,entry*)".
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at java.util.XMLUtils.load(XMLUtils.java:76)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at java.util.Properties.loadFromXML(Properties.java:868)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at org.traccar.Config.load(Config.java:30)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at org.traccar.Context.init(Context.java:195)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at org.traccar.Main.main(Main.java:35)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	... 6 more
INFO|8619/0|Service traccar|17-07-05 23:55:45|Caused by: org.xml.sax.SAXParseException; lineNumber: 31; columnNumber: 14; The content of element type "properties" must match "(comment?,entry*)".
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:1994)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:879)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1776)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2964)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:504)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:338)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at java.util.XMLUtils.getLoadingDoc(XMLUtils.java:102)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	at java.util.XMLUtils.load(XMLUtils.java:74)
INFO|8619/0|Service traccar|17-07-05 23:55:45|	... 10 more
INFO|wrapper|Service traccar|17-07-05 23:55:45|waitpid 8619 59136
INFO|wrapper|Service traccar|17-07-05 23:55:45|exit code posix process: 59136 application: 0
deep7 years ago

@Sandram - Please check if in traccar.xml the values below are the same as yours and replace whatever is necesary! Also check http://127.0.0.1:8082 which is http://localhost:8082 as well!

<entry key='database.driver'>com.mysql.jdbc.Driver</entry> 
<entry key='database.url'>jdbc:mysql://[HOST]:3306/[DATABASE]?allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
<entry key='database.user'>[USER]</entry> 
<entry key='database.password'>[PASSWORD]</entry>
Anton Tananaev7 years ago

@chserguei, you are trying to use invalid XML as a config. Error message clearly tell you where the problem is in the file.

chserguei7 years ago

Sorry, but I did changes only in traccar.xml. Here it is

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>

<properties>

    <!--

    This is the main configuration file. All your configuration parameters should be placed in this file.

    Default configuration parameters are located in the "default.xml" file. You should not modify it to avoid issues
    with upgrading to a new version. Parameters in the main config file override values in the default file. Do not
    remove "config.default" parameter from this file unless you know what you are doing.

    For list of available parameters see following page: https://www.traccar.org/configuration-file/

    -->

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

    <entry key='database.driver'>com.mysql.jdbc.Driver</entry> 
    <entry key='database.url'>jdbc:mysql://localhost:3306/traccar?allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
    <entry key='database.user'>traccar</entry> 
    <entry key='database.password'>123456</entry>

</properties>

Nothing else

Anton Tananaev7 years ago

Check error message and check the line from the error message.

Sandram7 years ago

Gents,
This is the error I got , But I dont know which file to Edit

INFO|5132/0|Service traccar|17-07-06 23:59:19|Caused by: org.xml.sax.SAXParseException; lineNumber: 28; columnNumber: 14; The content of element type "properties" must match "(comment?,entry*)".

SM

Anton Tananaev7 years ago

Obviously it's an error in the file that you have modified yourself.

Sandram7 years ago

I did some editing , here my latest Wrapper log :

...
INFO|5792/0|Service traccar|17-07-07 00:20:39|INFO 7/7/17 12:20 AM: liquibase: changelog-3.3::changelog-3.3::author: Successfully released change log lock
INFO|5792/0|Service traccar|17-07-07 00:20:39|java.lang.reflect.InvocationTargetException
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at java.lang.reflect.Method.invoke(Method.java:498)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at org.rzo.yajsw.app.WrapperJVMMain.executeMain(WrapperJVMMain.java:60)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at org.rzo.yajsw.app.WrapperJVMMain.main(WrapperJVMMain.java:43)
INFO|5792/0|Service traccar|17-07-07 00:20:39|Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set changelog-3.3::changelog-3.3::author:
INFO|5792/0|Service traccar|17-07-07 00:20:39|     Reason: liquibase.exception.DatabaseException: Table 'users' already exists [Failed SQL: CREATE TABLE Traccer.users (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(128) NOT NULL, email VARCHAR(128) NOT NULL, hashedpassword VARCHAR(128) NOT NULL, salt VARCHAR(128) NOT NULL, readonly BIT(1) DEFAULT 0 NOT NULL, admin BIT(1) DEFAULT 0 NOT NULL, map VARCHAR(128) DEFAULT 'osm' NOT NULL, language VARCHAR(128) DEFAULT 'en' NOT NULL, distanceunit VARCHAR(128) DEFAULT 'km' NOT NULL, speedunit VARCHAR(128) DEFAULT 'kmh' NOT NULL, latitude DOUBLE DEFAULT 0 NOT NULL, longitude DOUBLE DEFAULT 0 NOT NULL, zoom INT DEFAULT 0 NOT NULL, CONSTRAINT PK_USERS PRIMARY KEY (id))]
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:619)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at liquibase.Liquibase.update(Liquibase.java:214)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at liquibase.Liquibase.update(Liquibase.java:192)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at liquibase.Liquibase.update(Liquibase.java:188)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at org.traccar.database.DataManager.initDatabaseSchema(DataManager.java:145)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at org.traccar.database.DataManager.<init>(DataManager.java:71)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at org.traccar.Context.init(Context.java:207)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at org.traccar.Main.main(Main.java:35)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	... 6 more
INFO|5792/0|Service traccar|17-07-07 00:20:39|Caused by: liquibase.exception.DatabaseException: Table 'users' already exists [Failed SQL: CREATE TABLE Traccer.users (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(128) NOT NULL, email VARCHAR(128) NOT NULL, hashedpassword VARCHAR(128) NOT NULL, salt VARCHAR(128) NOT NULL, readonly BIT(1) DEFAULT 0 NOT NULL, admin BIT(1) DEFAULT 0 NOT NULL, map VARCHAR(128) DEFAULT 'osm' NOT NULL, language VARCHAR(128) DEFAULT 'en' NOT NULL, distanceunit VARCHAR(128) DEFAULT 'km' NOT NULL, speedunit VARCHAR(128) DEFAULT 'kmh' NOT NULL, latitude DOUBLE DEFAULT 0 NOT NULL, longitude DOUBLE DEFAULT 0 NOT NULL, zoom INT DEFAULT 0 NOT NULL, CONSTRAINT PK_USERS PRIMARY KEY (id))]
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:309)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:113)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1277)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1259)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:582)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	... 15 more
INFO|5792/0|Service traccar|17-07-07 00:20:39|Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'users' already exists
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at com.mysql.jdbc.Util.getInstance(Util.java:408)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2497)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2455)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:839)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:739)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:307)
INFO|5792/0|Service traccar|17-07-07 00:20:39|	... 20 more
INFO|wrapper|Service traccar|17-07-07 00:20:39|waitpid 5792 59136
INFO|wrapper|Service traccar|17-07-07 00:20:39|exit code posix process: 59136 application: 0
Anton Tananaev7 years ago

Your database is not empty. It already has some tables.

Sandram7 years ago

Anton,
Yes it has, However I still cant connect to //myip:8082/ So MSQL is out of question I think.
I have tried with MariaDB , tables are there as it should but I cant connect //myip:8082/ as well.

at myip/phpmyadmin/db_structure.php?server=1&db=Traccer&token=11fd8e82555beb91da550adc46add2e4
I see all tables correctly

    DATABASECHANGELOG	 	Browse Browse	Structure Structure	Search Search	Insert Insert	Empty Empty	Drop Drop	0	InnoDB	latin1_swedish_ci	16 KiB	-
    DATABASECHANGELOGLOCK	 	Browse Browse	Structure Structure	Search Search	Insert Insert	Empty Empty	Drop Drop	1	InnoDB	latin1_swedish_ci	16 KiB	-
    devices	 	Browse Browse	Structure Structure	Search Search	Insert Insert	Empty Empty	Drop Drop	0	InnoDB	latin1_swedish_ci	16 KiB	-
    users	 	Browse Browse	Structure Structure	Search Search	Insert Insert	Empty Empty	Drop Drop	0	InnoDB	latin1_swedish_ci	16 KiB	-
    user_device	 	Browse Browse	Structure Structure	Search Search	Insert Insert	Empty Empty	Drop Drop	0	InnoDB	latin1_swedish_ci	48 KiB	-
5 tables	Sum	1	InnoDB	latin1_swedish_ci	112 KiB	0 B

Unfortunately for me I'm swimming in unknown waters. In my opinion you know where to fix the issue since day one and sincerely I learnt a lot since you are trying to teach me to Fish instead of give me the fish. I really appreciate your time and support but my issue why I cant access to //myip:8082/ is still and I need to know where or what to edit.
I won't give up :)

Sincerely Sandra M

Anton Tananaev7 years ago

You should clear the database and start over.

Tabaru7 years ago

Database tables also should be UTF-8.