error - NullPointerException Traccar 5.9

Cristian 2 years ago

I recently upgraded to version 5.9 of Traccar and I have detected that I am getting the error
error - NullPointerException
Attached imagehttps://ibb.co/Nrtr8Gp

I checked in the forum and found other similar cases but where you can detect the problem more easily, but in this case I do not know why the error occurs.

any suggestions?

Track-trace 2 years ago

Surely the real HEX from the log will be requested.

Anton Tananaev 2 years ago

Try enabling full stack traces to see more details about the error.

Cristian 2 years ago

Ok, do that and I'll share the results

Cristian 2 years ago

this is an extract from the log file

2023-12-14 21:12:36  INFO: [T6a89ee80: gl200 < 186.11.61.127] 2b524553503a47544652492c3530303130312c3836383537343034303338363430362c2c31343436382c31312c312c312c31342e342c3134322c3139372e322c2d37322e3433383536302c2d33382e3534303931302c32303233313231353030303932392c303733302c303030312c373835352c333839373733412c30302c302e302c2c2c2c3130302c3232303130302c2c2c2c32303233313231353030303933302c3637373324
2023-12-14 21:12:37  INFO: [Te066cd12: gl200 < 186.11.24.48] 2b524553503a47544652492c3530303130312c3836383537343034303433363934362c2c31343332302c31312c312c312c332e322c322c3339362e372c2d37322e3131323132302c2d33382e3636353137382c32303233313231353030313235362c2c2c2c2c30302c302e302c2c2c2c3130302c3232303130302c2c2c2c32303233313231353030313235362c4342334424
2023-12-14 21:12:37  INFO: [Te066cd12] id: 868574040xxxxxx, time: 2023-12-14 21:12:56, lat: -38.66518, lon: -72.11212, speed: 1.7, course: 2.0
2023-12-14 21:12:37  INFO: [T6a89ee80] error - 
java.lang.NullPointerException: Cannot invoke "String.getBytes()" because the return value of "org.traccar.config.Config.getString(org.traccar.config.ConfigKey)" is null
	at org.traccar.notificators.NotificatorFirebase.<init>(NotificatorFirebase.java:76)
	at org.traccar.notificators.NotificatorFirebase$$FastClassByGuice$$13dbfd71.GUICE$TRAMPOLINE(<generated>)
	at org.traccar.notificators.NotificatorFirebase$$FastClassByGuice$$13dbfd71.apply(<generated>)
	at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82)
	at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:300)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:169)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
	at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1148)
	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1186)
	at org.traccar.notification.NotificatorManager.getNotificator(NotificatorManager.java:70)
	at org.traccar.database.NotificationManager.lambda$updateEvent$3(NotificationManager.java:110)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at org.traccar.database.NotificationManager.lambda$updateEvent$4(NotificationManager.java:107)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at org.traccar.database.NotificationManager.updateEvent(NotificationManager.java:106)
	at org.traccar.database.NotificationManager.updateEvents(NotificationManager.java:148)
	at org.traccar.handler.events.BaseEventHandler.handlePosition(BaseEventHandler.java:40)
	at org.traccar.BaseDataHandler.channelRead(BaseDataHandler.java:27)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
...
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:833)

2023-12-14 21:12:37  INFO: [T6a89ee80] disconnected
Anton Tananaev 2 years ago

Looks like you misconfigured something. Specifically Firebase configuration is missing.

Cristian 2 years ago

Thank you very much Anton, in the process of upgrading to version 5.9 I forgot to configure WhatsApp notifications correctly.

Track-trace 2 years ago

Hi Cristian, If you got whatsapp working correctly you might reply here.

https://www.traccar.org/forums/topic/whatsapp-notifications-instead-of-telegram/#post-92297

Cristian 2 years ago

actually the correct answer was that I had not configured push notifications properly (firebase).
But you can also have WhatsApp notifications in Traccar.