GTS database doesn't get eventdata

Chris100149 years ago

Hello,

I installed Traccar together with the GTS database. And it worked well for a long time. But since today I didn't get event data into my db. The Traccar Client for Android shows sucesfull positionupdates in status. But I didn't receive them in the db. I already restarted Traccar and my whole server.
Do you have any hint for my, how to find the failure? I didn't change anything in my installation since it worked the last time.

Best Regrads,
Chris

Anton Tananaev9 years ago

Have you checked server logs?

Chris100149 years ago

Which server logs could I check?
I found following logs, but no tracker-server.log from today except the wrapper.log.20160516 where I can see the restart of traccar.

-rw-r--r-- 1 root root    647 Mar 23  2015 tracker-server.log
-rw-r--r-- 1 root root 117174 Mar 17  2015 tracker-server.log.20150317
-rw-r--r-- 1 root root 353850 Mar 18  2015 tracker-server.log.20150318
-rw-r--r-- 1 root root   1042 Mar 19  2015 tracker-server.log.20150319
-rw-r--r-- 1 root root    902 Mar 20  2015 tracker-server.log.20150320
-rw-r--r-- 1 root root    222 Mar 21  2015 tracker-server.log.20150321
-rw-r--r-- 1 root root   3036 Mar 22  2015 tracker-server.log.20150322
-rw-r--r-- 1 root root   4166 Mar 17  2015 wrapper.log.20150317
-rw-r--r-- 1 root root   7175 Mar 18  2015 wrapper.log.20150318
-rw-r--r-- 1 root root   1227 Mar 23  2015 wrapper.log.20150323
-rw-r--r-- 1 root root   2026 Aug  4  2015 wrapper.log.20150804
-rw-r--r-- 1 root root   1013 Aug  6  2015 wrapper.log.20150806
-rw-r--r-- 1 root root   2026 Sep 27  2015 wrapper.log.20150927
-rw-r--r-- 1 root root   1013 Dec 21 10:24 wrapper.log.20151221
-rw-r--r-- 1 root root   1013 May  1 10:14 wrapper.log.20160501
-rw-r--r-- 1 root root   3039 May 14 18:58 wrapper.log.20160514
-rw-r--r-- 1 root root   1013 May 16 12:01 wrapper.log.20160516

Now I also checked the config wether the db is correctly configured. It is.

Chris100149 years ago

I checked tracker-server.log as described unser troubleshooting. There are only a few old entries:

2015-03-23 06:09:13 DEBUG: [5009 <- 93.120.27.62] - HEX: 6163707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
2015-03-23 06:09:14  INFO: Closing connection by disconnect
2015-03-23 09:39:54  WARN: Connection reset by peer - java.io.IOException (FileDispatcherImpl.java:-2)
2015-03-23 09:39:54  INFO: Closing connection by exception
2015-03-23 09:39:54  INFO: Closing connection by disconnect
2015-03-23 20:54:22  INFO: Shutting down server...

No current entries. I set logger.enable in config file to <true>. But nothing changed.

Anton Tananaev9 years ago

Do you see any data from your device in the tracker-server.log? The one in the comment above is malformed as far as I can tell.

Chris100149 years ago

I don't see other entries in the sever.log than these above. Do you think installing traccar again would be a good solution? If I understand right, this would not affect existing database. Am I right?

Anton Tananaev9 years ago

Reinstalling Traccar won't help. I think the issue is on the device side or maybe there is some network problem.

Chris100149 years ago

Hello again,

I'm stepped further with my investigation. It seems, that traccer doesn't run properly. So I'm now not able to start traccar. I have the following log an the current version of java. Maybe there is an incompatibility?

May 17 12:08:55 v81017 traccar[20137]: send a packet START : start
May 17 12:08:55 v81017 traccar[20137]: WrapperManager Debug: Received a packet LOW_LOG_LEVEL : 1
May 17 12:08:55 v81017 traccar[20137]: WrapperManager Debug: LowLogLevel from Wrapper is 1
May 17 12:08:55 v81017 traccar[20137]: WrapperManager Debug: Received a packet LOGFILE : ../logs/wrapper.log.20160517
May 17 12:08:55 v81017 traccar[20137]: WrapperManager Debug: Received a packet PROPERTIES : (Property Values)
May 17 12:08:55 v81017 traccar[20137]: WrapperManager Debug: Received a packet START : start
May 17 12:08:55 v81017 traccar[20137]: WrapperManager Debug: Java temporary directory: /tmp
May 17 12:08:55 v81017 traccar[20137]: WrapperManager Debug: calling WrapperListener.start()
May 17 12:08:55 v81017 traccar[20137]: WrapperManager Debug: WrapperListener.start runner thread started.
May 17 12:08:55 v81017 traccar[20137]: WrapperManager Debug: Application start main thread: WrapperListener_start_runner Priority: 5
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Debug: start(args) Will wait up to 2 seconds for the main method to complete.
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Debug: invoking main method
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp:
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Error: Encountered an error running main:
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Error: java.lang.NullPointerException
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Error: #011at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Error: #011at java.io.FileOutputStream.<init>(FileOutputStream.java:142)
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Error: #011at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Error: #011at org.apache.log4j.FileAppender.<init>(FileAppender.java:110)
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Error: #011at org.apache.log4j.DailyRollingFileAppender.<init>(DailyRollingFileAppender.java:203)
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Error: #011at org.traccar.helper.Log.setupLogger(Log.java:46)
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Error: #011at org.traccar.ServerManager.init(ServerManager.java:97)
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Error: #011at org.traccar.Main.main(Main.java:27)
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Error: #011at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Error: #011at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Error: #011at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Error: #011at java.lang.reflect.Method.invoke(Method.java:606)
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Error: #011at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:290)
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Error: #011at java.lang.Thread.run(Thread.java:745)
May 17 12:08:55 v81017 traccar[20137]: WrapperSimpleApp Debug: start(args) end.  Main Completed=true, exitCode=1
May 17 12:08:55 v81017 traccar[20137]: WrapperManager Debug: returned from WrapperListener.start()
May 17 12:08:55 v81017 traccar[20137]: WrapperManager Debug: WrapperListener.start() returned an exit code of 1.
May 17 12:08:55 v81017 traccar[20137]: WrapperManager Debug: WrapperManager.stop(1) called by thread: WrapperListener_start_runner

java version "1.7.0_76"
Java(TM) SE Runtime Environment (build 1.7.0_76-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.76-b04, mixed mode)
Chris100149 years ago

Hello Anton,

could you see something in the logs above what is wrong with my Traccar installation?

I think the tag of my question isn't wrighth anymore. Shall I make a new one with "traccar doesn't start"?
Thank you for your support so far and for the great Application. I hope I get it running again.

Anton Tananaev9 years ago

It looks like Traccar can't open a log file. There must be some file system issue.

Chris100149 years ago

Hello,

thanks for your answer. Do you think I could solve this problem with reinstalling of Traccar?

Anton Tananaev9 years ago

You can try, but I think there is some problem with your OS.

Chris100148 years ago

Hello again,

my provider told me that the filesystem of my virtuell server can't be corrupted. I don't know... so I reinstalled Traccar and now I'm able to run Traccar but I still get error messages in the status of Traccar Client for Android. But I have this log:

2016-05-24 20:50:45  INFO: Starting server...
2016-05-24 20:50:45  INFO: Operating System name: Linux version: 3.2.41-042stab113.21 architecture: amd64
2016-05-24 20:50:45  INFO: Java Runtime name: Java HotSpot(TM) 64-Bit Server VM vendor: Oracle Corporation version: 24.76-b04
2016-05-24 20:50:45  INFO: Memory Limit heap: 27234mb non-heap: 130mb
2016-05-24 20:50:45  INFO: Version: 2.11-SNAPSHOT
2016-05-24 20:50:52 DEBUG: [5055 <- 87.176.235.126] - HEX: 474554202f3f69643d3335393430353035383737303130362674696d657374616d703d31343633343738363738266c61743d34392e383634303936266c6f6e3d382e363234343334382673706565643d302e302662656172696e673d302e3026616c7469747564653d302e3026626174743d39352e3020485454502f312e310d0a557365722d4167656e743a2044616c76696b2f322e312e3020284c696e75783b20553b20416e64726f696420352e302e323b20485443204f6e65204275696c642f4c5258323247290d0a486f73743a2074726163656d79726163652e636f6d3a353035350d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a20677a69700d0a0d0a
2016-05-24 20:51:37 DEBUG: [5055 <- 87.176.235.126] - HEX: 474554202f3f69643d3335393430353035383737303130362674696d657374616d703d31343633343738363738266c61743d34392e383634303936266c6f6e3d382e363234343334382673706565643d302e302662656172696e673d302e3026616c7469747564653d302e3026626174743d39352e3020485454502f312e310d0a557365722d4167656e743a2044616c76696b2f322e312e3020284c696e75783b20553b20416e64726f696420352e302e323b20485443204f6e65204275696c642f4c5258323247290d0a486f73743a2074726163656d79726163652e636f6d3a353035350d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a20677a69700d0a0d0a
2016-05-24 20:52:22 DEBUG: [5055 <- 87.176.235.126] - HEX: 474554202f3f69643d3335393430353035383737303130362674696d657374616d703d31343633343738363738266c61743d34392e383634303936266c6f6e3d382e363234343334382673706565643d302e302662656172696e673d302e3026616c7469747564653d302e3026626174743d39352e3020485454502f312e310d0a557365722d4167656e743a2044616c76696b2f322e312e3020284c696e75783b20553b20416e64726f696420352e302e323b20485443204f6e65204275696c642f4c5258323247290d0a486f73743a2074726163656d79726163652e636f6d3a353035350d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a20677a69700d0a0d0a
2016-05-24 20:53:14 DEBUG: [5050 <- 87.176.235.126] - HEX: 474554202f3f69643d3335393430353035383737303130362674696d657374616d703d31343633343738363738266c61743d34392e383634303936266c6f6e3d382e363234343334382673706565643d302e302662656172696e673d302e3026616c7469747564653d302e3026626174743d39352e3020485454502f312e310d0a557365722d4167656e743a2044616c76696b2f322e312e3020284c696e75783b20553b20416e64726f696420352e302e323b20485443204f6e65204275696c642f4c5258323247290d0a486f73743a2074726163656d79726163652e636f6d3a353035300d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a20677a69700d0a0d0a
2016-05-24 20:53:59 DEBUG: [5050 <- 87.176.235.126] - HEX: 474554202f3f69643d3335393430353035383737303130362674696d657374616d703d31343633343738363738266c61743d34392e383634303936266c6f6e3d382e363234343334382673706565643d302e302662656172696e673d302e3026616c7469747564653d302e3026626174743d39352e3020485454502f312e310d0a557365722d4167656e743a2044616c76696b2f322e312e3020284c696e75783b20553b20416e64726f696420352e302e323b20485443204f6e65204275696c642f4c5258323247290d0a486f73743a2074726163656d79726163652e636f6d3a353035300d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a20677a69700d0a0d0a
2016-05-24 20:54:06  WARN: Unknown device - 359405058770106
2016-05-24 20:54:06  WARN: Unknown device - 359405058770106

tracker-server.log

Could you see whats wrong with it? I tried port 5055 and also 5050. The device is listed in the database so I don't know why it is unknown.

Best regards,
Christoph

Anton Tananaev8 years ago

If you see "Unknown device" message in the log, it means that Traccar couldn't find your device in the database. You must be missing something.

Chris100148 years ago

Hello Anton,

I installed the newest Traccar Version 3.5. And now the traccar server is up and running again.:-)
I changed and copied the parts for gts database in traccar.xml. But the server seems not to be connected to my gts db. Below you see my traccar.xml (I filled in user, password etc. in the file on my server). Do I have to change anything else? Does Traccar 3.5 work together with an already existing gts database?

Best regards,
Chris

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

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

<properties>

    <!-- SERVER CONFIG -->

    <entry key='web.enable'>false</entry>
    <entry key='web.port'>8082</entry>
    <entry key='web.path'>/opt/traccar/web</entry>

    <entry key='geocoder.enable'>true</entry>
    <entry key='geocoder.type'>google</entry>

    <entry key='logger.enable'>true</entry>
    <entry key='logger.level'>all</entry>
    <entry key='logger.file'>/opt/traccar/logs/tracker-server.log</entry>

    <!-- DATABASE CONFIG -->

    <entry key='database.driver'>com.mysql.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql://localhost:3306/[database]?allowMultiQueries=true</entry>
    <entry key='database.user'>[username]</entry>
    <entry key='database.password'>[password]</entry>

    <entry key='database.selectDevicesAll'>
        SELECT CONCAT('1', imeiNumber) AS id, imeiNumber AS uniqueId FROM Device WHERE imeiNumber REGEXP '^[0-9]+$';
    </entry>

    <entry key='database.insertPosition'>
        START TRANSACTION;
            UPDATE Device SET lastValidLatitude = :latitude, lastValidLongitude = :longitude, lastGPSTimestamp = UNIX_TIMESTAMP(:fixTime), lastUpdateTime = UNIX_TIMESTAMP(NOW()) WHERE imeiNumber = SUBSTRING(CAST(:deviceId AS CHAR(32)), 2);
            SELECT @accountID := accountID, @deviceID := deviceID FROM Device WHERE imeiNumber = SUBSTRING(CAST(:deviceId AS CHAR(32)), 2);
            INSERT INTO EventData (accountID, deviceID, timestamp, statusCode, latitude, longitude, speedKPH, heading, altitude, rawData, creationTime, address)
            VALUES (@accountID, @deviceID, UNIX_TIMESTAMP(:fixTime), 0, :latitude, :longitude, :speed * 1.852, :course, :altitude, '', UNIX_TIMESTAMP(NOW()), :address);
        COMMIT;
    </entry>

    <!-- PROTOCOL CONFIG -->

    <entry key='gps103.port'>5001</entry>
    <entry key='tk103.port'>5002</entry>
    <entry key='gl100.port'>5003</entry>
    <entry key='gl200.port'>5004</entry>
    <entry key='t55.port'>5005</entry>
    <entry key='xexun.port'>5006</entry>
    <entry key='xexun.extended'>false</entry>
    <entry key='totem.port'>5007</entry>
    <entry key='enfora.port'>5008</entry>
    <entry key='meiligao.port'>5009</entry>
    <entry key='trv.port'>5010</entry>
    <entry key='suntech.port'>5011</entry>
    <entry key='progress.port'>5012</entry>
    <entry key='h02.port'>5013</entry>
    <entry key='jt600.port'>5014</entry>
    <entry key='huabao.port'>5015</entry>
    <entry key='v680.port'>5016</entry>
    <entry key='pt502.port'>5017</entry>
    <entry key='tr20.port'>5018</entry>
    <entry key='navis.port'>5019</entry>