How to set-up working notifications with pushover (errors)

Hello,

I am trying to have a setup where a pushover notification is send when a snapshot has an error.

After creating a repository, I executed the following command :

kopia notification profile configure pushover --profile-name=pushover --user-key=MYKEY --app-token=MYTOKEN--format=html --min-severity=verbose

In case someone would wonder what are the differents values for --min-severity as this is not indicated in the doc or the CLI help, reading the code I found out that it can take the following values : success,report,warning,error,verbose.

I then did a test wich works.

kopia notification profile configure pushover --send-test-notification --profile-name=pushover

When I am doing a snaphot thought, I have the following error :

Created snapshot with root k6f6fa0b9fe23fbf7c203999af1e7eb55 and ID be90b4d60a7a5b6c78a3d420522ce169 in 0s
WARN unable to send notification        {"err":"unable to execute notification template: template: template:1:40: executing \"template\" at <.EventArgs.Snapshots>: can't evaluate field Snapshots in type interface {}","errVerbose":"unable to execute notification template: template: template:1:40: executing \"template\" at <.EventArgs.Snapshots>: can't evaluate field Snapshots in type interface {}\ngithub.com/kopia/kopia/repo.errorFromSessionResponse\n\t/home/runner/work/kopia/kopia/repo/grpc_repository_client.go:660\ngithub.com/kopia/kopia/repo.unhandledSessionResponse\n\t/home/runner/work/kopia/kopia/repo/grpc_repository_client.go:666\ngithub.com/kopia/kopia/repo.(*grpcInnerSession).SendNotification\n\t/home/runner/work/kopia/kopia/repo/grpc_repository_client.go:496\ngithub.com/kopia/kopia/repo.(*grpcRepositoryClient).SendNotification.func1\n\t/home/runner/work/kopia/kopia/repo/grpc_repository_client.go:473\ngithub.com/kopia/kopia/repo.inSessionWithoutRetry[...]\n\t/home/runner/work/kopia/kopia/repo/grpc_repository_client.go:606\ngithub.com/kopia/kopia/repo.maybeRetry[...]\n\t/home/runner/work/kopia/kopia/repo/grpc_repository_client.go:572\ngithub.com/kopia/kopia/repo.(*grpcRepositoryClient).SendNotification\n\t/home/runner/work/kopia/kopia/repo/grpc_repository_client.go:472\ngithub.com/kopia/kopia/notification.Send\n\t/home/runner/work/kopia/kopia/notification/notification_send.go:118\ngithub.com/kopia/kopia/cli.(*commandSnapshotCreate).run\n\t/home/runner/work/kopia/kopia/cli/command_snapshot_create.go:153\ngithub.com/kopia/kopia/cli.(*App).repositoryWriterAction.func1.1\n\t/home/runner/work/kopia/kopia/cli/app.go:496\ngithub.com/kopia/kopia/repo.WriteSession\n\t/home/runner/work/kopia/kopia/repo/repository.go:413\ngithub.com/kopia/kopia/cli.(*App).repositoryWriterAction.func1\n\t/home/runner/work/kopia/kopia/cli/app.go:492\ngithub.com/kopia/kopia/cli.(*App).repositoryWriterAction.(*App).maybeRepositoryAction.func2\n\t/home/runner/work/kopia/kopia/cli/app.go:579\ngithub.com/kopia/kopia/cli.(*App).repositoryWriterAction.(*App).maybeRepositoryAction.(*App).baseActionWithContext.func3.1.1\n\t/home/runner/work/kopia/kopia/cli/app.go:564\ngithub.com/kopia/kopia/cli.(*profileFlags).withProfiling\n\t/home/runner/work/kopia/kopia/cli/profile.go:45\ngithub.com/kopia/kopia/cli.(*App).repositoryWriterAction.(*App).maybeRepositoryAction.(*App).baseActionWithContext.func3.1\n\t/home/runner/work/kopia/kopia/cli/app.go:559\ngithub.com/kopia/kopia/cli.(*App).runAppWithContext.func1\n\t/home/runner/work/kopia/kopia/cli/app.go:530\ngithub.com/kopia/kopia/cli.(*App).runAppWithContext\n\t/home/runner/work/kopia/kopia/cli/app.go:531\ngithub.com/kopia/kopia/cli.(*App).repositoryWriterAction.(*App).maybeRepositoryAction.(*App).baseActionWithContext.func3\n\t/home/runner/work/kopia/kopia/cli/app.go:558\ngithub.com/alecthomas/kingpin/v2.(*actionMixin).applyActions\n\t/home/runner/go/pkg/mod/github.com/alecthomas/kingpin/v2@v2.4.0/actions.go:28\ngithub.com/alecthomas/kingpin/v2.(*Application).applyActions\n\t/home/runner/go/pkg/mod/github.com/alecthomas/kingpin/v2@v2.4.0/app.go:568\ngithub.com/alecthomas/kingpin/v2.(*Application).execute\n\t/home/runner/go/pkg/mod/github.com/alecthomas/kingpin/v2@v2.4.0/app.go:398\ngithub.com/alecthomas/kingpin/v2.(*Application).Parse\n\t/home/runner/go/pkg/mod/github.com/alecthomas/kingpin/v2@v2.4.0/app.go:230\nmain.main\n\t/home/runner/work/kopia/kopia/main.go:77\nruntime.main\n\t/opt/hostedtoolcache/go/1.22.7/x64/src/runtime/proc.go:271\nruntime.goexit\n\t/opt/hostedtoolcache/go/1.22.7/x64/src/runtime/asm_amd64.s:1695"}

I didn’t find anything obious related to the templates I should be setting up. Any idea ?

Thanks! I’ve already been wondering about severity. Unfortunately this feature is not documented besides CLI help.

It seems like notification profiles are stored per client not per repository. Is it possible that you created a profile on your server but not on the client?

I actually didn’t find it even in CLI help but I noticed that when you enter a wrong parameter value (like erro) it will displays an error with the list of available correct values.

When I try to configure a profile on the client, I have

ERROR operation supported only on direct repository

I am running the same command I was using for the server (kopia notification profile configure pushover)

Sorry, my statement is nonsense. Notifications are not created/stored per client.

I did increase verbosity on one of our repositories to force a notification and I’m receiving the same error. This might be a bug.

Looking at Github is see some commits regarding notifications and its templates but I have no idea if any of them fix this issue.

1 Like

I already checked them and didn’t find anything helpful. I will open an issue. Thanks a lot for your help and time :slight_smile:

Issue