Unable to delete users with cli

If I would like to delete a user with the cli command with docker…
docker-compose exec api /app/vikunja/vikunja user delete 4 --now
the confirmation does not appear and when I typed “YES, I CONFIRM”
I get
panic: runtime error: invalid memory address or nil pointer dereference

[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xe0fbd7]

what can I do?

Can you post the full stack trace?

What version are you using?

thanks - -
I use
Vikunja api version v0.18.1
Built with go1.16.5

here is the full stack trace:

2022/06/09 11:16:58 Config File "config" Not Found in "[/app/vikunja /etc/vikunja /root/.config/vikunja]"
2022/06/09 11:16:58 Using default config.
2022-06-09T11:16:58.9810408Z: INFO	▶ migration/Migrate 048 Ran all migrations successfully.
You requested to delete the user immediately. Are you sure?
To confirm, please type "yes, I confirm" in all uppercase:
2022-06-09T11:16:58.981894364Z: INFO	▶ [EVENTS] 04d Adding handler, handler_name=poison.logger, topic=poison
2022-06-09T11:16:58.9819993Z: INFO	▶ [EVENTS] 04f Adding handler, handler_name=team.created.team.counter.increase, topic=team.created
2022-06-09T11:16:58.982133161Z: INFO	▶ [EVENTS] 050 Adding handler, handler_name=team.member.added.team.member.added.notification, topic=team.member.added
2022-06-09T11:16:58.982305613Z: INFO	▶ [EVENTS] 051 Adding handler, topic=user.created, handler_name=user.created.increase.user.counter
2022-06-09T11:16:58.982321934Z: INFO	▶ [EVENTS] 052 Adding handler, handler_name=list.created.list.counter.increase, topic=list.created
2022-06-09T11:16:58.982420508Z: INFO	▶ [EVENTS] 053 Adding handler, handler_name=list.created.send.list.created.notification, topic=list.created
2022-06-09T11:16:58.982541224Z: INFO	▶ [EVENTS] 054 Adding handler, handler_name=task.created.task.counter.increase, topic=task.created
2022-06-09T11:16:58.982570468Z: INFO	▶ [EVENTS] 055 Adding handler, handler_name=task.created.task.created.mentions, topic=task.created
2022-06-09T11:16:58.982586408Z: INFO	▶ [EVENTS] 056 Adding handler, topic=namespace.created, handler_name=namespace.created.namespace.counter.increase
2022-06-09T11:16:58.982605284Z: INFO	▶ [EVENTS] 057 Adding handler, handler_name=task.comment.created.task.comment.notification.send, topic=task.comment.created
2022-06-09T11:16:58.982620252Z: INFO	▶ [EVENTS] 058 Adding handler, handler_name=task.comment.edited.handle.task.comment.edit.mentions, topic=task.comment.edited
2022-06-09T11:16:58.982634808Z: INFO	▶ [EVENTS] 059 Adding handler, handler_name=task.updated.task.updated.mentions, topic=task.updated
2022-06-09T11:16:58.982650157Z: INFO	▶ [EVENTS] 05a Adding handler, handler_name=user.export.requested.handle.user.data.export, topic=user.export.requested
2022-06-09T11:16:58.982666498Z: INFO	▶ [EVENTS] 05b Adding handler, handler_name=list.deleted.list.counter.decrease, topic=list.deleted
2022-06-09T11:16:58.982682198Z: INFO	▶ [EVENTS] 05c Adding handler, topic=namespace.deleted, handler_name=namespace.deleted.namespace.counter.decrease
2022-06-09T11:16:58.982697496Z: INFO	▶ [EVENTS] 05d Adding handler, topic=task.deleted, handler_name=task.deleted.task.counter.decrease
2022-06-09T11:16:58.982712995Z: INFO	▶ [EVENTS] 05e Adding handler, handler_name=task.deleted.task.deleted.notification.send, topic=task.deleted
2022-06-09T11:16:58.982733524Z: INFO	▶ [EVENTS] 05f Adding handler, handler_name=team.deleted.team.counter.decrease, topic=team.deleted
2022-06-09T11:16:58.982749723Z: INFO	▶ [EVENTS] 060 Adding handler, handler_name=task.assignee.created.task.assigned.notification.send, topic=task.assignee.created
2022-06-09T11:16:58.982764331Z: INFO	▶ [EVENTS] 061 Adding handler, handler_name=task.assignee.created.task.assignee.subscribe, topic=task.assignee.created
2022-06-09T11:16:58.983482223Z: INFO	▶ [EVENTS] 078 Starting handler, subscriber_name=list.deleted.list.counter.decrease, topic=list.deleted
2022-06-09T11:16:58.983519182Z: INFO	▶ [EVENTS] 07a Starting handler, subscriber_name=namespace.deleted.namespace.counter.decrease, topic=namespace.deleted
2022-06-09T11:16:58.983540693Z: INFO	▶ [EVENTS] 07b Starting handler, subscriber_name=team.deleted.team.counter.decrease, topic=team.deleted
2022-06-09T11:16:58.983556952Z: INFO	▶ [EVENTS] 07c Starting handler, subscriber_name=task.assignee.created.task.assignee.subscribe, topic=task.assignee.created
2022-06-09T11:16:58.983574415Z: INFO	▶ [EVENTS] 07d Starting handler, subscriber_name=task.created.task.created.mentions, topic=task.created
2022-06-09T11:16:58.983591608Z: INFO	▶ [EVENTS] 07e Starting handler, subscriber_name=task.comment.created.task.comment.notification.send, topic=task.comment.created
2022-06-09T11:16:58.983610162Z: INFO	▶ [EVENTS] 07f Starting handler, subscriber_name=user.export.requested.handle.user.data.export, topic=user.export.requested
2022-06-09T11:16:58.983637342Z: INFO	▶ [EVENTS] 080 Starting handler, subscriber_name=task.deleted.task.counter.decrease, topic=task.deleted
2022-06-09T11:16:58.98365716Z: INFO	▶ [EVENTS] 081 Starting handler, topic=poison, subscriber_name=poison.logger
2022-06-09T11:16:58.983676976Z: INFO	▶ [EVENTS] 082 Starting handler, subscriber_name=team.created.team.counter.increase, topic=team.created
2022-06-09T11:16:58.9836948Z: INFO	▶ [EVENTS] 083 Starting handler, subscriber_name=team.member.added.team.member.added.notification, topic=team.member.added
2022-06-09T11:16:58.983712203Z: INFO	▶ [EVENTS] 084 Starting handler, subscriber_name=namespace.created.namespace.counter.increase, topic=namespace.created
2022-06-09T11:16:58.983729354Z: INFO	▶ [EVENTS] 085 Starting handler, subscriber_name=task.comment.edited.handle.task.comment.edit.mentions, topic=task.comment.edited
2022-06-09T11:16:58.983748621Z: INFO	▶ [EVENTS] 086 Starting handler, subscriber_name=task.deleted.task.deleted.notification.send, topic=task.deleted
2022-06-09T11:16:58.983766684Z: INFO	▶ [EVENTS] 087 Starting handler, topic=list.created, subscriber_name=list.created.list.counter.increase
2022-06-09T11:16:58.983830053Z: INFO	▶ [EVENTS] 088 Starting handler, topic=task.created, subscriber_name=task.created.task.counter.increase
2022-06-09T11:16:58.983965035Z: INFO	▶ [EVENTS] 089 Starting handler, subscriber_name=task.assignee.created.task.assigned.notification.send, topic=task.assignee.created
2022-06-09T11:16:58.983482634Z: INFO	▶ [EVENTS] 079 Starting handler, subscriber_name=task.updated.task.updated.mentions, topic=task.updated
2022-06-09T11:16:58.984267961Z: INFO	▶ [EVENTS] 08a Starting handler, subscriber_name=user.created.increase.user.counter, topic=user.created
2022-06-09T11:16:58.984268272Z: INFO	▶ [EVENTS] 08b Starting handler, subscriber_name=list.created.send.list.created.notification, topic=list.created
YES, I CONFIRM
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xe0fbd7]

goroutine 1 [running]:
code.vikunja.io/api/pkg/user.(*User).GetName(...)
	/go/src/code.vikunja.io/api/pkg/user/user.go:144
code.vikunja.io/api/pkg/user.(*AccountDeletedNotification).ToMail(0xc000010510, 0x7fa9159683b0)
	/go/src/code.vikunja.io/api/pkg/user/notifications.go:259 +0x57
code.vikunja.io/api/pkg/notifications.notifyMail(0x16a2b48, 0xc0001f6240, 0x16aab58, 0xc000010510, 0x8, 0x1229240)
	/go/src/code.vikunja.io/api/pkg/notifications/notification.go:65 +0x35
code.vikunja.io/api/pkg/notifications.Notify(0x16a2b48, 0xc0001f6240, 0x16aab58, 0xc000010510, 0x0, 0x0)
	/go/src/code.vikunja.io/api/pkg/notifications/notification.go:56 +0x133
code.vikunja.io/api/pkg/models.DeleteUser(0xc000263930, 0xc0001f6240, 0x1, 0xc0001f6240)
	/go/src/code.vikunja.io/api/pkg/models/user_delete.go:170 +0x87a
code.vikunja.io/api/pkg/cmd.glob..func24(0x1d445e0, 0xc000462d60, 0x1, 0x2)
	/go/src/code.vikunja.io/api/pkg/cmd/user.go:342 +0x18a
github.com/spf13/cobra.(*Command).execute(0x1d445e0, 0xc000462d40, 0x2, 0x2, 0x1d445e0, 0xc000462d40)
	/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:860 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x1d44d60, 0xc000000180, 0x200000003, 0xc000000180)
	/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902
code.vikunja.io/api/pkg/cmd.Execute()
	/go/src/code.vikunja.io/api/pkg/cmd/cmd.go:44 +0x31
main.main()
	/go/src/code.vikunja.io/api/main.go:22 +0x25

Does it work with the latest unstable version? There’s been a few fixes and changes recently to the user deletion.

Yes - under the latest unstable version it works great.
When will be the unstable version called stable.

I hope to get the next release out in a few (2-3) weeks.

1 Like