Failed to get VAPID


I followed the walkthrough to setup habot behind
As soon as I test notifications, I get “Error while getting the public VAPID key from the server: Error: Request failed with status code 500”

A little debugging shows the result of the call to

“{“error”:{“message”:“Cannot get the VAPID keypair for push notifications”,“http-code”:500,“exception”:{“class”:“java.lang.RuntimeException”,“message”:“Cannot get the VAPID keypair for push notifications”,“localized-message”:“Cannot get the VAPID keypair for push notifications”,“cause”:“java.nio.file.NoSuchFileException”}}}”

Can anyone give me some advice here?

exception in logs:
2021-07-27 15:15:33.512 [ERROR] [internal.JSONResponseExceptionMapper] - Unexpected exception occurred while processing REST request.

java.lang.RuntimeException: Cannot get the VAPID keypair for push notifications

at org.openhab.ui.habot.notification.internal.NotificationService.loadVAPIDKeys( ~[?:?]

at org.openhab.ui.habot.notification.internal.NotificationService.getVAPIDPublicKey( ~[?:?]

at ~[?:?]

at jdk.internal.reflect.GeneratedMethodAccessor403.invoke(Unknown Source) ~[?:?]

caused by exception:

Caused by: java.nio.file.NoSuchFileException: /var/lib/openhab/habot/vapid_keys

	at sun.nio.fs.UnixException.translateToIOException( ~[?:?]

	at sun.nio.fs.UnixException.rethrowAsIOException( ~[?:?]

	at sun.nio.fs.UnixException.rethrowAsIOException( ~[?:?]

	at sun.nio.fs.UnixFileSystemProvider.newByteChannel( ~[?:?]

	at java.nio.file.spi.FileSystemProvider.newOutputStream( ~[?:?]

	at java.nio.file.Files.newOutputStream( ~[?:?]

	at java.nio.file.Files.write( ~[?:?]

	at java.nio.file.Files.writeString( ~[?:?]

	at java.nio.file.Files.writeString( ~[?:?]

Should that file be generated somehow?

Managed to solve it by manually generating the file with values from an online key generator.
It remains unsolved why the generation mechanism didn’t work here…

This should happen, I traced it down to a regression introduced by

On this line:

The open option should be CREATE or CREATE_NEW (or in addition to TRUNCATE_EXISTING).

OK, that makes sense.
I’ll be happy to test it in a further release - in the mean time, I think I can work well with the workaround.

Did you by any chance have a look at my other post too?
Send notifications via jython script - Apps & Services / HABot - openHAB Community

Just testing the notifications as well but they the same error but cannot find how to generate a new vapid_keys file. Thanks in advance

Hello Berni, how did you do that with the vapid_key file? What does the file have to look like?