Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log and trace fixes #8989

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions services/frontend/pkg/command/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,24 @@ func ListenForEvents(ctx context.Context, cfg *config.Config, l log.Logger) erro
return err
}

traceProvider, err := tracing.GetServiceTraceProvider(cfg.Tracing, cfg.Service.Name)
if err != nil {
l.Error().Err(err).Msg("cannot initialize tracing")
return err
}

gatewaySelector, err := pool.GatewaySelector(
cfg.Reva.Address,
pool.WithTLSCACert(cfg.GRPCClientTLS.CACert),
pool.WithTLSMode(tm),
pool.WithRegistry(registry.GetRegistry()),
pool.WithTracerProvider(traceProvider),
)
if err != nil {
l.Error().Err(err).Msg("cannot get gateway selector")
return err
}

traceProvider, err := tracing.GetServiceTraceProvider(cfg.Tracing, cfg.Service.Name)
if err != nil {
l.Error().Err(err).Msg("cannot initialize tracing")
return err
}

grpcClient, err := grpc.NewClient(
append(
grpc.GetClientOptions(cfg.GRPCClientTLS),
Expand Down
3 changes: 3 additions & 0 deletions services/graph/pkg/identity/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ func (cache IdentityCache) GetUser(ctx context.Context, userid string) (libregra
var user libregraph.User
if item := cache.users.Get(userid); item == nil {
gatewayClient, err := cache.gatewaySelector.Next()
if err != nil {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh and this is an unchecked err ...

return libregraph.User{}, errorcode.New(errorcode.GeneralException, err.Error())
}
cs3UserID := &cs3User.UserId{
OpaqueId: userid,
}
Expand Down
1 change: 1 addition & 0 deletions services/postprocessing/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func Server(cfg *config.Config) *cli.Command {
}, func(err error) {
logger.Error().
Err(err).
Str("server", "http").
Msg("Shutting down server")
cancel()
os.Exit(1)
Expand Down
8 changes: 0 additions & 8 deletions services/search/pkg/config/http.go

This file was deleted.

12 changes: 9 additions & 3 deletions services/settings/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Error initializing http service")
return fmt.Errorf("could not initialize http service: %w", err)
}
servers.Add(httpServer.Run, func(_ error) {
logger.Info().Str("server", "http").Msg("Shutting down server")
servers.Add(httpServer.Run, func(err error) {
logger.Error().
Err(err).
Str("server", "http").
Msg("shutting down server")
cancel()
os.Exit(1)
})
Expand All @@ -90,7 +93,10 @@ func Server(cfg *config.Config) *cli.Command {
grpc.TraceProvider(traceProvider),
)
servers.Add(grpcServer.Run, func(_ error) {
logger.Info().Str("server", "grpc").Msg("Shutting down server")
logger.Error().
Err(err).
Str("server", "grpc").
Msg("shutting down server")
cancel()
os.Exit(1)
})
Expand Down
2 changes: 1 addition & 1 deletion services/sharing/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func Server(cfg *config.Config) *cli.Command {
}, func(err error) {
logger.Error().
Err(err).
Str("server", cfg.Service.Name).
Str("server", "reva").
Msg("Shutting down server")

cancel()
Expand Down
2 changes: 1 addition & 1 deletion services/storage-publiclink/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func Server(cfg *config.Config) *cli.Command {
}, func(err error) {
logger.Error().
Err(err).
Str("server", cfg.Service.Name).
Str("server", "reva").
Msg("Shutting down server")

cancel()
Expand Down
2 changes: 1 addition & 1 deletion services/storage-shares/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func Server(cfg *config.Config) *cli.Command {
}, func(err error) {
logger.Error().
Err(err).
Str("server", cfg.Service.Name).
Str("server", "reva").
Msg("Shutting down server")

cancel()
Expand Down
2 changes: 1 addition & 1 deletion services/storage-system/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func Server(cfg *config.Config) *cli.Command {
}, func(err error) {
logger.Error().
Err(err).
Str("server", cfg.Service.Name).
Str("server", "reva").
Msg("Shutting down server")

cancel()
Expand Down
2 changes: 1 addition & 1 deletion services/storage-users/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func Server(cfg *config.Config) *cli.Command {
}, func(err error) {
logger.Error().
Err(err).
Str("server", cfg.Service.Name).
Str("server", "reva").
Msg("Shutting down server")

cancel()
Expand Down
5 changes: 4 additions & 1 deletion services/thumbnails/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ func Server(cfg *config.Config) *cli.Command {
}

gr.Add(httpServer.Run, func(_ error) {
logger.Info().Str("server", "http").Msg("shutting down server")
logger.Error().
Err(err).
Str("server", "http").
Msg("Shutting down server")
cancel()
})

Expand Down
2 changes: 1 addition & 1 deletion services/userlog/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ func Server(cfg *config.Config) *cli.Command {
return server.Run()
}, func(err error) {
logger.Error().
Str("transport", "http").
Err(err).
Str("server", "http").
Msg("Shutting down server")

cancel()
Expand Down
2 changes: 1 addition & 1 deletion services/users/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func Server(cfg *config.Config) *cli.Command {
}, func(err error) {
logger.Error().
Err(err).
Str("server", cfg.Service.Name).
Str("server", "reva").
Msg("Shutting down server")

cancel()
Expand Down
5 changes: 3 additions & 2 deletions services/web/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ func Server(cfg *config.Config) *cli.Command {
}
return err
}, func(err error) {
logger.Info().
Str("transport", "http").
logger.Error().
Err(err).
Str("server", "http").
Msg("Shutting down server")

cancel()
Expand Down
4 changes: 2 additions & 2 deletions services/webdav/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func Server(cfg *config.Config) *cli.Command {
if err != nil {
logger.Info().
Err(err).
Str("transport", "http").
Str("server", "http").
Msg("Failed to initialize server")

return err
Expand All @@ -80,7 +80,7 @@ func Server(cfg *config.Config) *cli.Command {
}, func(err error) {
logger.Error().
Err(err).
Str("transport", "http").
Str("server", "http").
Msg("Shutting down server")

cancel()
Expand Down
4 changes: 2 additions & 2 deletions services/webfinger/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func Server(cfg *config.Config) *cli.Command {
if err != nil {
logger.Info().
Err(err).
Str("transport", "http").
Str("server", "http").
Msg("Failed to initialize server")

return err
Expand All @@ -93,7 +93,7 @@ func Server(cfg *config.Config) *cli.Command {
}, func(err error) {
logger.Error().
Err(err).
Str("transport", "http").
Str("server", "http").
Msg("Shutting down server")

cancel()
Expand Down