sp132
sp13212mo ago

Logs for failed actions

I have a problem with Complement Token Action which I'm not sure how to solve. If I uncheck "Allowed to fail" - introspection returns "active": false for some of the users. I was able to narrow the problem to this piece of code that I'm using in my Action but there are no logs to aid me with further debugging.
let watermark = ctx.v1.user.getMetadata().metadata.find(v => v.key === "watermark")

if (watermark) {
api.v1.claims.setClaim('watermark', watermark.value);
}
let watermark = ctx.v1.user.getMetadata().metadata.find(v => v.key === "watermark")

if (watermark) {
api.v1.claims.setClaim('watermark', watermark.value);
}
Does someone know what's happening? I'm running self-hosted 2.54.9
9 Replies
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
sp132
sp132OP12mo ago
there are no logs in the zitadel dashboard AFAIK. I gather container logs and send them to the ELK
FFO
FFO12mo ago
Hm by default we should log action executions into stdout https://github.com/zitadel/zitadel/blob/main/cmd/defaults.yaml#L579
GitHub
zitadel/cmd/defaults.yaml at main · zitadel/zitadel
ZITADEL - Identity infrastructure, simplified for you. - zitadel/zitadel
sp132
sp132OP12mo ago
Noticed that too, perhaps it's written with the debug level?
FFO
FFO12mo ago
Hm we run info and that logs them
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
sp132
sp132OP12mo ago
Hm we run info and that logs them
Thanks for the help, figured it out. Action run message embedded as record which makes it hard to discover.
{
"caller": "/home/runner/work/zitadel/zitadel/internal/logstore/emitters/stdout/stdout.go:19",
"level": "info",
"msg": "log record emitted",
"record": "{\"logDate\":\"2024-09-18T08:55:16.033524922Z\",\"took\":329021,\"message\":\"action run failed: json: cannot unmarshal number 4E7691546 into Go value of type float64\",\"logLevel\":\"error\",\"instanceId\":\"234593317696831512\"}",
"time": "2024-09-18T08:55:16Z"
}
{
"caller": "/home/runner/work/zitadel/zitadel/internal/logstore/emitters/stdout/stdout.go:19",
"level": "info",
"msg": "log record emitted",
"record": "{\"logDate\":\"2024-09-18T08:55:16.033524922Z\",\"took\":329021,\"message\":\"action run failed: json: cannot unmarshal number 4E7691546 into Go value of type float64\",\"logLevel\":\"error\",\"instanceId\":\"234593317696831512\"}",
"time": "2024-09-18T08:55:16Z"
}
Now to the problem itself, any idea why metadata value is being unmarshaled into float64?
FFO
FFO12mo ago
not yet, but we work on exposing logs hm not of the top of my head, but we do base64 encode them
sp132
sp132OP12mo ago
should I file a bug report?

Did you find this page helpful?