diff --git a/changelog/unreleased/fix-log-data-path-at-startup.md b/changelog/unreleased/fix-log-data-path-at-startup.md new file mode 100644 index 00000000000..b3232e8411a --- /dev/null +++ b/changelog/unreleased/fix-log-data-path-at-startup.md @@ -0,0 +1,10 @@ +Enhancement: Log effective data and config paths at startup + +oCIS now logs the effective data path and config path at startup so +operators can immediately verify that data is written to the expected +location. This helps catch misconfigured Docker volume mounts where +data silently falls back to an ephemeral container path instead of +the intended persistent mount. + +https://github.com/owncloud/ocis/pull/XXXX +https://github.com/owncloud/ocis/issues/12044 diff --git a/ocis/pkg/runtime/service/service.go b/ocis/pkg/runtime/service/service.go index 14478ebe49a..145a1a9e394 100644 --- a/ocis/pkg/runtime/service/service.go +++ b/ocis/pkg/runtime/service/service.go @@ -27,6 +27,7 @@ import ( "github.com/thejerf/suture/v4" ociscfg "github.com/owncloud/ocis/v2/ocis-pkg/config" + "github.com/owncloud/ocis/v2/ocis-pkg/config/defaults" "github.com/owncloud/ocis/v2/ocis-pkg/log" ogrpc "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc" "github.com/owncloud/ocis/v2/ocis-pkg/shared" @@ -370,6 +371,13 @@ func Start(ctx context.Context, o ...Option) error { return err } + // Log the effective data and config paths at startup so operators can + // verify that data is written to the expected location. + s.Log.Info(). + Str("data_path", defaults.BaseDataPath()). + Str("config_path", defaults.BaseConfigPath()). + Msg("effective data and config paths") + // cancel the context when a signal is received. var cancel context.CancelFunc = func() {} if ctx == nil {