Skip to content

error in init() function  #247

@je4

Description

@je4

We are using siegfried as library in other go projects.
Since a recent update there is an error on miminalistic docker files (no home directory etc.) on kubernetes.

2024/03/28 10:25:26 stat /dev/null/siegfried: not a directory

Last version which was tested ok is v1.10.1.

From our point of view, this error occurs within an init() function.
We think, it could be

if _, err := os.Stat(siegfried.home); err != nil {

If homedirectory points to /dev/null, this line tries to os.Stat("/dev/null/siegfried").
After that, the error is not known and log.Fatal(err) in

log.Fatal(err)

happens.

This error occurs even if we do not use any functionality from siegfried. Using a library which uses siegfried is enough.

Is there a way to make sure, that init() function cannot result in a fatal() or panic()?

It's quite hard to debug the minimalistic docker image, since it has no delve on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions