Tencent/WeKnora · error

bucket %q does not exist

Error message

bucket %q does not exist

What it means

S3 read-only connectivity probe: bucketExists succeeded but reported the configured bucket absent, so credentials and endpoint work yet the bucket is misconfigured; the probe never creates buckets and fails with a configuration error.

Source

Thrown at internal/application/service/file/s3.go:175

	_, err := s.client.CreateBucket(ctx, &s3.CreateBucketInput{
		Bucket: aws.String(s.bucketName),
	})
	return err
}

// CheckConnectivity verifies S3 is reachable and, if a bucket is configured,
// that the bucket exists. This is a read-only probe — it never creates a bucket.
func (s *s3FileService) CheckConnectivity(ctx context.Context) error {
	checkCtx, cancel := context.WithTimeout(ctx, 10*time.Second)
	defer cancel()

	if s.bucketName != "" {
		exists, err := s.bucketExists(checkCtx)
		if err != nil {
			return err
		}
		if !exists {
			return fmt.Errorf("bucket %q does not exist", s.bucketName)
		}
		return nil
	}

	// List buckets to verify connectivity
	_, err := s.client.ListBuckets(checkCtx, &s3.ListBucketsInput{})
	return err
}

// CheckS3Connectivity tests S3 connectivity using the provided credentials.
// It creates a temporary service instance internally and delegates to CheckConnectivity.
func CheckS3Connectivity(ctx context.Context, endpoint, accessKey, secretKey, bucketName, region string) error {
	return CheckS3ConnectivityWithOptions(ctx, endpoint, accessKey, secretKey, bucketName, region, false)
}

func CheckS3ConnectivityWithOptions(ctx context.Context, endpoint, accessKey, secretKey, bucketName, region string, forcePathStyle bool) error {
	svc, err := newS3Client(endpoint, accessKey, secretKey, bucketName, region, "", forcePathStyle)
	if err != nil {

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Create the bucket in S3 or fix the configured bucket name
  2. Verify the credentials can see the target account's buckets
  3. Surface as a configuration error, not a connectivity one
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/application/service/file/s3.go:175 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02). Data as JSON: /api/errors/69252ec3d6254051. Report an issue: GitHub.