Skip to content

CLI client directory creation #729

@hnnsly

Description

@hnnsly

Hello, recently I had a problem using CLI client from .rpm package: I was trying to start the client using command from admin UI, but it threw following error every time.

$ dg -v enroll -u https://my.defguard.local -t 123456789
2025-12-19T11:21:14.999430Z DEBUG dg: Starting CLI...                                                                               2025-12-19T11:21:14.999569Z DEBUG dg: Getting configuration path...
2025-12-19T11:21:14.999658Z ERROR dg: Failed to create default configuration path: No such file or directory (os error 2)

strace gave some hints

statx(AT_FDCWD, "/root/.local/share/net.defguard.cli", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7ffc9572def0) = -1 ENOENT (No such file or directory)
statx(0, NULL, AT_STATX_SYNC_AS_STAT, STATX_ALL, NULL) = -1 EFAULT (Bad address)
mkdir("/root/.local/share/net.defguard.cli", 0777) = -1 ENOENT (No such file or directory)

so I created this directory, because /root/.local dir was not present on my machine

mkdir -p /root/.local/share

maybe using something that checks if parent directories are present and creates them if needed would solve the problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions