{"record":{"id":"3559382bd36a2b8e","repo":"thanos-io/thanos","slug":"initial-upload-failed","errorCode":null,"errorMessage":"initial upload failed","messagePattern":"initial upload failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/thanos/receive.go","lineNumber":807,"sourceCode":"\n\tif upload {\n\t\tlogger := log.With(logger, \"component\", \"uploader\")\n\t\tupload := func(ctx context.Context) error {\n\t\t\tlevel.Debug(logger).Log(\"msg\", \"upload phase starting\")\n\t\t\tstart := time.Now()\n\n\t\t\tuploaded, err := dbs.SyncAllTenants(ctx)\n\t\t\tif err != nil {\n\t\t\t\tlevel.Warn(logger).Log(\"msg\", \"upload failed\", \"elapsed\", time.Since(start), \"err\", err)\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tlevel.Debug(logger).Log(\"msg\", \"upload phase done\", \"uploaded\", uploaded, \"elapsed\", time.Since(start))\n\t\t\treturn nil\n\t\t}\n\t\t{\n\t\t\tlevel.Info(logger).Log(\"msg\", \"upload enabled, starting initial sync\")\n\t\t\tif err := upload(context.Background()); err != nil {\n\t\t\t\treturn errors.Wrap(err, \"initial upload failed\")\n\t\t\t}\n\t\t\tlevel.Info(logger).Log(\"msg\", \"initial sync done\")\n\t\t}\n\t\t{\n\t\t\tctx, cancel := context.WithCancel(context.Background())\n\t\t\tg.Add(func() error {\n\t\t\t\t// Ensure we clean up everything properly.\n\t\t\t\tdefer func() {\n\t\t\t\t\trunutil.CloseWithLogOnErr(logger, bkt, \"bucket client\")\n\t\t\t\t}()\n\n\t\t\t\tdefer close(uploadDone)\n\n\t\t\t\t// Before quitting, ensure all blocks are uploaded.\n\t\t\t\tdefer func() {\n\t\t\t\t\t<-uploadC // Closed by storage routine when it's done.\n\t\t\t\t\tlevel.Info(logger).Log(\"msg\", \"uploading the final cut block before exiting\")\n\t\t\t\t\tctx, cancel := context.WithCancel(context.Background())","sourceCodeStart":789,"sourceCodeEnd":825,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/cmd/thanos/receive.go#L789-L825","documentation":"The initial SyncAllTenants upload at receive startup failed after retries within the timeout. Blocks are not yet shipped to object storage; the uploader goroutine will keep retrying but the first failure is returned/logged.","triggerScenarios":"Thrown at cmd/thanos/receive.go:807 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check object storage credentials and connectivity","Verify bucket permissions and existence","Inspect the upload failed warning for the root cause"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}