{"record":{"id":"78d633e837f73496","repo":"weaviate/weaviate","slug":"failed-to-upload-to-gcs-w","errorCode":null,"errorMessage":"failed to upload to GCS: %w","messagePattern":"failed to upload to GCS: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/usage-gcs/storage.go","lineNumber":131,"sourceCode":"\tif err != nil {\n\t\treturn err\n\t}\n\n\tobjectName := g.ConstructObjectKey(usage.CollectingTime)\n\n\t_, err = g.storageService.Objects.Insert(g.BucketName, &storageapi.Object{\n\t\tName:        objectName,\n\t\tContentType: \"application/json\",\n\t\tMetadata: map[string]string{\n\t\t\t\"version\": usage.Version,\n\t\t},\n\t}).WithRetry(&gax.Backoff{\n\t\tInitial:    2 * time.Second, // Note: the client uses a jitter internally\n\t\tMax:        60 * time.Second,\n\t\tMultiplier: 3,\n\t}, gcpcommon.RetryErrorFunc).Media(bytes.NewReader(data)).Context(ctx).Do()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to upload to GCS: %w\", err)\n\t}\n\n\tg.RecordUploadMetrics(len(data))\n\treturn nil\n}\n\n// Close cleans up resources\nfunc (g *GCSStorage) Close() error {\n\t// storageapi.Service doesn't have a Close method\n\t// requests are handled by the HTTP client\n\t// see https://github.com/googleapis/google-cloud-go/blob/storage/v1.56.1/storage/storage.go#L154-L161\n\treturn nil\n}\n\n// UpdateConfig updates the backend configuration from the provided config\nfunc (g *GCSStorage) UpdateConfig(config common.StorageConfig) (bool, error) {\n\t// Store old bucket name to detect changes\n\toldBucketName := g.BucketName","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/modules/usage-gcs/storage.go#L113-L149","documentation":"Uploading a serialized usage report object to Google Cloud Storage failed. This wraps the underlying GCS API error after retries (the insert uses exponential backoff: 2s initial, 60s max, 3x multiplier). The wrapped %w carries the real cause — auth failure, missing bucket, permission denial, or persistent network error exhausting all retries.","triggerScenarios":"Thrown at modules/usage-gcs/storage.go:131 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error for the GCS-specific cause (403, 404, auth)","Verify the service account has storage.objects.create on the target bucket","Confirm the bucket name in configuration exists","Check network egress and quota; the built-in retries already ran, so persistent failures need manual intervention"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}