Unable to connect to localhost

Noha Salama7 years ago

Hello,

I installed Traccar server on windows 10 and I have Java 8 installed.
When I try to connect to http://localhost:8082, the following error occurs: Unable to connect. Firefox can’t establish a connection to the server at localhost:8082.

Here is my log file:
2018-02-26 11:17:54  INFO: Operating system name: Windows 10 version: 10.0 architecture: x86
2018-02-26 11:17:54  INFO: Java runtime name: Java HotSpot(TM) Client VM vendor: Oracle Corporation version: 25.161-b12
2018-02-26 11:17:54  INFO: Memory limit heap: 247mb non-heap: 0mb
2018-02-26 11:17:54  INFO: Character encoding: UTF-8 charset: UTF-8
2018-02-26 11:17:54  INFO: Version: 3.15-SNAPSHOT
2018-02-26 11:17:57  INFO: Starting server...

Any help would be highly appreciated.

Anton Tananaev7 years ago

You are looking at the wrong log file. Check wrapper log.

Noha Salama7 years ago

This is how wrapper log looks:

WARNING|wrapper|Service traccar|18-02-26 08:30:40|YAJSW: yajsw-stable-12.11
WARNING|wrapper|Service traccar|18-02-26 08:30:40|OS   : Windows 10/10.0/x86
WARNING|wrapper|Service traccar|18-02-26 08:30:40|JVM  : Oracle Corporation/1.8.0_161/C:\Program Files (x86)\Java\jre1.8.0_161/32
INFO|wrapper|Service traccar|18-02-26 08:30:40|start delay: 0
INFO|wrapper|Service traccar|18-02-26 08:30:40|started process with pid 8372
INFO|8372/0|Service traccar|18-02-26 08:30:41|[INFO] StandardFileSystemManager - Using "C:\WINDOWS\TEMP\vfs_cache" as temporary files store.
INFO|8372/0|Service traccar|18-02-26 08:30:41|[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
INFO|8372/0|Service traccar|18-02-26 08:30:41|[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
INFO|8372/0|Service traccar|18-02-26 08:30:42|INFO 2/26/18 8:30 AM: liquibase: Clearing database change log checksums
INFO|8372/0|Service traccar|18-02-26 08:30:42|INFO 2/26/18 8:30 AM: liquibase: Successfully acquired change log lock
INFO|8372/0|Service traccar|18-02-26 08:30:42|INFO 2/26/18 8:30 AM: liquibase: Successfully released change log lock
INFO|8372/0|Service traccar|18-02-26 08:30:42|INFO 2/26/18 8:30 AM: liquibase: Successfully acquired change log lock
INFO|8372/0|Service traccar|18-02-26 08:30:43|INFO 2/26/18 8:30 AM: liquibase: Reading from PUBLIC.DATABASECHANGELOG
INFO|8372/0|Service traccar|18-02-26 08:30:43|INFO 2/26/18 8:30 AM: liquibase: Reading from PUBLIC.DATABASECHANGELOG
INFO|8372/0|Service traccar|18-02-26 08:30:43|INFO 2/26/18 8:30 AM: liquibase: ./schema/changelog-master.xml: changelog-3.8::changelog-3.8-dropuniquetoken::author: Change set changelog-3.8::changelog-3.8-dropuniquetoken::author failed, but failOnError was false.  Error: Constraint "UK_USER_TOKEN" not found; SQL statement:
INFO|8372/0|Service traccar|18-02-26 08:30:43|ALTER TABLE PUBLIC.users DROP CONSTRAINT uk_user_token [90057-196] [Failed SQL: ALTER TABLE PUBLIC.users DROP CONSTRAINT uk_user_token]
INFO|8372/0|Service traccar|18-02-26 08:30:43|INFO 2/26/18 8:30 AM: liquibase: Successfully released change log lock
INFO|8372/0|Service traccar|18-02-26 08:30:43|[main] INFO org.eclipse.jetty.util.log - Logging initialized @2633ms
INFO|8372/0|Service traccar|18-02-26 08:30:43|java.lang.reflect.InvocationTargetException
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at java.lang.reflect.Method.invoke(Unknown Source)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at org.rzo.yajsw.app.WrapperJVMMain.executeMain(WrapperJVMMain.java:60)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at org.rzo.yajsw.app.WrapperJVMMain.main(WrapperJVMMain.java:43)
INFO|8372/0|Service traccar|18-02-26 08:30:43|Caused by: org.jboss.netty.channel.ChannelException: Failed to bind to: 0.0.0.0/0.0.0.0:5040
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at org.traccar.TrackerServer.start(TrackerServer.java:117)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at org.traccar.ServerManager.start(ServerManager.java:81)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at org.traccar.Main.main(Main.java:38)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	... 6 more
INFO|8372/0|Service traccar|18-02-26 08:30:43|Caused by: java.net.BindException: Address already in use: bind
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at sun.nio.ch.Net.bind0(Native Method)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at sun.nio.ch.Net.bind(Unknown Source)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at sun.nio.ch.Net.bind(Unknown Source)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at org.jboss.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:391)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:315)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
INFO|8372/0|Service traccar|18-02-26 08:30:43|	at java.lang.Thread.run(Unknown Source)
INFO|wrapper|Service traccar|18-02-26 08:30:44|calling onStop
INFO|wrapper|Service traccar|18-02-26 08:30:44|Win service stop - timeout: 30000
INFO|wrapper|Service traccar|18-02-26 08:30:44|Win service wrapper.control -> stopping application
INFO|wrapper|Service traccar|18-02-26 08:30:44|Win service stop - after shutdown
INFO|wrapper|Service traccar|18-02-26 08:30:44|Win service stop - before notify
INFO|wrapper|Service traccar|18-02-26 08:30:44|Win service terminated
WARNING|wrapper|Service traccar|18-02-26 11:17:53|YAJSW: yajsw-stable-12.11
WARNING|wrapper|Service traccar|18-02-26 11:17:53|OS   : Windows 10/10.0/x86
WARNING|wrapper|Service traccar|18-02-26 11:17:53|JVM  : Oracle Corporation/1.8.0_161/C:\Program Files (x86)\Java\jre1.8.0_161/32
INFO|wrapper|Service traccar|18-02-26 11:17:53|start delay: 0
INFO|wrapper|Service traccar|18-02-26 11:17:53|started process with pid 3352
INFO|3352/0|Service traccar|18-02-26 11:17:54|[INFO] StandardFileSystemManager - Using "C:\WINDOWS\TEMP\vfs_cache" as temporary files store.
INFO|3352/0|Service traccar|18-02-26 11:17:55|[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
INFO|3352/0|Service traccar|18-02-26 11:17:55|[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
INFO|3352/0|Service traccar|18-02-26 11:17:55|INFO 2/26/18 11:17 AM: liquibase: Clearing database change log checksums
INFO|3352/0|Service traccar|18-02-26 11:17:55|INFO 2/26/18 11:17 AM: liquibase: Successfully acquired change log lock
INFO|3352/0|Service traccar|18-02-26 11:17:55|INFO 2/26/18 11:17 AM: liquibase: Successfully released change log lock
INFO|3352/0|Service traccar|18-02-26 11:17:55|INFO 2/26/18 11:17 AM: liquibase: Successfully acquired change log lock
INFO|3352/0|Service traccar|18-02-26 11:17:56|INFO 2/26/18 11:17 AM: liquibase: Reading from PUBLIC.DATABASECHANGELOG
INFO|3352/0|Service traccar|18-02-26 11:17:56|INFO 2/26/18 11:17 AM: liquibase: Reading from PUBLIC.DATABASECHANGELOG
INFO|3352/0|Service traccar|18-02-26 11:17:56|INFO 2/26/18 11:17 AM: liquibase: ./schema/changelog-master.xml: changelog-3.8::changelog-3.8-dropuniquetoken::author: Change set changelog-3.8::changelog-3.8-dropuniquetoken::author failed, but failOnError was false.  Error: Constraint "UK_USER_TOKEN" not found; SQL statement:
INFO|3352/0|Service traccar|18-02-26 11:17:56|ALTER TABLE PUBLIC.users DROP CONSTRAINT uk_user_token [90057-196] [Failed SQL: ALTER TABLE PUBLIC.users DROP CONSTRAINT uk_user_token]
INFO|3352/0|Service traccar|18-02-26 11:17:56|INFO 2/26/18 11:17 AM: liquibase: Successfully released change log lock
INFO|3352/0|Service traccar|18-02-26 11:17:56|[main] INFO org.eclipse.jetty.util.log - Logging initialized @2585ms
INFO|3352/0|Service traccar|18-02-26 11:17:57|java.lang.reflect.InvocationTargetException
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at java.lang.reflect.Method.invoke(Unknown Source)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at org.rzo.yajsw.app.WrapperJVMMain.executeMain(WrapperJVMMain.java:60)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at org.rzo.yajsw.app.WrapperJVMMain.main(WrapperJVMMain.java:43)
INFO|3352/0|Service traccar|18-02-26 11:17:57|Caused by: org.jboss.netty.channel.ChannelException: Failed to bind to: 0.0.0.0/0.0.0.0:5040
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at org.traccar.TrackerServer.start(TrackerServer.java:117)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at org.traccar.ServerManager.start(ServerManager.java:81)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at org.traccar.Main.main(Main.java:38)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	... 6 more
INFO|3352/0|Service traccar|18-02-26 11:17:57|Caused by: java.net.BindException: Address already in use: bind
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at sun.nio.ch.Net.bind0(Native Method)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at sun.nio.ch.Net.bind(Unknown Source)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at sun.nio.ch.Net.bind(Unknown Source)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at org.jboss.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:391)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:315)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
INFO|3352/0|Service traccar|18-02-26 11:17:57|	at java.lang.Thread.run(Unknown Source)
INFO|wrapper|Service traccar|18-02-26 11:17:57|calling onStop
INFO|wrapper|Service traccar|18-02-26 11:17:57|Win service stop - timeout: 30000
INFO|wrapper|Service traccar|18-02-26 11:17:57|Win service wrapper.control -> stopping application
INFO|wrapper|Service traccar|18-02-26 11:17:57|Win service stop - after shutdown
INFO|wrapper|Service traccar|18-02-26 11:17:57|Win service stop - before notify
INFO|wrapper|Service traccar|18-02-26 11:17:57|Win service terminated

I think some other process is using ports required by Traccar. Is that right?

Noha Salama7 years ago

Can I remove this line:
<entry key='carscop.port'>5040</entry> from default.xml?

jagadeesh7 years ago

check config file for web.port it must be 8082. It seems your server is running on 5040 port.

Anton Tananaev7 years ago

Yes, you can remove that line or just change port to something else.

localhost has stopped working and this is log file

2021-01-30 07:31:21  WARN: HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=12h53m36s924ms22µs600ns).
2021-01-30 07:50:10  WARN: HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=7m48s617ms838µs100ns).
2021-01-30 10:24:14  INFO: Shutting down server...
2021-01-31 16:43:46  INFO: HikariPool-1 - Starting...
2021-01-31 16:43:51  WARN: Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
2021-01-31 16:43:57  INFO: HikariPool-1 - Start completed.
2021-01-31 16:44:13  INFO: Clearing database change log checksums
2021-01-31 16:44:15  INFO: Successfully acquired change log lock
2021-01-31 16:44:17  INFO: Successfully released change log lock
2021-01-31 16:44:17  INFO: Successfully acquired change log lock
2021-01-31 16:44:18  INFO: Can not use class liquibase.parser.core.json.JsonChangeLogParser as a Liquibase service because org.yaml.snakeyaml.constructor.BaseConstructor is not in the classpath
2021-01-31 16:44:18  INFO: Can not use class liquibase.parser.core.yaml.YamlChangeLogParser as a Liquibase service because org.yaml.snakeyaml.constructor.BaseConstructor is not in the classpath
2021-01-31 16:44:33  INFO: Reading from traccar.DATABASECHANGELOG
2021-01-31 16:44:37  INFO: Reading from traccar.DATABASECHANGELOG
2021-01-31 16:44:37  INFO: Successfully released change log lock
2021-01-31 16:44:45  INFO: Logging initialized @89099ms to org.eclipse.jetty.util.log.Slf4jLog
2021-01-31 16:44:58  INFO: Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system instability.
2021-01-31 16:45:24  INFO: Operating system name: Windows 10 version: 10.0 architecture: amd64
2021-01-31 16:45:24  INFO: Java runtime name: OpenJDK 64-Bit Server VM vendor: ojdkbuild version: 11.0.9+11-LTS
2021-01-31 16:45:24  INFO: Memory limit heap: 2022mb non-heap: 0mb
2021-01-31 16:45:24  INFO: Character encoding: Cp1252 charset: windows-1252
2021-01-31 16:45:24  INFO: Version: 4.11
2021-01-31 16:45:24  INFO: Starting server...
2021-01-31 16:45:35  WARN: Port 5040 is disabled due to conflict
2021-01-31 16:45:35  WARN: Port 5002 is disabled due to conflict
2021-01-31 16:45:35  WARN: Port 5003 is disabled due to conflict
2021-01-31 16:45:35  WARN: Port 5001 is disabled due to conflict
2021-01-31 16:45:35  INFO: jetty-9.4.33.v20201020; built: 2020-10-20T23:39:24.803Z; git: 1be68755656cef678b79a2ef1c2ebbca99e25420; jvm 11.0.9+11-LTS
2021-01-31 16:45:39  INFO: Started o.t.w.@4be14f14{/,null,AVAILABLE}
2021-01-31 16:45:39  INFO: DefaultSessionIdManager workerName=node0
2021-01-31 16:45:39  INFO: No SessionScavenger set, using defaults
2021-01-31 16:45:39  INFO: node0 Scavenging every 600000ms
2021-01-31 16:53:32  INFO: HikariPool-1 - Starting...
2021-01-31 16:53:39  WARN: Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
2021-01-31 16:53:59 ERROR: HikariPool-1 - Exception during pool initialization. - Connection refused: connect - ConnectException (... < DataManager:139 < *:89 < Context:299 < Main:137 < ...)
2021-01-31 16:53:59 ERROR: Main method error - Connection refused: connect - ConnectException (... < DataManager:139 < *:89 < Context:299 < Main:137 < ...)
2021-01-31 16:53:59  WARN: JNA: Callback org.traccar.WindowsService$ServiceMain@3e78b6a5 threw the following exception - Connection refused: connect - ConnectException (... < DataManager:139 < *:89 < Context:299 < Main:137 < ...)
Anton Tananaev4 years ago

As you can see from the logs, Traccar is not able to connect to your database.