ory/kratos · error
unable to close message file at
Error message
unable to close message file at %s
What it means
The message file was opened successfully but closing it returned an error. This is a wrapped f.Close failure, typically caused by buffered writes failing to flush to disk (ENOSPC, I/O error) rather than a problem with the file's content.
Solutions
- Check disk space and filesystem health on the target volume
- Re-run the generation after fixing the underlying I/O problem
- Verify no other process is holding or locking the file
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at cmd/clidoc/main.go:423 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of ory/kratos@b86338da04 (2026-09-07).
Data as JSON: /api/errors/fda4fae39e67098b.
Report an issue: GitHub.
Appendix: source
Thrown at cmd/clidoc/main.go:423
return usedIDs[i].ID < usedIDs[j].ID
})
for i := 1; i < len(usedIDs); i++ {
if usedIDs[i].ID == usedIDs[i-1].ID {
return errors.Errorf("message ID %s is used more than once: %s %s", usedIDs[i].ID, usedIDs[i].Name, usedIDs[i-1].Name)
}
}
return nil
}
func generateElements(messageFilePath string) error {
// If the file at messageFilePath does not exist, create it
f, err := os.OpenFile(messageFilePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644) // #nosec
if err != nil {
return errors.Wrapf(err, "unable to open or create message file at %s", messageFilePath)
}
if err := f.Close(); err != nil {
return errors.Wrapf(err, "unable to close message file at %s", messageFilePath)
}
sortedMessages := sortMessages()
if err := writeMessagesJson(messageFilePath, sortedMessages); err != nil {
return errors.Wrapf(err, "unable to write messages json to %s", messageFilePath)
}
return nil
}
View on GitHub (pinned to b86338da04)