weaviate/weaviate · error

failed to upload to GCS: %w

Error message

failed to upload to GCS: %w

What it means

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.

Source

Thrown at modules/usage-gcs/storage.go:131

	if err != nil {
		return err
	}

	objectName := g.ConstructObjectKey(usage.CollectingTime)

	_, err = g.storageService.Objects.Insert(g.BucketName, &storageapi.Object{
		Name:        objectName,
		ContentType: "application/json",
		Metadata: map[string]string{
			"version": usage.Version,
		},
	}).WithRetry(&gax.Backoff{
		Initial:    2 * time.Second, // Note: the client uses a jitter internally
		Max:        60 * time.Second,
		Multiplier: 3,
	}, gcpcommon.RetryErrorFunc).Media(bytes.NewReader(data)).Context(ctx).Do()
	if err != nil {
		return fmt.Errorf("failed to upload to GCS: %w", err)
	}

	g.RecordUploadMetrics(len(data))
	return nil
}

// Close cleans up resources
func (g *GCSStorage) Close() error {
	// storageapi.Service doesn't have a Close method
	// requests are handled by the HTTP client
	// see https://github.com/googleapis/google-cloud-go/blob/storage/v1.56.1/storage/storage.go#L154-L161
	return nil
}

// UpdateConfig updates the backend configuration from the provided config
func (g *GCSStorage) UpdateConfig(config common.StorageConfig) (bool, error) {
	// Store old bucket name to detect changes
	oldBucketName := g.BucketName

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Inspect the wrapped error for the GCS-specific cause (403, 404, auth)
  2. Verify the service account has storage.objects.create on the target bucket
  3. Confirm the bucket name in configuration exists
  4. Check network egress and quota; the built-in retries already ran, so persistent failures need manual intervention
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at modules/usage-gcs/storage.go:131 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04). Data as JSON: /api/errors/78d633e837f73496. Report an issue: GitHub.