I followed the walkthrough to setup habot behind myopenhab.org.
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”
“{“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(NotificationService.java:196) ~[?:?]
at org.openhab.ui.habot.notification.internal.NotificationService.getVAPIDPublicKey(NotificationService.java:87) ~[?:?]
at org.openhab.ui.habot.rest.internal.HABotResource.webPushConfig(HABotResource.java:209) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor403.invoke(Unknown Source) ~[?:?]
Caused by: java.nio.file.NoSuchFileException: /var/lib/openhab/habot/vapid_keys
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:92) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116) ~[?:?]
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219) ~[?:?]
at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:478) ~[?:?]
at java.nio.file.Files.newOutputStream(Files.java:220) ~[?:?]
at java.nio.file.Files.write(Files.java:3425) ~[?:?]
at java.nio.file.Files.writeString(Files.java:3641) ~[?:?]
at java.nio.file.Files.writeString(Files.java:3581) ~[?:?]
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…