diun
diun copied to clipboard
Diun can't create docker client when current user does not exist.
Support guidelines
- [X] I've read the support guidelines
I've found a bug and checked that ...
- [ ] ... the documentation does not mention anything about my problem
- [ ] ... there are no open or closed issues that are related to my problem
Description
When running diun as systemd service using diun user with home /dev/null the scheduled task will fails to check the images version against the registry.
WRN Error seeking Docker credentials error="reading registries.conf.d: lstat /dev/null/.config/containers/registries.conf.d: not a directory" image=xxx/xxx
[a line as abover for each image]
WRN Cannot get remote manifest error="cannot get image digest from HEAD request: failed to create client: stat /dev/null/.config/containers/certs.d/docker.io: not a directory"
INF Jobs completed added=0 failed=1 skipped=X unchanged=0 updated=0
Expected behaviour
It should not fails where the default registry locations does not exists or are unreadable.
Actual behaviour
Diun does not load image in its internal database.
Steps to reproduce
- Install diun as service (i.e. systemd)
- Run it with a user whom home is a not existent folder (i.e. /dev/null or /bin/false)
Diun version
v4.28.0
Docker info
Version: 27.3.1
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.17.1
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.29.7
Path: /usr/libexec/docker/cli-plugins/docker-compose
### Docker Compose config
_No response_
### Logs
```text
n/a
Additional info
No response
Seems to be an issue with github.com/containers/image module when creating the docker client and not directly related to Diun. I guess you will have the same issue with skopeo: https://github.com/containers/skopeo