Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARN: Column “DEVICE_ID” not found; SQL statement: #524

Closed
PascalVD opened this issue Feb 15, 2016 · 39 comments
Closed

WARN: Column “DEVICE_ID” not found; SQL statement: #524

PascalVD opened this issue Feb 15, 2016 · 39 comments

Comments

@PascalVD
Copy link

After update and follow the installation procédure i receive the following error :

WARN: Column “DEVICE_ID” not found; SQL statement:

An reveice no information about the devices ... but i see that the connection is ok and device last sync date is ok .. but no information and i don't see the "user" location.

Can you help ?

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

Could you please post the remaining log after ....SQL statement:

@PascalVD
Copy link
Author

yes of course :
2016-02-15 07:25:25 WARN: Column "DEVICE_ID" not found; SQL statement:
SELECT id, protocol, device_id AS deviceId, serverTime, time AS deviceTime, time AS fixTime,
valid, latitude, longitude, altitude, speed, course, address, other AS attributes
FROM positions WHERE id IN (SELECT latestPosition_id FROM devices); [42122-190] - JdbcSQLException (... < QueryBuilder:61 < *:131 < DataManager:323 < ConnectionManager:55 < ...)
2016-02-15 07:25:27 INFO: Starting server...
2016-02-15 07:26:52 INFO: [3BC517D0] connected

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

Make sure you have set the correct "device identifier" for your device in the traccar-web ui. In the devices panel you should the device identifier you have in your android client.

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

Also can you paste some line from your tracker-server.log that look like:

2016-02-02 00:00:18 DEBUG: [F4506315: 5001 < (IP ADDRESS-HIDDEN)] HEX: ...........

@PascalVD
Copy link
Author

yes :
2016-02-15 07:24:46 INFO: Memory limit heap: 58mb non-heap: 0mb
2016-02-15 07:24:46 INFO: Character encoding: UTF-8 charset: UTF-8
2016-02-15 07:24:46 INFO: Version: 3.2-SNAPSHOT
2016-02-15 07:25:25 WARN: Column "DEVICE_ID" not found; SQL statement:
SELECT id, protocol, device_id AS deviceId, serverTime, time AS deviceTime, time AS fixTime,
valid, latitude, longitude, altitude, speed, course, address, other AS attributes
FROM positions WHERE id IN (SELECT latestPosition_id FROM devices); [42122-190] - JdbcSQLException (... < QueryBuilder:61 < *:131 < DataManager:323 < ConnectionManager:55 < ...)
2016-02-15 07:25:27 INFO: Starting server...
2016-02-15 07:26:52 INFO: [3BC517D0] connected
2016-02-15 07:26:52 DEBUG: [3BC517D0: 8082 < 192.168.0.1] HEX: 474554202f3f69643d3737353930352674696d657374616d703d31343535353231323038266c61743d35302e3730383335333735266c6f6e3d342e31303630363138312673706565643d302e302662656172696e673d302e3026616c7469747564653d3131382e3026626174743d33342e3020485454502f312e310d0a557365722d4167656e743a2044616c76696b2f322e312e3020284c696e75783b20553b20416e64726f696420352e302e313b20534d2d4e39313046204275696c642f4c5258323243290d0a486f73743a2076642d686f6d652e64796e646e732e6f72673a383038320d0a436f6e6e656374696f6e3a204b6565702d416c6976650d0a4163636570742d456e636f64696e673a20677a69700d0a0d0a
2016-02-15 07:26:55 WARN: Unknown device - 775905 (192.168.0.1)
2016-02-15 07:27:34 INFO: [7B060194] connected

@PascalVD
Copy link
Author

the UID is the same on the device and on the interface .. i have this after follow the nest procedure
http://traccar.litvak.su/installation.html

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

OK using this hex decoder: https://www.traccar.org/hex-decoder/ I can see that the device id is: 775905. Do you have the same ID in the devices tab in the web interface?

@PascalVD
Copy link
Author

yes ... totally

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

screen shot 2016-02-15 at 17 28 50
Something like this, right?

@PascalVD
Copy link
Author

right i have that

@PascalVD
Copy link
Author

i set no speed but ID and name

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

No problem with speed. Ok then something is wrong with your SQL database. Do you have access in the sql server?

@PascalVD
Copy link
Author

yes .. phpmyadmin

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

Ok go to table positions and it should have this structure:
id bigint(20) NOT NULL AUTO_INCREMENT,
address varchar(255) DEFAULT NULL,
altitude double DEFAULT NULL,
course double DEFAULT NULL,
latitude double DEFAULT NULL,
longitude double DEFAULT NULL,
other varchar(255) DEFAULT NULL,
power double DEFAULT NULL,
protocol varchar(255) DEFAULT NULL,
serverTime datetime DEFAULT NULL,
speed double DEFAULT NULL,
time datetime DEFAULT NULL,
valid bit(1) DEFAULT NULL,
device_id bigint(20) DEFAULT NULL,
PRIMARY KEY (id),
KEY positionsIndex (device_id,time),
KEY poslon (longitude),
KEY poslat (latitude),

@PascalVD
Copy link
Author

image

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

Does this table positions has any data inside? It should have all your positions.

@PascalVD
Copy link
Author

nothing ... it's empty ..

@PascalVD
Copy link
Author

and look .. device is up-to date
image

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

OK that's not correct there should by nothing in device. OK you have to reinstall traccar-web and make sure you have followed the directions from here: http://traccar.litvak.su/installation.html

Most possibly you have make a mistake in the traccar.xml file.

@PascalVD
Copy link
Author

i reinstall all .. yes .. same problem ... can you send me your traccar.xml ? to be sure ?

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

Unfortunately no because I have made many personal modifications and it will not help you. Make sure you make the correct changes according to your traccar version. There are many differences between 3.1, 3.2 and 3.3

@PascalVD
Copy link
Author

yes ... i'm little bit confused the modification that i need to do for my version ..

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

What traccar version are you using?

@PascalVD
Copy link
Author

3.3

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

Also just to be sure have you restarted traccar service? What os do you use?

@PascalVD
Copy link
Author

rasberry "noob" yes i have restart all

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

OK just follow carefully the instructions and if you have a doubt about something you can ask me.

@PascalVD
Copy link
Author

Here the database content of my file

SELECT \* FROM server;
<entry key='database.updateServer'>
    UPDATE server SET
    registration = :registration,
    readonly = :readonly,
    map = :map,
    bingKey = :bingKey,
    mapUrl = :mapUrl,
    language = :language,
    distanceUnit = :distanceUnit,
    speedUnit = :speedUnit,
    latitude = :latitude,
    longitude = :longitude,
    zoom = :zoom
    WHERE id = :id;
</entry>

<entry key='database.loginUser'>
    SELECT * FROM users
    WHERE email = :email;
</entry>

<entry key='database.selectUser'>
    SELECT * FROM users
    WHERE id = :id;
</entry>

<entry key='database.selectUsersAll'>
    SELECT * FROM users;
</entry>

<entry key='database.insertUser'>
    INSERT INTO users (name, email, hashedPassword, salt, admin)
    VALUES (:name, :email, :hashedPassword, :salt, :admin);
</entry>

<entry key='database.updateUser'>
    UPDATE users SET
    name = :name,
    email = :email,
    admin = :admin,
    map = :map,
    language = :language,
    distanceUnit = :distanceUnit,
    speedUnit = :speedUnit,
    latitude = :latitude,
    longitude = :longitude,
    zoom = :zoom
    WHERE id = :id;
</entry>

<entry key='database.updateUserPassword'>
    UPDATE users SET hashedPassword = :hashedPassword, salt = :salt WHERE id = :id;
</entry>

<entry key='database.deleteUser'>
    DELETE FROM users WHERE id = :id;
</entry>

<entry key='database.getPermissionsAll'>
    SELECT userId, deviceId FROM user_device;
</entry>

<entry key='database.selectDevicesAll'>
    SELECT * FROM devices;
</entry>

<entry key='database.selectDevices'>
    SELECT * FROM devices d INNER JOIN user_device ud ON d.id = ud.deviceId WHERE ud.userId = :userId;
</entry>

<entry key='database.insertDevice'>
    INSERT INTO devices (name, uniqueId) VALUES (:name, :uniqueId);
</entry>

<entry key='database.updateDevice'>
    UPDATE devices SET name = :name, uniqueId = :uniqueId WHERE id = :id;
</entry>

<entry key='database.updateDeviceStatus'>
    UPDATE devices SET status = :status, lastUpdate = :lastUpdate WHERE id = :id;
</entry>

<entry key='database.deleteDevice'>
    DELETE FROM devices WHERE id = :id;
</entry>
<entry key='database.unlinkDevice'>
    DELETE FROM user_device WHERE userId = :userId AND deviceId = :deviceId;
</entry>

<entry key='database.selectPositions'>
    SELECT * FROM positions WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to ORDER BY fixTime;
</entry>
INSERT INTO positions (device_id, protocol, serverTime, time, valid, latitude, longitude, altitude, speed, course, address, other) VALUES (:deviceId, :protocol, CURRENT_TIMESTAMP(), :time, :valid, :latitude, :longitude, :altitude, :speed, :course, :address, :attributes); SELECT id, protocol, device_id AS deviceId, serverTime, time AS deviceTime, time AS fixTime, valid, latitude, longitude, altitude, speed, course, address, other AS attributes FROM positions WHERE id IN (SELECT latestPosition_id FROM devices); UPDATE devices SET latestPosition_id = :id WHERE id = :deviceId;
<!-- 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>
<entry key='meitrack.port'>5020</entry>
<entry key='skypatrol.port'>5021</entry>
<entry key='gt02.port'>5022</entry>
<entry key='gt06.port'>5023</entry>
<entry key='megastek.port'>5024</entry>
<entry key='navigil.port'>5025</entry>
<entry key='gpsgate.port'>5026</entry>
<entry key='teltonika.port'>5027</entry>
<entry key='mta6.port'>5028</entry>
<entry key='tzone.port'>5029</entry>
<entry key='tlt2h.port'>5030</entry>
<entry key='taip.port'>5031</entry>
<entry key='wondex.port'>5032</entry>
<entry key='cellocator.port'>5033</entry>
<entry key='galileo.port'>5034</entry>
<entry key='ywt.port'>5035</entry>
<entry key='tk102.port'>5036</entry>
<entry key='intellitrac.port'>5037</entry>
<entry key='gpsmta.port'>5038</entry>
<entry key='wialon.port'>5039</entry>
<entry key='carscop.port'>5040</entry>
<entry key='apel.port'>5041</entry>
<entry key='manpower.port'>5042</entry>
<entry key='globalsat.port'>5043</entry>
<entry key='atrack.port'>5044</entry>
<entry key='pt3000.port'>5045</entry>
<entry key='ruptela.port'>5046</entry>
<entry key='topflytech.port'>5047</entry>
<entry key='laipac.port'>5048</entry>
<entry key='aplicom.port'>5049</entry>
<entry key='gotop.port'>5050</entry>
<entry key='sanav.port'>5051</entry>
<entry key='gator.port'>5052</entry>
<entry key='noran.port'>5053</entry>
<entry key='m2m.port'>5054</entry>
<entry key='osmand.port'>8082</entry>
<entry key='easytrack.port'>5056</entry>
<entry key='gpsmarker.port'>5057</entry>
<entry key='khd.port'>5058</entry>
<entry key='piligrim.port'>5059</entry>
<entry key='stl060.port'>5060</entry>
<entry key='cartrack.port'>5061</entry>
<entry key='minifinder.port'>5062</entry>
<entry key='haicom.port'>5063</entry>
<entry key='eelink.port'>5064</entry>
<entry key='box.port'>5065</entry>
<entry key='freedom.port'>5066</entry>
<entry key='telik.port'>5067</entry>
<entry key='trackbox.port'>5068</entry>
<entry key='visiontek.port'>5069</entry>
<entry key='orion.port'>5070</entry>
<entry key='riti.port'>5071</entry>
<entry key='ulbotech.port'>5072</entry>
<entry key='tramigo.port'>5073</entry>
<entry key='tr900.port'>5074</entry>
<entry key='ardi01.port'>5075</entry>
<entry key='xt013.port'>5076</entry>
<entry key='autofon.port'>5077</entry>
<entry key='gosafe.port'>5078</entry>
<entry key='autofon45.port'>5079</entry>
<entry key='bce.port'>5080</entry>
<entry key='xirgo.port'>5081</entry>
<entry key='calamp.port'>5082</entry>
<entry key='mtx.port'>5083</entry>
<entry key='tytan.port'>5084</entry>
<entry key='avl301.port'>5085</entry>
<entry key='castel.port'>5086</entry>
<entry key='mxt.port'>5087</entry>
<entry key='cityeasy.port'>5088</entry>
<entry key='aquila.port'>5089</entry>
<entry key='flextrack.port'>5090</entry>
<entry key='blackkite.port'>5091</entry>
<entry key='adm.port'>5092</entry>
<entry key='watch.port'>5093</entry>
<entry key='t800x.port'>5094</entry>
<entry key='upro.port'>5095</entry>
<entry key='auru.port'>5096</entry>
<entry key='disha.port'>5097</entry>
<entry key='thinkrace.port'>5098</entry>
<entry key='pathaway.port'>5099</entry>
<entry key='arnavi.port'>5100</entry>

@PascalVD
Copy link
Author

see you somethings rong ?

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

No, can you try deleting all tables (warning this will remove your data as well) and restarting the service. This will re-create the database.

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

Also have you put this inside xml file?
<entry key='web.type'>old</entry>
<entry key='web.application'>/opt/traccar/traccar-web.war</entry>

@PascalVD
Copy link
Author

yes that's in the xml file .. ok i will delete all the db en restart

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

better keep a backup (just in case)

@PascalVD
Copy link
Author

there is no data on this server ;-)

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

yeap I mean all your settings (users, devices etc.)

@PascalVD
Copy link
Author

same problem ... any other idea ?

@vitalidze
Copy link
Owner

Try to disable default database schema creation as said here in #510, stop service, drop database and start service again.

@PascalVD
Copy link
Author

yeahh !! it work !! many thanks all and vitalidze ;-)

@gsiotas
Copy link
Contributor

gsiotas commented Feb 15, 2016

Glad to hear, you can close this now. Thanks, Vitaly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants