Problems getting email notifications

alfmollerud8 years ago

I have a new installation of Traccar server on Linux (my first).
It was easy to set up and it works fine except for one thing : I cannot get mail-warnings to work.
I have set up a local mailserver and entered the details in the xml config.
I have also added manually to a user both those details and also tried gmail smtp with ssl.
In both cases, I receive no warnings. Also - if I click on the email-icon under "account" - I get an exception-error on the screen in a dialog.

Looking at the wrapper logfile, i do not get these errors logged, but there is an error when the server starts. This is an excerpt from the log:

INFO|wrapper|Service traccar|17-06-01 22:34:38|posix_spawn pid 2157
INFO|wrapper|Service traccar|17-06-01 22:34:39|started process 2157
INFO|wrapper|Service traccar|17-06-01 22:34:39|started process with pid 2157
INFO|2157/0|Service traccar|17-06-01 22:34:44|[INFO] StandardFileSystemManager - Using "/tmp/vfs_cache" as temporary files store.
INFO|2157/0|Service traccar|17-06-01 22:34:46|[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
INFO|2157/0|Service traccar|17-06-01 22:34:48|[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
INFO|2157/0|Service traccar|17-06-01 22:34:49|INFO 6/1/17 10:34 PM: liquibase: Clearing database change log checksums
INFO|2157/0|Service traccar|17-06-01 22:34:49|INFO 6/1/17 10:34 PM: liquibase: Successfully acquired change log lock
INFO|2157/0|Service traccar|17-06-01 22:34:50|INFO 6/1/17 10:34 PM: liquibase: Successfully released change log lock
INFO|2157/0|Service traccar|17-06-01 22:34:50|INFO 6/1/17 10:34 PM: liquibase: Successfully acquired change log lock
INFO|2157/0|Service traccar|17-06-01 22:34:54|INFO 6/1/17 10:34 PM: liquibase: Reading from PUBLIC.DATABASECHANGELOG
INFO|2157/0|Service traccar|17-06-01 22:34:55|INFO 6/1/17 10:34 PM: liquibase: Reading from PUBLIC.DATABASECHANGELOG
INFO|2157/0|Service traccar|17-06-01 22:34:55|INFO 6/1/17 10:34 PM: 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|2157/0|Service traccar|17-06-01 22:34:55|ALTER TABLE PUBLIC.users DROP CONSTRAINT uk_user_token [90057-194] [Failed SQL: ALTER TABLE PUBLIC.users DROP CONSTRAINT uk_user_token]
INFO|2157/0|Service traccar|17-06-01 22:34:55|INFO 6/1/17 10:34 PM: liquibase: Successfully released change log lock
INFO|2157/0|Service traccar|17-06-01 22:34:55|[main] INFO org.eclipse.jetty.util.log - Logging initialized @16079ms
INFO|2157/0|Service traccar|17-06-01 22:34:57|[main] INFO org.eclipse.jetty.server.Server - jetty-9.2.21.v20170120
INFO|2157/0|Service traccar|17-06-01 22:35:00|[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@2d290e6d{/api,null,AVAILABLE}
INFO|2157/0|Service traccar|17-06-01 22:35:00|[main] INFO org.eclipse.jetty.server.ServerConnector - Started ServerConnector@4b175a82{HTTP/1.1}{0.0.0.0:8082}
INFO|2157/0|Service traccar|17-06-01 22:35:00|[main] INFO org.eclipse.jetty.server.Server - Started @20422ms
INFO|2157/0|Service traccar|17-06-01 22:36:15|Uncaught exception by Thread[Thread-16,5,main]:
INFO|2157/0|Service traccar|17-06-01 22:36:15|java.lang.NullPointerException:null
INFO|2157/0|Service traccar|17-06-01 22:36:15|java.lang.NullPointerException
INFO|2157/0|Service traccar|17-06-01 22:36:15|	at java.util.Hashtable.put(Hashtable.java:514)
INFO|2157/0|Service traccar|17-06-01 22:36:15|	at org.traccar.notification.NotificationMail.getProperties(NotificationMail.java:70)
INFO|2157/0|Service traccar|17-06-01 22:36:15|	at org.traccar.notification.NotificationMail.sendMailSync(NotificationMail.java:91)
INFO|2157/0|Service traccar|17-06-01 22:36:15|	at org.traccar.notification.NotificationMail$1.run(NotificationMail.java:130)
INFO|2157/0|Service traccar|17-06-01 22:36:15|	at java.lang.Thread.run(Thread.java:745)
INFO|2157/0|Service traccar|17-06-01 22:36:18|Uncaught exception by Thread[Thread-17,5,main]:
INFO|2157/0|Service traccar|17-06-01 22:36:18|java.lang.NullPointerException:null
INFO|2157/0|Service traccar|17-06-01 22:36:18|java.lang.NullPointerException
INFO|2157/0|Service traccar|17-06-01 22:36:18|	at java.util.Hashtable.put(Hashtable.java:514)
INFO|2157/0|Service traccar|17-06-01 22:36:18|	at org.traccar.notification.NotificationMail.getProperties(NotificationMail.java:70)
INFO|2157/0|Service traccar|17-06-01 22:36:18|	at org.traccar.notification.NotificationMail.sendMailSync(NotificationMail.java:91)
INFO|2157/0|Service traccar|17-06-01 22:36:18|	at org.traccar.notification.NotificationMail$1.run(NotificationMail.java:130)
INFO|2157/0|Service traccar|17-06-01 22:36:18|	at java.lang.Thread.run(Thread.java:745)

What is it that I have not thought of ?

This is the mail-section of traccar.xml :

<entry key='mail.smtp.host'>10.10.11.9</entry>
<entry key='mail.smtp.port'>25</entry>
<entry key='mail.smtp.from'>traccar@emcom.no</entry>
  • I can test this with telnet to port 25 and it works fine...
Anton Tananaev8 years ago

You have to provide more configuration parameters. Search on forum for some examples.

alfmollerud8 years ago

I did in the user params -is that not enough ?
I set host, port, from, starttls enable, auth, username and password (only in user params -not in config file)..

Anton Tananaev8 years ago

If you configured everything in the user attributes why are you posting your config here? Why do you even have that info in the config?

alfmollerud8 years ago

I only entered it into the user-parameters when I couldnt get it to work with only the xml-conf.

Anton Tananaev8 years ago

There is no difference between entering parameters in the config or user parameters, but you shouldn't use both. Pick one option!

alfmollerud8 years ago

OK, I took out the lines in the config and left only the user-params, and that works fine. Thank you!

Alf