Skip to content

S3 HEAD bucket failure: 404 Not Found (CC Switch)

Quick fix

Upgrade to 4.0 or the latest version and retry; older versions append the bucket again when the endpoint already contains it, causing an incorrect request path.

Error output
S3 HEAD bucket 失败: 404 Not Found
(https://mybucket.oss-cn-zhongwei.aliyuncs.com/mybucket/)
English translation

S3 HEAD bucket failed: 404 Not Found (https://mybucket.oss-cn-zhongwei.aliyuncs.com/mybucket/)

In CC Switch v3.18.0, `is_aws_endpoint` in `src-tauri/src/services/s3.rs` recognizes only `amazonaws.com`. The Alibaba Cloud OSS `aliyuncs.com` endpoint therefore enters the path-style branch. When the endpoint host already starts with `{bucket}.`, `build_bucket_url` and `build_object_url` still append the bucket to the path, creating a duplicate `/mybucket/`.

This causes the HEAD request to return 404. Although PUT may succeed, it writes the object under an incorrect prefix containing an extra bucket name, so GET cannot retrieve it using the correct key. The maintainer said that 4.0 substantially refactored the related functionality and recommended upgrading and retrying, but these issues do not confirm whether the upgrade resolved the problem.

  1. Update CC Switch to 4.0 or the latest version, then retest the connection with the same S3 configuration.

  2. Inspect the generated request URL and confirm that when the endpoint host already contains the bucket name, `/mybucket/` does not appear again in the path.

  3. Repeat the upload and download, and confirm that the object was not written under an extra prefix matching the bucket name.

  4. If the latest version still fails, provide the CC Switch version, operating system, complete reproduction steps, and relevant logs or screenshots, then reopen the issue.

ToolCC Switch
Version受影响版本:3.18.0;4.0 是否修复未在 issue 中确认
PlatformsLinux

(No FAQ yet)

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.