Dragonfly2 icon indicating copy to clipboard operation
Dragonfly2 copied to clipboard

dfdaemon download error when running as a non root user.

Open ghost opened this issue 3 years ago • 2 comments

Hi,

I have developed dfget resource plugin to support the oras:// transport.

when ran dfget as a root user the oras plugin is working as expected , and hardlink is created when an attempt is made to pull the oras image which has already pulled before.

but for a non root user the hardlink creation is not happening and each time it "try to download from source and ignore the rate limit" and below log msg is getting printed out in core.log of dfget

{"level":"info","ts":"2022-12-05 00:10:09.278","caller":"cmd/root.go:234","msg":"start to check and spawn daemon"}
{"level":"info","ts":"2022-12-05 00:10:11.280","caller":"cmd/root.go:281","msg":"do start daemon"}
{"level":"error","ts":"2022-12-05 00:10:16.337","caller":"cmd/root.go:236","msg":"check and spawn daemon error: the daemon is unhealthy","stacktr
ace":"d7y.io/dragonfly/v2/cmd/dfget/cmd.runDfget\n\t/infrastructure/uaer1/Dragonfly2/cmd/dfget/cmd/root.go:236\nd7y.io/dragonfly/v2/cmd/dfget/cmd
.glob..func2\n\t/infrastructure/user1/Dragonfly2/cmd/dfget/cmd/root.go:102\ngithub.com/spf13/cobra.(*Command).execute\n\t/root/go/pkg/mod/github.
com/spf13/[email protected]/command.go:916\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044\ngithub.com/spf13/cobra.(*Command).Execute\n\t/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:968\nd7y.io/dragonfly/v2/cmd/dfget/cmd.Execute\n\t/infrastructure/user1/Dragonfly2/cmd/dfget/cmd/root.go:120\nmain.main\n\t/infrastructure/user1/Dragonfly2/cmd/dfget/main.go:26\nruntime.main\n\t/infrastructure/user2/go/src/runtime/proc.go:250"}
{"level":"info","ts":"2022-12-05 00:10:16.337","caller":"dfget/dfget.go:55","msg":"init success and start to download","url":"oras://hostname/a/b/c:tag"}
{"level":"info","ts":"2022-12-05 00:10:16.337","caller":"dfget/dfget.go:152","msg":"try to download from source and ignore rate limit","url":"oras://hostname/a/b/c:tag"}

should i need to make any configuration changes when running dfget as a non-root user?

@embroede Thanks

ghost avatar Dec 05 '22 08:12 ghost

dfget will launch a new process with dfget daemon. By default, the configuration is system wide, so use root user. If you want make dfget daemon none root, change all directories to none root dir, like '/var/log/...', '/var/lib/...' and so on.

cacheDir: /home/test/dragonfly/cache
logDir: /home/test/dragonfly/log
dataDir: /home/test/dragonfly/data

jim3ma avatar Dec 05 '22 08:12 jim3ma

Is there also a change required to the permissions of the socket file?

embroede avatar Apr 27 '23 17:04 embroede

Please use the latest version with rust client, refer to https://github.com/dragonflyoss/client.

gaius-qi avatar Apr 23 '25 09:04 gaius-qi