diff --git a/internal/backend/remote/backend_plan.go b/internal/backend/remote/backend_plan.go index 887dd76e1a..0fdea063e6 100644 --- a/internal/backend/remote/backend_plan.go +++ b/internal/backend/remote/backend_plan.go @@ -258,19 +258,24 @@ in order to capture the filesystem context the remote workspace expects: } } + log.Printf("[TRACE] backend/remote: starting configuration upload at %q", configDir) err = b.client.ConfigurationVersions.Upload(stopCtx, cv.UploadURL, configDir) if err != nil { return nil, generalError("Failed to upload configuration files", err) } + log.Printf("[TRACE] backend/remote: finished configuration upload") uploaded := false for i := 0; i < 60 && !uploaded; i++ { select { case <-stopCtx.Done(): + log.Printf("[TRACE] backend/remote: deadline reached while waiting for configuration status") return nil, context.Canceled case <-cancelCtx.Done(): + log.Printf("[TRACE] backend/remote: operation cancelled while waiting for configuration status") return nil, context.Canceled case <-time.After(planConfigurationVersionsPollInterval): + log.Printf("[TRACE] backend/remote: reading configuration status") cv, err = b.client.ConfigurationVersions.Read(stopCtx, cv.ID) if err != nil { return nil, generalError("Failed to retrieve configuration version", err) @@ -287,6 +292,7 @@ in order to capture the filesystem context the remote workspace expects: "Failed to upload configuration files", errors.New("operation timed out")) } + log.Printf("[TRACE] backend/remote: configuration uploaded and ready") runOptions := tfe.RunCreateOptions{ ConfigurationVersion: cv, Refresh: tfe.Bool(op.PlanRefresh), diff --git a/internal/cloud/backend_plan.go b/internal/cloud/backend_plan.go index cc6205bd9b..8c59119225 100644 --- a/internal/cloud/backend_plan.go +++ b/internal/cloud/backend_plan.go @@ -197,19 +197,24 @@ in order to capture the filesystem context the remote workspace expects: } } + log.Printf("[TRACE] backend/cloud: starting configuration upload at %q", configDir) err = b.client.ConfigurationVersions.Upload(stopCtx, cv.UploadURL, configDir) if err != nil { return nil, b.generalError("Failed to upload configuration files", err) } + log.Printf("[TRACE] backend/cloud: finished configuration upload") uploaded := false for i := 0; i < 60 && !uploaded; i++ { select { case <-stopCtx.Done(): + log.Printf("[TRACE] backend/cloud: deadline reached while waiting for configuration status") return nil, context.Canceled case <-cancelCtx.Done(): + log.Printf("[TRACE] backend/cloud: operation cancelled while waiting for configuration status") return nil, context.Canceled case <-time.After(planConfigurationVersionsPollInterval): + log.Printf("[TRACE] backend/cloud: reading configuration status") cv, err = b.client.ConfigurationVersions.Read(stopCtx, cv.ID) if err != nil { return nil, b.generalError("Failed to retrieve configuration version", err) @@ -226,6 +231,7 @@ in order to capture the filesystem context the remote workspace expects: "Failed to upload configuration files", errors.New("operation timed out")) } + log.Printf("[TRACE] backend/cloud: configuration uploaded and ready") runOptions := tfe.RunCreateOptions{ ConfigurationVersion: cv, Refresh: tfe.Bool(op.PlanRefresh),