purple-beard-97222
03/10/2023, 1:26 AMpanic: nid must be not nil [recovered]
panic: nid must be not nil
goroutine 1 [running]:
<http://github.com/ory/x/otelx.End({0x1c63f80|github.com/ory/x/otelx.End({0x1c63f80>?, 0x2a17f70}, 0x4000a37888)
/go/pkg/mod/github.com/ory/x@v0.0.531/otelx/withspan.go:52 +0x118
panic({0x14c5240, 0x1c48a70})
/usr/local/go/src/runtime/panic.go:884 +0x20c
<http://github.com/ory/x/contextx.(*Default).Network(0x40007c2410|github.com/ory/x/contextx.(*Default).Network(0x40007c2410>?, {0x40003acb40?, 0x98?}, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...})
/go/pkg/mod/github.com/ory/x@v0.0.531/contextx/default.go:20 +0x8c
<http://github.com/ory/kratos/persistence/sql.(*Persister).NetworkID(0x4000e4c720|github.com/ory/kratos/persistence/sql.(*Persister).NetworkID(0x4000e4c720>, {0x1c5c0b8, 0x4000e5a510})
/project/persistence/sql/persister.go:72 +0x7c
<http://github.com/ory/kratos/persistence/sql.(*Persister).DeleteExpiredSessions(0x4000e4c720|github.com/ory/kratos/persistence/sql.(*Persister).DeleteExpiredSessions(0x4000e4c720>, {0x1c5c048, 0x4000040058}, {0x22?, 0x4000a37b10?, 0x29e6a40?}, 0x1?)
/project/persistence/sql/persister_session.go:406 +0x17c
<http://github.com/ory/kratos/persistence/sql.(*Persister).CleanupDatabase(0x4000e4c720|github.com/ory/kratos/persistence/sql.(*Persister).CleanupDatabase(0x4000e4c720>, {0x1c5c048, 0x4000040058}, 0x1c53150?, 0x0, 0x4000010040?)
/project/persistence/sql/persister.go:147 +0x144
<http://github.com/ory/kratos/cmd/cliclient.(*CleanupHandler).CleanupSQL(0x0|github.com/ory/kratos/cmd/cliclient.(*CleanupHandler).CleanupSQL(0x0>?, 0x4000962600, {0x40004312f0, 0x0, 0x0?})
/project/cmd/cliclient/cleanup.go:61 +0x42c
<http://github.com/ory/kratos/cmd/cleanup.NewCleanupSQLCmd.func1(0x4000962600|github.com/ory/kratos/cmd/cleanup.NewCleanupSQLCmd.func1(0x4000962600>?, {0x40004312f0?, 0x1?, 0x1?})
/project/cmd/cleanup/sql.go:35 +0x38
<http://github.com/spf13/cobra.(*Command).execute(0x4000962600|github.com/spf13/cobra.(*Command).execute(0x4000962600>, {0x4000431290, 0x1, 0x1})
/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:916 +0x5e0
<http://github.com/spf13/cobra.(*Command).ExecuteC(0x4000187b00)|github.com/spf13/cobra.(*Command).ExecuteC(0x4000187b00)>
/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x368
<http://github.com/spf13/cobra.(*Command).Execute(...)|github.com/spf13/cobra.(*Command).Execute(...)>
/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
<http://github.com/ory/kratos/cmd.Execute()|github.com/ory/kratos/cmd.Execute()>
/project/cmd/root.go:61 +0x24
main.main()
/project/main.go:21 +0x64
I get this error when I run
kratos cleanup sql -e
, I have checked the DB and nothing was executed.
I can’t quite find out why it panics, iirc everything is setup correctly and working fine in local and staging, but the panic still shows up in both places