Statistics report returns empty

Primtek 8 years ago

Hello,

Why statistics report returns empty? (eg. 2018-03-01 to 2018-03-09), I checked another reports and they work properly, so I believe there are data.

where can I enable this feature? or is it a bug?

thanks

Anton Tananaev 8 years ago

Statistics is saved once a day. If your server is not running 24 hours a day you won't get it. You also won't get correct numbers if you restart the server.

Primtek 8 years ago

Hi,
the server runs 24x7 but I will ask my staff also not to restart the Traccar service today, will check this tomorrow , get back to you then.
thanks

Primtek 8 years ago

Hi..
its empty..
I check /logs/tracker-server .. it shown as follow:

2018-03-13 08:02:14  WARN: Incorrect syntax near the keyword 'statistics'. - SQLServerException (... < QueryBuilder:477 < DataManager:451 < StatisticsManager:65 < ...)

and /logs/tracker-server.log-20180312

2018-03-12 08:03:10  INFO: [CFE83CB3] connected
2018-03-12 08:03:10 DEBUG: [CFE83CB3: 5055 < 10.100.100.5] HEX: 504f5354202f3f69643d63616138326265333839626630396166266c61743d2d362e31353230303231266c6f6e3d3130362e363939323739362674696d657374616d703d323031382d30332d313225323030383a30333a31362668646f703d3026616c7469747564653d302673706565643d302661636375726163793d32382e333430303030313532353837392668656164696e673d30266c6f636174696f6e3d2d362e313532303032312c3130362e3639393237393620485454502f312e310d0a417574686f72697a6174696f6e3a204261736963206157356d62304277636d6c74644756726332397364584e70626d52764c6d4e76625470535957686863326c684c6934354f444d774953453d0d0a436f6e74656e742d547970653a206170706c69636174696f6e2f782d7777772d666f726d2d75726c656e636f6465640d0a486f73743a206770732e6d7477692e636f2e69643a353035350d0a782d6d732d726571756573742d726f6f742d69643a2039333530623862322d343730616435663239346564383037630d0a782d6d732d726571756573742d69643a207c39333530623862322d343730616435663239346564383037632e0d0a526571756573742d49643a207c39333530623862322d343730616435663239346564383037632e0d0a436f6e74656e742d4c656e6774683a20300d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a0d0a
2018-03-12 08:03:11 DEBUG: [CFE83CB3: 5055 > 10.100.100.5] HEX: 485454502f312e3120323030204f4b0d0a436f6e74656e742d4c656e6774683a20300d0a0d0a
2018-03-12 08:03:12  WARN: Incorrect syntax near the keyword 'statistics'. - SQLServerException (... < QueryBuilder:477 < DataManager:451 < StatisticsManager:65 < ...)

Windows 2008 R2 Std x64
SQL Server 2014 Std x64

Primtek 8 years ago

looks typo in sql command... cmiiw

Anton Tananaev 8 years ago

Looks like it's a reserved keyword in MS SQL server:

https://docs.microsoft.com/en-us/sql/t-sql/language-elements/reserved-keywords-transact-sql

You would need to override SQL query in the configuration file and add quoting around the keyword.

Primtek 8 years ago

noted .. so I could see the result tomorrow... what time the statistics running?

Anton Tananaev 8 years ago

It should record around midnight (local server time).

Primtek 8 years ago

still not working..

my /conf/

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

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

<properties>

    <!-- SERVER CONFIG -->

    <entry key='web.enable'>true</entry>
    <entry key='web.port'>8082</entry>
    <entry key='web.path'>./web</entry>
    <entry key='web.cacheControl'>max-age=3600,public</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'>./logs/tracker-server.log</entry>

    <entry key='event.enable'>true</entry>
    <entry key='processing.computedAttributes.enable'>true</entry>

    <entry key='media.path'>./media</entry>

    <!--
	<entry key='server.statistics'>https://www.traccar.org/analytics/</entry>
	-->

    <!-- DATABASE CONFIG -->

    <entry key='database.ignoreUnknown'>true</entry>

    <entry key='database.generateQueries'>true</entry>

    <entry key='database.changelog'>./schema/changelog-master.xml</entry>
 
    <entry key='database.loginUser'>
        SELECT * FROM users
        WHERE email = :email OR login = :email
    </entry>

    <entry key='database.selectPositions'>
        SELECT * FROM positions WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to ORDER BY fixTime
    </entry>

    <entry key='database.selectLatestPositions'>
        SELECT positions.* FROM positions INNER JOIN devices ON positions.id = devices.positionid;
    </entry>

    <entry key='database.updateLatestPosition'>
        UPDATE devices SET positionId = :id WHERE id = :deviceId
    </entry>

    <entry key='database.selectEvents'>
        SELECT * FROM events WHERE deviceId = :deviceId AND serverTime BETWEEN :from AND :to ORDER BY serverTime
    </entry>

    <entry key='database.deletePositions'>
        DELETE FROM positions WHERE serverTime &lt; :serverTime AND id NOT IN (SELECT positionId FROM devices WHERE positionId IS NOT NULL)
    </entry>

    <entry key='database.deleteEvents'>
        DELETE FROM events WHERE serverTime &lt; :serverTime
    </entry>

    <entry key='database.selectStatistics'>
        SELECT * FROM 'statistics' WHERE captureTime BETWEEN :from AND :to ORDER BY captureTime
    </entry>

    <!-- PROTOCOL CONFIG -->

    <entry key='gps103.port'>5001</entry>
    ...
    <entry key='t57.port'>5155</entry>

</properties>

/logs/tracker-server

2018-03-15 03:26:54  INFO: Shutting down server...
2018-03-15 03:30:20  INFO: Operating system name: Windows Server 2008 R2 version: 6.1 architecture: amd64
2018-03-15 03:30:20  INFO: Java runtime name: Java HotSpot(TM) 64-Bit Server VM vendor: Oracle Corporation version: 25.161-b12
2018-03-15 03:30:20  INFO: Memory limit heap: 3591mb non-heap: 0mb
2018-03-15 03:30:20  INFO: Character encoding: UTF-8 charset: UTF-8
2018-03-15 03:30:20  INFO: Version: 3.15-SNAPSHOT
2018-03-15 03:30:34  INFO: Starting server...
2018-03-15 03:30:37 DEBUG: Clearing history earlier than 2018-03-12 03:30:37

are those causing it?..
my server would automatically do recycling on 03AM

need your advice

thanks

Anton Tananaev 8 years ago

Do you have any data on your server? If there are no messages from device or requests from user you won't get anything.