Installation via ansible - possible connection errors - but nothing in logs

David Cole2 years ago

I'm trying to move to an ansible based implementation with a restore on a backup.

I have it deploying and as far as I can tell all my config come out the same as my old running system. With the user and db password and conneciton string.

this was the log after I deleted the traccar db, it looks like it's connecting and creating a new one:

2022-06-09 21:51:59  INFO: HikariPool-1 - Starting...
2022-06-09 21:52:05 ERROR: HikariPool-1 - Exception during pool initialization. - Unknown database 'traccar' - CJException (... < DataManager:120 < *:79 < Context:307 < Main:113 < ...)
2022-06-09 21:52:05 ERROR: Main method error - Unknown database 'traccar' - CJException (... < DataManager:120 < *:79 < Context:307 < Main:113 < ...)
2022-06-09 21:52:10  INFO: HikariPool-1 - Starting...
2022-06-09 21:52:15 ERROR: HikariPool-1 - Exception during pool initialization. - Unknown database 'traccar' - CJException (... < DataManager:120 < *:79 < Context:307 < Main:113 < ...)
2022-06-09 21:52:15 ERROR: Main method error - Unknown database 'traccar' - CJException (... < DataManager:120 < *:79 < Context:307 < Main:113 < ...)
2022-06-09 21:52:20  INFO: HikariPool-1 - Starting...
2022-06-09 21:52:26 ERROR: HikariPool-1 - Exception during pool initialization. - Unknown database 'traccar' - CJException (... < DataManager:120 < *:79 < Context:307 < Main:113 < ...)
2022-06-09 21:52:26 ERROR: Main method error - Unknown database 'traccar' - CJException (... < DataManager:120 < *:79 < Context:307 < Main:113 < ...)
2022-06-09 21:52:31  INFO: HikariPool-1 - Starting...
2022-06-09 21:52:37 ERROR: HikariPool-1 - Exception during pool initialization. - Unknown database 'traccar' - CJException (... < DataManager:120 < *:79 < Context:307 < Main:113 < ...)
2022-06-09 21:52:37 ERROR: Main method error - Unknown database 'traccar' - CJException (... < DataManager:120 < *:79 < Context:307 < Main:113 < ...)
2022-06-09 21:52:42  INFO: HikariPool-1 - Starting...
2022-06-09 21:52:43  INFO: HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@f316aeb
2022-06-09 21:52:43  INFO: HikariPool-1 - Start completed.
2022-06-09 21:52:44  INFO: Clearing database change log checksums
2022-06-09 21:52:45  INFO: Successfully acquired change log lock
2022-06-09 21:52:45  INFO: Creating database history table with name: traccar.DATABASECHANGELOG
2022-06-09 21:52:47  INFO: Successfully released change log lock
2022-06-09 21:52:47  INFO: Successfully acquired change log lock

I do see this down the bottom:

2022-06-09 21:54:50  INFO: Starting server...
2022-06-09 21:54:52  INFO: jetty-10.0.7; built: 2021-10-06T19:34:02.766Z; git: da8a4553af9dd84080931fa0f8c678cd2d60f3d9; jvm 11.0.15+10-alpine-r0
2022-06-09 21:54:52  INFO: Started o.t.w.@636dbfe7{/,null,AVAILABLE}
2022-06-09 21:54:53  INFO: Session workerName=node0
2022-06-09 21:54:53  WARN: JAXBContext implementation could not be found. WADL feature is disabled.
2022-06-09 21:54:54  INFO: Started o.e.j.s.ServletContextHandler@7f1ad846{/,null,AVAILABLE}
2022-06-09 21:54:54  INFO: Started ServerConnector@43f9dd56{HTTP/1.1, (http/1.1)}{0.0.0.0:8082}
2022-06-09 21:54:54  INFO: Started Server@69e2fe3b{STARTING}[10.0.7,sto=0] @134180ms
2022-06-09 21:54:54  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:41 < ScheduleManager:33 < Main:127 < ...)

But both the moder and legacy UI I see a 404 not found error.
And on legacy if I go to http://server:8085/ it brings up a login page at http://server:8085/modern/login......but if I refresh I get a 404.
Is there something setting a subpage? I'm missing.

I turned on web.console and web.debug, but the http://server:8085/debug gets a spinning wheel. Anywhere else I can look? Or get some idea in the logs as to what has an error?

Anton Tananaev2 years ago

If you get 404, it means that the server is running.

but if I refresh I get a 404

That's expected. It will be fixed in the next release.

David Cole2 years ago

oh thanks. I assume then I can just force the previous docker image version to continue my testing of deployment?

Anton Tananaev2 years ago

If refresh issue bothers you, then yes, you probably need to revert. Or you can use a version from master.

David Cole2 years ago

this error stops me from logging on or rendering the screen. Are we talking about the same thing?

On legacy, once i clear the 404 error, I just get a spinning wheel. With nothing else.
https://imgur.com/a/HyTSsmS

And as per installation instructions, on modern (where i can see a login screen) I tried admin/admin and get a user/password not found.

Anton Tananaev2 years ago

Based on your original comment you didn't switch to legacy app. If you get redirected to "modern".

David Cole2 years ago

when I say I switched to legacy, on top right is the circular arrows that says switch to legacy app

Anton Tananaev2 years ago

And it still redirects to "modern"? Maybe it makes more sense for you to make a screen recording to fully understand what the issue is. And also URL for your server would be helpful to check.

David Cole2 years ago

Ok so I had it wrong. Going to my url (which is behind a pfsense machine - and I port forward 8085 to the docker container where 8085 forwards to 8082 - sorry don't ask...... hop all that's not causing the problem) - but going to my url is trying legacy.

https://imgur.com/a/kyqRqma

Then if I hit the "use modern interface" it takes me to a login page, where I try admin/admin and get an unuthorised error.
in the DB its just the default use:

+----+-------+-------+--------------------------------------------------+--------------------------------------------------+--------------------+------------------------------+------+----------+-----------+------+------------------------------------+------------+------------------+--------------------+----------------+-------------+-------+-----------+--------------------------------+-------+------------------------------+-------+----------+--------------------------------+
| id | name  | email | hashedpassword                                   | salt                                             | readonly           | administrator                | map  | latitude | longitude | zoom | twelvehourformat                   | attributes | coordinateformat | disabled           | expirationtime | devicelimit | token | userlimit | devicereadonly                 | phone | limitcommands                | login | poilayer | disablereports                 |
+----+-------+-------+--------------------------------------------------+--------------------------------------------------+--------------------+------------------------------+------+----------+-----------+------+------------------------------------+------------+------------------+--------------------+----------------+-------------+-------+-----------+--------------------------------+-------+------------------------------+-------+----------+--------------------------------+
|  1 | admin | admin | D33DCA55ABD4CC5BC76F2BC0B4E603FE2C6F61F4C1EF2D47 | 000000000000000000000000000000000000000000000000 | 0x00               | 0x01                         | NULL |        0 |         0 |    0 | 0x00                               | NULL       | NULL             | 0x00               | NULL           |          -1 | NULL  |         0 | 0x00                           | NULL  | 0x00                         | NULL  | NULL     | 0x00                           |
+----+-------+-------+--------------------------------------------------+--------------------------------------------------+--------------------+------------------------------+------+----------+-----------+------+------------------------------------+------------+------------------+--------------------+----------------+-------------+-------+-----------+--------------------------------+-------+------------------------------+-------+----------+--------------------------------+

here's all I see in teh traccar-server.log

2022-06-09 22:07:10  INFO: Shutting down server...
2022-06-09 22:07:15  INFO: HikariPool-1 - Starting...
2022-06-09 22:07:16  INFO: HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@f316aeb
2022-06-09 22:07:16  INFO: HikariPool-1 - Start completed.
2022-06-09 22:07:17  INFO: Clearing database change log checksums
2022-06-09 22:07:18  INFO: Successfully acquired change log lock
2022-06-09 22:07:19  INFO: Successfully released change log lock
2022-06-09 22:07:19  INFO: Successfully acquired change log lock
2022-06-09 22:07:19  INFO: Cannot load service: liquibase.parser.ChangeLogParser: liquibase.parser.core.json.JsonChangeLogParser Unable to get public no-arg constructor
2022-06-09 22:07:20  INFO: Cannot load service: liquibase.parser.ChangeLogParser: liquibase.parser.core.yaml.YamlChangeLogParser Unable to get public no-arg constructor
2022-06-09 22:07:23  INFO: Reading from traccar.DATABASECHANGELOG
2022-06-09 22:07:27  INFO: Reading from traccar.DATABASECHANGELOG
2022-06-09 22:07:27  INFO: Cannot load service: liquibase.hub.HubService: Provider liquibase.hub.core.StandardHubService could not be instantiated
2022-06-09 22:07:27  INFO: Successfully released change log lock
2022-06-09 22:07:31  INFO: Operating system name: Linux version: 5.15.30-2-pve architecture: amd64
2022-06-09 22:07:31  INFO: Java runtime name: OpenJDK 64-Bit Server VM vendor: Alpine version: 11.0.15+10-alpine-r0
2022-06-09 22:07:31  INFO: Memory limit heap: 512mb non-heap: 0mb
2022-06-09 22:07:31  INFO: Character encoding: UTF-8 charset: UTF-8
2022-06-09 22:07:31  INFO: Version: 5.0
2022-06-09 22:07:31  INFO: Starting server...
2022-06-09 22:07:33  INFO: jetty-10.0.7; built: 2021-10-06T19:34:02.766Z; git: da8a4553af9dd84080931fa0f8c678cd2d60f3d9; jvm 11.0.15+10-alpine-r0
2022-06-09 22:07:34  INFO: Started o.t.w.@4b6b5352{/,null,AVAILABLE}
2022-06-09 22:07:34  INFO: Session workerName=node0
2022-06-09 22:07:35  WARN: JAXBContext implementation could not be found. WADL feature is disabled.
2022-06-09 22:07:36  INFO: Started o.e.j.s.ServletContextHandler@520c3dcb{/,null,AVAILABLE}
2022-06-09 22:07:36  INFO: Started ServerConnector@761e788f{HTTP/1.1, (http/1.1)}{0.0.0.0:8082}
2022-06-09 22:07:36  INFO: Started Server@3d40498a{STARTING}[10.0.7,sto=0] @22548ms
2022-06-09 22:07:36  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:41 < ScheduleManager:33 < Main:127 < ...)
2022-06-09 22:08:32  WARN: /console/ - NullPointerException (...)
2022-06-09 22:09:57  WARN: /console/ - NullPointerException (...)

I followed this via the docs, as I had an older jdbc driver listed:

<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql://traccar_mysql:3306/traccar?serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false&allowMultiQueries=true&autoReconnect=true&am>    <entry key='database.user'>traccar</entry>

traccar_mqsql is the name of the server, both traccar and it's db are in the same docker network. As far as I can tell they see either other, as looking at the logs it does seem it's connecting to db.

Anton Tananaev2 years ago

Looks like some API issue.

David Cole2 years ago

more than likely due to my weird networking? ok I'll try to access from the lan side rather than through pfsense.

Anton Tananaev2 years ago

No, the error looks like something that's coming from Java.

David Cole2 years ago

so the container definition is a fairly basic one, that I copied from my existing working system. Again, I haven't downgraded that traccar version.

While I do have mysql exposed, these machines are both in the same network, so can use 3306

version: '2'

services:
  traccar:
    container_name: traccar
    image: traccar/traccar:latest
    hostname: traccar
    restart: always
    mem_limit: 600m
    labels:
      - com.centurylinklabs.watchtower.enable=true
    networks:
      - traccar
    volumes:
      - "/etc/timezone:/etc/timezone:ro"
      - "/etc/localtime:/etc/localtime:ro"
      - "/hdd/docker-data/traccar/traccar/traccar.xml:/opt/traccar/conf/traccar.xml"
      - "/hdd/docker-data/traccar/logs:/opt/traccar/logs"
    ports:
      - 8085:8082
      - 5002:5002
      - 30175:30175
      - 5055:5055
  traccar_mysql:
    container_name: traccar_mysql
    image: mysql/mysql-server
    hostname: traccardb
    mem_limit: 600m
    labels:
      - com.centurylinklabs.watchtower.enable=true
    environment:
      - MYSQL_ROOT_PASSWORD=Magicpassword
    restart: always
    networks:
      - traccar
    volumes:
      - "/etc/timezone:/etc/timezone:ro"
      - "/etc/localtime:/etc/localtime:ro"
      - "/hdd/docker-data/traccar/mysql/:/home"
      - "/hdd/docker-data/dbbackups:/mnt/"
      - traccar_data:/var/lib/mysql
    ports:
      - 3307:3306

networks:
  traccar:

volumes:
  traccar_data:
David Cole2 years ago

ok so I pushed the traccar container back to traccar:4 which I cna see in the log that's it's version 4.15. And I've been able to log in as admin admin. And just for completeness I was able to log in from the LAN side of the pfsense network, and the WAN side that I was originally trying.

Perhaps something not quite right with the version 5 docker container?

So I just changed the compose back to 5, and just did a refresh with the old sessions, and after a few moments, back to that 404 error.

Anton Tananaev2 years ago

Is there a public URL to try?