diff --git a/rest-api/workflow/pkg/activity/machine/machine.go b/rest-api/workflow/pkg/activity/machine/machine.go index 231fd18eb2..770e8f67bc 100644 --- a/rest-api/workflow/pkg/activity/machine/machine.go +++ b/rest-api/workflow/pkg/activity/machine/machine.go @@ -158,7 +158,7 @@ func (mm *ManageMachine) UpdateMachinesInDB(ctx context.Context, siteIDStr strin Status: &status, }) if serr != nil { - logger.Error().Err(err).Msg("failed to update Site status in DB") + logger.Error().Err(serr).Msg("failed to update Site status in DB") } sdDAO := cdbm.NewStatusDetailDAO(mm.dbSession) @@ -173,7 +173,7 @@ func (mm *ManageMachine) UpdateMachinesInDB(ctx context.Context, siteIDStr strin InventoryReceived: &curTime, }) if serr != nil { - logger.Error().Err(err).Msg("failed to update Site status in DB") + logger.Error().Err(serr).Msg("failed to update Site status in DB") } } diff --git a/rest-api/workflow/pkg/activity/operatingsystem/operatingsystem.go b/rest-api/workflow/pkg/activity/operatingsystem/operatingsystem.go index 6552a46838..f72bd635e5 100644 --- a/rest-api/workflow/pkg/activity/operatingsystem/operatingsystem.go +++ b/rest-api/workflow/pkg/activity/operatingsystem/operatingsystem.go @@ -174,7 +174,7 @@ func (mskg ManageOsImage) UpdateOsImagesInDB(ctx context.Context, siteID uuid.UU if ossaStatus != ossa.Status { serr := mskg.updateOperatingSystemSiteAssociationStatusInDB(ctx, nil, ossa.ID, cdb.GetStrPtr(ossaStatus), ossaStatusMessage) if serr != nil { - slogger.Error().Err(err).Msg("failed to update OS Image Site Association status detail in DB") + slogger.Error().Err(serr).Msg("failed to update OS Image Site Association status detail in DB") } updatedOperatingSystemMap[ossa.OperatingSystemID] = true } @@ -211,7 +211,7 @@ func (mskg ManageOsImage) UpdateOsImagesInDB(ctx context.Context, siteID uuid.UU // Trigger re-evaluation of Operating System status (delete if no association exists) serr = mskg.UpdateOperatingSystemStatusInDB(ctx, ossa.OperatingSystemID) if serr != nil { - slogger.Error().Err(err).Msg("failed to trigger Operating System status update in DB") + slogger.Error().Err(serr).Msg("failed to trigger Operating System status update in DB") } } else { // Was this created within inventory receipt interval? If so, we may be processing an older inventory @@ -235,7 +235,7 @@ func (mskg ManageOsImage) UpdateOsImagesInDB(ctx context.Context, siteID uuid.UU serr = mskg.updateOperatingSystemSiteAssociationStatusInDB(ctx, nil, ossa.ID, cdb.GetStrPtr(cdbm.OperatingSystemSiteAssociationStatusError), cdb.GetStrPtr("Operating System is missing on Site")) if serr != nil { - slogger.Error().Err(err).Msg("failed to update Operating System Site Association status detail in DB") + slogger.Error().Err(serr).Msg("failed to update Operating System Site Association status detail in DB") } updatedOperatingSystemMap[ossa.OperatingSystemID] = true diff --git a/rest-api/workflow/pkg/activity/sshkeygroup/sshkeygroup.go b/rest-api/workflow/pkg/activity/sshkeygroup/sshkeygroup.go index 867720c09c..db40af67a1 100644 --- a/rest-api/workflow/pkg/activity/sshkeygroup/sshkeygroup.go +++ b/rest-api/workflow/pkg/activity/sshkeygroup/sshkeygroup.go @@ -395,7 +395,7 @@ func (mskg ManageSSHKeyGroup) UpdateSSHKeyGroupsInDB(ctx context.Context, siteID serr = mskg.updateSSHKeyGroupSiteAssociationStatusInDB(ctx, nil, skgsa.ID, cdb.GetStrPtr(cdbm.SSHKeyGroupSiteAssociationStatusError), cdb.GetStrPtr("SSHKeyGroup is missing on Site")) if serr != nil { - slogger.Error().Err(err).Msg("failed to update SSH Key Group Site Association status detail in DB") + slogger.Error().Err(serr).Msg("failed to update SSH Key Group Site Association status detail in DB") } updatedSkgMap[skgID] = true @@ -413,7 +413,7 @@ func (mskg ManageSSHKeyGroup) UpdateSSHKeyGroupsInDB(ctx context.Context, siteID // but the status is not synced, so we need to sync it serr := mskg.updateSSHKeyGroupSiteAssociationStatusInDB(ctx, nil, skgsa.ID, cdb.GetStrPtr(cdbm.SSHKeyGroupSiteAssociationStatusSynced), cdb.GetStrPtr("SSH Key Group has successfully been synced with Site")) if serr != nil { - slogger.Error().Err(err).Msg("failed to update SSH Key Group status detail in DB") + slogger.Error().Err(serr).Msg("failed to update SSH Key Group status detail in DB") } updatedSkgMap[skgID] = true diff --git a/rest-api/workflow/pkg/activity/vpcprefix/vpcprefix.go b/rest-api/workflow/pkg/activity/vpcprefix/vpcprefix.go index 4d92b51e00..a8533d1fb2 100644 --- a/rest-api/workflow/pkg/activity/vpcprefix/vpcprefix.go +++ b/rest-api/workflow/pkg/activity/vpcprefix/vpcprefix.go @@ -187,7 +187,7 @@ func (mvp ManageVpcPrefix) UpdateVpcPrefixesInDB(ctx context.Context, siteID uui serr = mvp.updateVpcPrefixStatusInDB(ctx, nil, vpcPrefix.ID, cdb.GetStrPtr(cdbm.VpcPrefixStatusError), cdb.GetStrPtr("VPC Prefix is missing on Site")) if serr != nil { - slogger.Error().Err(err).Msg("failed to update VPC Prefix status detail in DB") + slogger.Error().Err(serr).Msg("failed to update VPC Prefix status detail in DB") } } }