WARN: Unknown device on a linux docker server install

andi2 years ago

I am receiving following errors:

2022-09-18 22:13:21  INFO: [Tb894e4e2] connected
2022-09-18 22:13:21  INFO: [Tb894e4e2: osmand < 205.200.15.29] 504f5354202f3f69643d2532303132333435362674696d657374616d703d31363633353238343030266c61743d34342e33393433303737266c....
2022-09-18 22:13:21  WARN: Unknown device -  123456 (205.200.15.29)
2022-09-18 22:13:21  INFO: [Tb894e4e2: osmand > 205.200.15.29] 485454502f312e31203430302042616420526571756573740d0a636f6e74656e742d6c656e6774683a20300d0a0d0a
2022-09-18 22:18:21  INFO: [Tb894e4e2] disconnected

The device Tb894e4e2 is an android phone using Traccar Client v6.17 with Device Identifier set to 123456
The device is registered on the server in drivers section on the server web portal.
It is also visible in the mariaDB:

[traccar_db]> SELECT * FROM `tc_drivers` where id=4;
+----+---------+----------+------------+
| id | name    | uniqueid | attributes |
+----+---------+----------+------------+
|  4 | Android | 123456   | {}         |
+----+---------+----------+------------+

I have tried to use phone IMEI as ID but the result is the same.
I have tried embedded H2 database initially and got this error. Then I configured mariaDB database to see if it is some problem with the embedded H2 DB and Docker. But error persists with mariaDB too.

I used Traccar in the past without docker and I had no issue with the same android phone.

Long story short:
-I receive "WARN: Unknown device".
-The device data is not logged on the database.
-The ID is configured in drivers list and it's the same as on Android traccar app.
-Network connectivity exists.
-Trafic is decoded correctly with HexDecoder in the format:

POST /?id=%20123456×tamp=1663528711&lat=xx.yyyyyyy&lon=xx.yyyyyyy&speed=0.0&bearing=0.0&altitude=121.70000457763672&accuracy=20.0&batt=49.0 HTTP/1.1
Content-Type: application/x-www-form-urlencoded
User-Agent: Dalvik/2.1.0 (Linux; U; Android 10; Redmi Note 8 Pro MIUI/V12.0.1.0.QGGIDXM)
Host: mydomain.com:5055
Connection: Keep-Alive
Accept-Encoding: gzip
Content-Length: 0

Then the reply is 
HTTP/1.1 400 Bad Request
content-length: 0

What could be the problem?

Anton Tananaev2 years ago

Have you registered the device before configuring it? That might be the problem.

andi2 years ago

I have added the a device name and it's ID in the web portal first, then I configured Traccar client device identifier on the phone and started the service in Traccar Client. I hope registering the device means to add it's ID in the drivers list.

Anton Tananaev2 years ago

Yes, but the error means that you haven't added it.

Anton Tananaev2 years ago

I see that you have an extra space in your id. That's probably the issue.

andi2 years ago

Now i stopped the service on the phone. Removed all IDs from server's driver list. Added a new one with ID 9842474.
Then I stopped the docker container. Restarted the docker container.
Then set the phone ID to 9842474 and started the phone service.
I still receive the unknown device warning.
There are some errors(info only) on the docker start:

2022-09-19 01:53:16  INFO: Stopping server...
2022-09-19 01:53:20  INFO: Operating system name: Linux version: 5.4.0-125-generic architecture: amd64
2022-09-19 01:53:20  INFO: Java runtime name: OpenJDK 64-Bit Server VM vendor: Alpine version: 11.0.16+8-alpine-r0
2022-09-19 01:53:20  INFO: Memory limit heap: 1024mb non-heap: 0mb
2022-09-19 01:53:20  INFO: Character encoding: UTF-8 charset: UTF-8
2022-09-19 01:53:20  INFO: Version: 5.3
2022-09-19 01:53:20  INFO: Starting server...
2022-09-19 01:53:20  INFO: HikariPool-1 - Starting...
2022-09-19 01:53:20  INFO: HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@6105f8a3
2022-09-19 01:53:20  INFO: HikariPool-1 - Start completed.
2022-09-19 01:53:20  INFO: Clearing database change log checksums
2022-09-19 01:53:21  INFO: Successfully acquired change log lock
2022-09-19 01:53:21  INFO: Successfully released change log lock
2022-09-19 01:53:21  INFO: Successfully acquired change log lock
2022-09-19 01:53:21  INFO: Cannot load service: liquibase.parser.ChangeLogParser: liquibase.parser.core.json.JsonChangeLogParser Unable to get public no-arg constructor
2022-09-19 01:53:21  INFO: Cannot load service: liquibase.parser.ChangeLogParser: liquibase.parser.core.yaml.YamlChangeLogParser Unable to get public no-arg constructor
2022-09-19 01:53:22  INFO: Reading from traccar_db.DATABASECHANGELOG
2022-09-19 01:53:22  INFO: Reading from traccar_db.DATABASECHANGELOG
2022-09-19 01:53:22  INFO: Cannot load service: liquibase.hub.HubService: Provider liquibase.hub.core.StandardHubService could not be instantiated
2022-09-19 01:53:22  INFO: Successfully released change log lock
2022-09-19 01:53:23  INFO: jetty-10.0.7; built: 2021-10-06T19:34:02.766Z; git: da8a4553af9dd84080931fa0f8c678cd2d60f3d9; jvm 11.0.16+8-alpine-r0
2022-09-19 01:53:23  INFO: Started o.t.w.@205159dc{/,null,AVAILABLE}
2022-09-19 01:53:23  INFO: Session workerName=node0
2022-09-19 01:53:24  WARN: JAXBContext implementation could not be found. WADL feature is disabled.
2022-09-19 01:53:24  INFO: Started o.e.j.s.ServletContextHandler@6aadb092{/,null,AVAILABLE}
2022-09-19 01:53:24  INFO: Started ServerConnector@66d3b881{HTTP/1.1, (http/1.1)}{0.0.0.0:8082}
2022-09-19 01:53:24  INFO: Started Server@36d697ab{STARTING}[10.0.7,sto=0] @4576ms
2022-09-19 01:53:24  WARN: No systemd support - Unable to load library 'systemd':
Error loading shared library libsystemd.so: No such file or directory
Error loading shared library libsystemd.so: No such file or directory
Native library (linux-x86-64/libsystemd.so) not found in resource path (tracker-server.jar) - UnsatisfiedLinkError (... < TaskHealthCheck:49 < <gener:-1 < *:-1 < ... < ScheduleManager:42 < ...)
2022-09-19 01:53:35  INFO: [T28fe6b14] connected
2022-09-19 01:53:35  INFO: [T28fe6b14: osmand < 205.200.15.29] 
2022-09-19 01:53:35  WARN: Unknown device - 9842474 (205.200.15.29) 504f5354202f3f69643d393834323437342674696d657374616d703d31363633353430373637266c61743d....
2022-09-19 01:53:35  INFO: [T28fe6b14: osmand > 205.200.15.29] 485454502f312e31203430302042616420526571756573740d0a636f6e74656e742d6c656e6774683a20300d0a0d0a
SELECT * FROM `tc_drivers`;
+----+------------+----------+------------+
| id | name       | uniqueid | attributes |
+----+------------+----------+------------+
|  6 | martin Mi8 | 9842474  | {}         |
+----+------------+----------+------------+
Anton Tananaev2 years ago

Wait. Why are you looking at the drivers table in the database instead of devices?

andi2 years ago

All tc_device_* tables are empty. No records there.
It's not the drivers page (http://205.200.10.24:8082/settings/drivers) where you register your device IDs?
Maybe I miss-understood how to register a new device. I have read all documentation available.

Anton Tananaev2 years ago

Drivers are not devices obviously. Devices are on the main screen. There's an add button there.

andi2 years ago

My fault. I did it the right way now and it works. Thank you!