alibabacloud-oss-manage-network-probe

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Detailed description of the scenario's application and purpose.

场景应用与用途详细说明

Diagnose network connectivity, upload/download bandwidth, download time, and local symlink anomalies between the local workstation and OSS using
ossutil 2.0
integrated with the Alibaba Cloud CLI.
Architecture: Local Workstation + Alibaba Cloud CLI 3.3.3+ +
aliyun ossutil
+ OSS Bucket + Optional target object or presigned URL + Optional probe domain
ScenarioRecommended CommandOutput
Upload connectivity probe
aliyun ... ossutil probe --upload
Upload duration, object name, log file
Download connectivity probe
aliyun ... ossutil probe --download
Download duration, local file path, log file
Upload bandwidth suggestion
aliyun ... ossutil probe --probe-item upload-speed
Suggested concurrency value
Download bandwidth suggestion
aliyun ... ossutil probe --probe-item download-speed
Suggested concurrency value
Download time measurement
aliyun ... ossutil probe --probe-item download-time
Concurrency/part-size/duration statistics
Symlink anomaly check
aliyun ... ossutil probe --probe-item cycle-symlink
Whether abnormal symlinks exist
Important implementation boundary
  • probe
    is a composite client-side diagnostic command provided by
    aliyun ossutil
    ; there is no equivalent
    aliyun oss api probe
    .
  • cycle-symlink
    can only detect abnormal symlinks — it cannot safely auto-fix target paths.
  • Probe output can locate symptoms and suggest concurrency, but cannot guarantee an automatic precise root cause for all network anomalies.
  • download-speed
    requires a real existing object, and the official recommendation is objects larger than 5 MiB. If no suitable object exists, the user must first confirm an existing object path, or confirm a local file to upload via
    aliyun ossutil cp
    before probing.
使用集成在阿里云CLI中的
ossutil 2.0
诊断本地工作站与OSS之间的网络连通性、上传/下载带宽、下载时间以及本地软链接异常。
架构:本地工作站 + 阿里云CLI 3.3.3+ +
aliyun ossutil
+ OSS Bucket + 可选目标对象或预签名URL + 可选探测域名
场景推荐命令输出
上传连通性探测
aliyun ... ossutil probe --upload
上传时长、对象名称、日志文件
下载连通性探测
aliyun ... ossutil probe --download
下载时长、本地文件路径、日志文件
上传带宽建议
aliyun ... ossutil probe --probe-item upload-speed
推荐并发值
下载带宽建议
aliyun ... ossutil probe --probe-item download-speed
推荐并发值
下载时长测算
aliyun ... ossutil probe --probe-item download-time
并发/分片大小/时长统计数据
软链接异常检查
aliyun ... ossutil probe --probe-item cycle-symlink
是否存在异常软链接
重要使用边界
  • probe
    aliyun ossutil
    提供的复合客户端诊断命令,不存在对应的
    aliyun oss api probe
    接口。
  • cycle-symlink
    仅能检测异常软链接,无法安全自动修复目标路径。
  • 探测输出可定位问题现象并给出并发建议,但无法保证自动精准定位所有网络异常的根因。
  • download-speed
    需要真实存在的对象,官方建议使用5 MiB以上的对象。如果没有合适的对象,用户必须先确认现有对象路径,或者先通过
    aliyun ossutil cp
    上传本地文件后再进行探测。

Installation

安装

Pre-check: Aliyun CLI >= 3.3.3 required Run
aliyun version
to verify >= 3.3.3. If not installed or version too low, see
references/cli-installation-guide.md
for installation instructions. Then run the credential gate
aliyun configure list
. Only after
configure list
shows a valid profile
, run
aliyun configure set --auto-plugin-install true
and
aliyun ossutil version
.
Run the version and credential gate first:
bash
aliyun version
aliyun configure list
Only after
configure list
confirms a valid profile, proceed:
bash
aliyun configure set --auto-plugin-install true
aliyun configure ai-mode enable
aliyun ossutil version
AI safety mode:
configure ai-mode enable
activates the CLI's built-in safety guard, which blocks dangerous operations (e.g. deleting critical resources) at the CLI level. This must be enabled before executing any ossutil commands.
前置检查:需要阿里云CLI版本 >= 3.3.3 执行
aliyun version
确认版本不低于3.3.3。如果未安装或版本过低,参考
references/cli-installation-guide.md
的安装说明操作。 然后执行凭证校验命令
aliyun configure list
仅当
configure list
显示有效配置文件后
,再执行
aliyun configure set --auto-plugin-install true
aliyun ossutil version
先执行版本和凭证校验命令:
bash
aliyun version
aliyun configure list
仅当
configure list
确认存在有效配置文件后,再继续执行:
bash
aliyun configure set --auto-plugin-install true
aliyun configure ai-mode enable
aliyun ossutil version
AI安全模式
configure ai-mode enable
会激活CLI内置的安全防护机制,在CLI层面拦截危险操作(例如删除关键资源)。执行任何ossutil命令前必须先启用该模式。

Environment Variables

环境变量

Environment VariableRequired/OptionalDescriptionDefault Value
ALIBABA_CLOUD_PROFILE
OptionalSpecify which CLI profile to useCurrent default profile
HTTP_PROXY
OptionalHTTP proxy address in proxied environmentsNone
HTTPS_PROXY
OptionalHTTPS proxy address in proxied environmentsNone
NO_PROXY
OptionalProxy bypass listNone
环境变量必填/可选说明默认值
ALIBABA_CLOUD_PROFILE
可选指定使用的CLI配置文件当前默认配置文件
HTTP_PROXY
可选代理环境下的HTTP代理地址
HTTPS_PROXY
可选代理环境下的HTTPS代理地址
NO_PROXY
可选代理绕过列表

Parameter Confirmation

参数确认

IMPORTANT: Parameter Confirmation — Before executing any command or API call, ALL user-customizable parameters (e.g., RegionId, instance names, CIDR blocks, passwords, domain names, resource specifications, etc.) MUST be confirmed with the user. Do NOT assume or use default values without explicit user approval.
Parameter NameRequired/OptionalDescriptionDefault Value
profile
OptionalCLI profile to useCurrent default profile
region_id
OptionalRegion where the bucket is located; use when auto-detection is unreliable or explicit specification is neededNone
bucket_name
Required for bucket-based probesTarget bucket nameNone
object_name
Required for
download-speed
and
download-time
; optional for other bucket-based probes
Full object path, e.g.
dir/example.txt
; for
download-speed
, objects larger than 5 MiB are recommended for stable results
None
local_path
OptionalLocal upload file path, symlink scan directory, or download save pathNone
download_url
Required for URL-based download probePublic-read URL or signed private URLNone
endpoint
OptionalUse only when the user explicitly provides it or the error message clearly points to a specific endpointNone
addr
OptionalDomain for
--addr
network connectivity check
www.aliyun.com
only if user explicitly accepts
upmode
OptionalUpload probe mode
normal
runtime
OptionalMax runtime in seconds for
upload-speed
/
download-speed
CLI default
parallel
OptionalSingle-file concurrency for
download-time
1
part_size
OptionalPart size in bytes for
download-time
CLI auto/default
重要提示:参数确认 — 执行任何命令或API调用前,所有用户可自定义参数(例如RegionId、实例名称、CIDR块、密码、域名、资源规格等)必须与用户确认。未经用户明确许可,不得假设或使用默认值。
参数名称必填/可选说明默认值
profile
可选使用的CLI配置文件当前默认配置文件
region_id
可选Bucket所在的地域,自动检测不可靠或需要明确指定时使用
bucket_name
基于Bucket的探测必填目标Bucket名称
object_name
download-speed
download-time
场景必填,其他基于Bucket的探测可选
对象完整路径,例如
dir/example.txt
download-speed
场景建议使用5 MiB以上的对象以获得稳定结果
local_path
可选本地上传文件路径、软链接扫描目录或下载保存路径
download_url
基于URL的下载探测必填公共读URL或签名后的私有URL
endpoint
可选仅当用户明确提供或错误信息明确指向特定endpoint时使用
addr
可选
--addr
网络连通性检查的域名
仅当用户明确同意时使用
www.aliyun.com
upmode
可选上传探测模式
normal
runtime
可选
upload-speed
/
download-speed
的最大运行时长,单位为秒
CLI默认值
parallel
可选
download-time
场景的单文件并发数
1
part_size
可选
download-time
场景的分片大小,单位为字节
CLI自动/默认值

Authentication

身份认证

Pre-check: Alibaba Cloud Credentials Required
Security Rules:
  • NEVER read, echo, or print AK/SK values (e.g.,
    echo $ALIBABA_CLOUD_ACCESS_KEY_ID
    is FORBIDDEN)
  • NEVER ask the user to input AK/SK directly in the conversation or command line
  • NEVER use
    aliyun configure set
    with literal credential values
  • NEVER read credential files such as
    ~/.aliyun/config.json
    , or dump environment variables to inspect credentials
  • NEVER write a full presigned URL with query-string signature parameters into logs or final output; if you must mention it, redact everything after
    ?
  • ONLY use
    aliyun configure list
    to check credential status
bash
aliyun configure list
Check the output for a valid profile (AK, STS, or OAuth identity).
If no valid profile exists, STOP here.
  1. Obtain credentials from Alibaba Cloud Console
  2. Configure credentials outside of this session (via
    aliyun configure
    in terminal or environment variables in shell profile)
  3. Return and re-run after
    aliyun configure list
    shows a valid profile
If multiple profiles exist, explicitly add
--profile <profile>
in subsequent commands, placed after
aliyun
and before
ossutil
, e.g.
aliyun --profile <profile> ossutil version
.
前置检查:需要阿里云凭证
安全规则:
  • 严禁读取、回显或打印AK/SK值(例如禁止执行
    echo $ALIBABA_CLOUD_ACCESS_KEY_ID
  • 严禁要求用户在对话或命令行中直接输入AK/SK
  • 严禁使用字面量凭证值执行
    aliyun configure set
    命令
  • 严禁读取
    ~/.aliyun/config.json
    等凭证文件,或导出环境变量查看凭证
  • 严禁将带有查询字符串签名参数的完整预签名URL写入日志或最终输出;如果必须提及,隐藏
    ?
    之后的所有内容
  • 仅可使用
    aliyun configure list
    检查凭证状态
bash
aliyun configure list
检查输出中是否存在有效配置文件(AK、STS或OAuth身份)。
如果不存在有效配置文件,立即停止操作。
  1. 阿里云控制台获取凭证
  2. 在当前会话之外配置凭证(通过终端执行
    aliyun configure
    或在shell配置文件中设置环境变量)
  3. aliyun configure list
    显示有效配置文件后,返回重新执行
如果存在多个配置文件,在后续命令中显式添加
--profile <profile>
参数,放在
aliyun
之后、
ossutil
之前,例如
aliyun --profile <profile> ossutil version

RAM Policy

RAM权限策略

The minimum OSS permissions required by this skill depend on the probe mode. Refer to
references/ram-polices.md
for per-scenario permission tables and policy examples.
  • Upload probes, upload bandwidth probes, temporary object probes: require at least
    oss:GetObject
    ,
    oss:PutObject
    ,
    oss:DeleteObject
  • Download probes, download bandwidth probes, download time probes: require at least
    oss:GetObject
  • If using
    aliyun ossutil cp
    to pre-upload a test object: requires
    oss:PutObject
  • If using
    aliyun ossutil rm
    to clean up an explicitly specified test object: requires
    oss:DeleteObject
本技能所需的最低OSS权限取决于探测模式。各场景的权限表和策略示例参考
references/ram-polices.md
  • 上传探测、上传带宽探测、临时对象探测:至少需要
    oss:GetObject
    oss:PutObject
    oss:DeleteObject
    权限
  • 下载探测、下载带宽探测、下载时长探测:至少需要
    oss:GetObject
    权限
  • 如果使用
    aliyun ossutil cp
    预上传测试对象:需要
    oss:PutObject
    权限
  • 如果使用
    aliyun ossutil rm
    清理明确指定的测试对象:需要
    oss:DeleteObject
    权限

Core Workflow

核心工作流

1. Validate the CLI environment

1. 校验CLI环境

Execute in the following order — do not skip steps:
  1. Check CLI version first:
bash
aliyun version
  1. Then check credentials/profile:
bash
aliyun configure list
  1. If
    configure list
    does not show a valid profile, or reports a missing config file, STOP immediately.
    • Do NOT proceed with
      configure set --auto-plugin-install true
    • Do NOT proceed with
      ossutil version
    • Do NOT fabricate bucket, object, profile, region, or probe success results
  2. Only after the profile is valid, proceed to prepare the plugin, enable AI safety mode, and verify
    ossutil
    :
bash
aliyun configure set --auto-plugin-install true
aliyun configure ai-mode enable
aliyun ossutil version
按以下顺序执行,不得跳过步骤:
  1. 首先检查CLI版本:
bash
aliyun version
  1. 然后检查凭证/配置文件:
bash
aliyun configure list
  1. 如果
    configure list
    未显示有效配置文件,或提示配置文件缺失,立即停止操作。
    • 不得继续执行
      configure set --auto-plugin-install true
    • 不得继续执行
      ossutil version
    • 不得伪造Bucket、对象、配置文件、地域或探测成功结果
  2. 仅当配置文件有效后,再继续准备插件、启用AI安全模式并校验
    ossutil
bash
aliyun configure set --auto-plugin-install true
aliyun configure ai-mode enable
aliyun ossutil version

1.1 Log file naming and command substitution

1.1 日志文件命名和命令替换

  • When saving execution logs, use static strings for filenames (e.g.
    probe_download_time.log
    ). Do not use
    $(date ...)
    ,
    $(...)
    , or backtick shell command substitutions in filenames
    , because different execution environments have inconsistent shell interpolation support, which can easily cause syntax errors.
  • Some execution environments block
    $()
    command substitution entirely. When you need to capture command output into a variable (e.g. for presigned URLs), use the file+script pattern: redirect output to a temporary file, then create a shell script that reads the file and uses the value. See §B for a concrete example.
  • 保存执行日志时,文件名使用静态字符串(例如
    probe_download_time.log
    )。文件名中不得使用
    $(date ...)
    $(...)
    或反引号shell命令替换
    ,因为不同执行环境的shell插值支持不一致,容易引发语法错误。
  • 部分执行环境完全禁止
    $()
    命令替换。当需要将命令输出捕获到变量中(例如预签名URL场景),使用文件+脚本模式:将输出重定向到临时文件,然后创建读取该文件并使用值的shell脚本。具体示例参考§B。

2. Choose the probe mode

2. 选择探测模式

A. Upload connectivity probe

A. 上传连通性探测

  • If the user only wants network/upload connectivity diagnostics without keeping the object, omit
    local_path
    and
    object_name
    and let
    probe
    use a temporary file that is auto-cleaned after completion.
  • If the user wants to verify a specific real file's upload path, confirm
    local_path
    .
  • If the upload probe returns
    AccessDenied
    , quote the error as-is and explain that at least
    oss:GetObject
    ,
    oss:PutObject
    ,
    oss:DeleteObject
    are required; do not enumerate buckets, regions, or fall back to legacy command forms.
bash
aliyun ossutil probe \
  --upload "<LOCAL_PATH_IF_ANY>" \
  --bucket "<BUCKET_NAME>" \
  --object "<OBJECT_NAME_IF_USER_WANTS_TO_KEEP_IT>" \
  --addr "<ADDR_IF_CONFIRMED>" \
  --upmode "<UPMODE_IF_CONFIRMED>" \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills
When
LOCAL_PATH_IF_ANY
is not provided, remove that positional parameter entirely — do not pass an empty string.
  • 如果用户仅需要网络/上传连通性诊断,不需要保留对象,可省略
    local_path
    object_name
    ,让
    probe
    使用执行完成后自动清理的临时文件。
  • 如果用户需要验证特定真实文件的上传路径,确认
    local_path
    参数。
  • 如果上传探测返回
    AccessDenied
    ,原封不动引用错误信息,并说明至少需要
    oss:GetObject
    oss:PutObject
    oss:DeleteObject
    权限;不要枚举Bucket、地域,或回退到旧版本命令格式。
bash
aliyun ossutil probe \
  --upload "<LOCAL_PATH_IF_ANY>" \
  --bucket "<BUCKET_NAME>" \
  --object "<OBJECT_NAME_IF_USER_WANTS_TO_KEEP_IT>" \
  --addr "<ADDR_IF_CONFIRMED>" \
  --upmode "<UPMODE_IF_CONFIRMED>" \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills
如果未提供
LOCAL_PATH_IF_ANY
,直接移除该位置参数,不要传入空字符串。

B. Download probe via URL

B. 基于URL的下载探测

  • Public-read objects: have the user confirm a directly accessible URL.
  • Private objects: generate a presigned URL first, then run
    probe --download --url
    .
Generate a presigned URL, save it to a temporary file, then run the probe via a shell script. This two-step approach avoids exposing the full URL in command history and works in environments where
$()
command substitution is blocked.
Step 1 — Generate the presigned URL and redirect output to a temporary file:
bash
aliyun ossutil presign \
  "oss://<BUCKET_NAME>/<OBJECT_NAME>" \
  --expires-duration 1h \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills > /tmp/_presign_url.txt
Step 2 — Create a probe script that reads the URL from the file and runs the download probe:
bash
cat > /tmp/_run_presign_probe.sh << 'PROBE_SCRIPT'
#!/bin/bash
PRESIGN_URL=$(cat /tmp/_presign_url.txt)
aliyun ossutil probe \
  --download \
  --url "$PRESIGN_URL" \
  "<LOCAL_PATH_IF_USER_WANTS_TO_RENAME>" \
  --user-agent AlibabaCloud-Agent-Skills
PROBE_SCRIPT
bash /tmp/_run_presign_probe.sh
Important — you MUST use
probe --download --url
with the presigned URL
:
  • Never copy-paste the full presigned URL directly into the
    --url
    parameter — use the file+script pattern above so the URL is never exposed in command history or execution logs.
  • If
    /tmp/
    is not writable, use the current workspace directory for the temporary file and script instead.
--url
only accepts HTTP/HTTPS URLs — it cannot take
oss://bucket/object
.
  • A successful
    ossutil presign
    only means the signed URL was generated; it does not guarantee the bucket or object exists, nor that the subsequent download will succeed.
  • If you need to log the execution, do not persist the full presigned URL; at most keep the object address without the query string, or redact all signature parameters after
    ?
    .
  • If
    probe --download --url
    returns 404/403, quote the raw HTTP error first; if the bucket/object was already confirmed input, you may do one
    ossutil stat
    validation with the same
    bucket + object + region
    . Do not try to "guess" the root cause by listing buckets, trying random regions, or reading local credential files.
  • 公共读对象:让用户确认可直接访问的URL。
  • 私有对象:首先生成预签名URL,然后执行
    probe --download --url
生成预签名URL,保存到临时文件,然后通过shell脚本执行探测。这种两步式方案可避免完整URL暴露在命令历史中,同时适用于禁止
$()
命令替换的环境。
步骤1 — 生成预签名URL并将输出重定向到临时文件:
bash
aliyun ossutil presign \
  "oss://<BUCKET_NAME>/<OBJECT_NAME>" \
  --expires-duration 1h \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills > /tmp/_presign_url.txt
步骤2 — 创建探测脚本,从文件中读取URL并执行下载探测:
bash
cat > /tmp/_run_presign_probe.sh << 'PROBE_SCRIPT'
#!/bin/bash
PRESIGN_URL=$(cat /tmp/_presign_url.txt)
aliyun ossutil probe \
  --download \
  --url "$PRESIGN_URL" \
  "<LOCAL_PATH_IF_USER_WANTS_TO_RENAME>" \
  --user-agent AlibabaCloud-Agent-Skills
PROBE_SCRIPT
bash /tmp/_run_presign_probe.sh
重要提示 — 必须将预签名URL配合
probe --download --url
使用
  • 严禁直接将完整预签名URL复制粘贴到
    --url
    参数中 — 使用上述的文件+脚本模式,避免URL暴露在命令历史或执行日志中。
  • 如果
    /tmp/
    不可写,改用当前工作目录存放临时文件和脚本。
--url
仅接受HTTP/HTTPS URL — 不能传入
oss://bucket/object
格式的地址。
  • ossutil presign
    执行成功仅表示签名URL生成成功,不保证Bucket或对象存在,也不保证后续下载会成功。
  • 如果需要记录执行日志,不要持久化完整预签名URL;最多保留不带查询字符串的对象地址,或隐藏
    ?
    之后的所有签名参数。
  • 如果
    probe --download --url
    返回404/403,首先引用原始HTTP错误;如果已经确认过Bucket/对象输入,可以使用相同的
    Bucket + 对象 + 地域
    执行一次
    ossutil stat
    校验。不要通过列出Bucket、尝试随机地域、读取本地凭证文件的方式来“猜测”根因。

C. Download probe via Bucket/Object

C. 基于Bucket/对象的下载探测

  • If the user confirmed
    object_name
    , the command will download that object directly.
  • If the user does not provide
    object_name
    ,
    probe
    will create a temporary object, download it, and delete the temporary object after completion.
bash
aliyun ossutil probe \
  --download \
  --bucket "<BUCKET_NAME>" \
  --object "<OBJECT_NAME_IF_ANY>" \
  --addr "<ADDR_IF_CONFIRMED>" \
  "<LOCAL_PATH_IF_USER_WANTS_TO_RENAME>" \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills
  • If the command reports
    NoSuchBucket
    ,
    NoSuchKey
    , or other object-level errors, prefer running
    ossutil stat "oss://<BUCKET_NAME>/<OBJECT_NAME>" --region "<REGION_ID_IF_NEEDED>"
    for same-target validation.
  • Do not list all buckets, try unconfirmed regions, or switch to
    aliyun oss api
    /
    GetBucketLocation
    or other commands outside this skill's scope to confirm whether the object exists.
  • 如果用户确认了
    object_name
    ,命令会直接下载该对象。
  • 如果用户未提供
    object_name
    probe
    会创建临时对象,下载完成后自动删除临时对象。
bash
aliyun ossutil probe \
  --download \
  --bucket "<BUCKET_NAME>" \
  --object "<OBJECT_NAME_IF_ANY>" \
  --addr "<ADDR_IF_CONFIRMED>" \
  "<LOCAL_PATH_IF_USER_WANTS_TO_RENAME>" \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills
  • 如果命令返回
    NoSuchBucket
    NoSuchKey
    或其他对象级错误,优先执行
    ossutil stat "oss://<BUCKET_NAME>/<OBJECT_NAME>" --region "<REGION_ID_IF_NEEDED>"
    进行同目标校验。
  • 不要列出所有Bucket、尝试未确认的地域,或切换到
    aliyun oss api
    /
    GetBucketLocation
    等超出本技能范围的命令来确认对象是否存在。

D. Local symlink anomaly probe

D. 本地软链接异常探测

This mode only checks local directory/file paths — it does not access OSS.
bash
aliyun ossutil probe \
  --probe-item cycle-symlink \
  "<LOCAL_DIRECTORY_OR_FILE>" \
  --user-agent AlibabaCloud-Agent-Skills
  • If the command returns
    stat <path>: no such file or directory
    , explicitly state that the local path does not exist in the current execution environment; this is still a local-only flow with no OSS access.
  • When the local path does not exist, you must NEVER:
    • Interpret it as "this is a containerized/sandbox environment limitation"
    • Automatically rewrite it as "the user should run on another machine/production environment"
    • Generate a script file saying "run this command in the correct environment"
    • Check the parent directory with
      ls
      and then give up
    Correct approach: Quote the raw error
    stat <path>: no such file or directory
    , explicitly tell the user the path does not exist in the current environment, and ask whether they provided the correct path. Unless the user proactively states the current session is not on the target machine, do not make that judgment for them.
When reporting results of this probe, include at minimum:
  • This is a local-only flow — no OSS access occurred
  • Which symlinks are abnormal and which link chains were directly verified; if only partial chains can be verified, clearly distinguish "confirmed chain segments" from "anomaly points proven by probe errors", e.g.
    loop-b -> loop-a
    , and resolving
    loop-a
    reports
    too many levels of symbolic links
  • If the probe output contains raw errors, quote at least one key error, e.g.
    too many levels of symbolic links
  • Minimum fix prerequisites, e.g. break one of the cyclic links or re-point the abnormal link to a real target before retrying
If you need to clarify the abnormal link chain, you may perform read-only local forensics on the same path (e.g.
readlink
,
stat -f "%N -> %Y"
). Only write precise chains when these supplementary results are actually readable; if the supplementary forensics itself fails, report only verified segments — do not fabricate a complete cycle.
If the output lists abnormal symlinks, the user or a local script must fix them according to business semantics; this skill does not auto-rewrite symlink targets.
该模式仅检查本地目录/文件路径 — 不会访问OSS。
bash
aliyun ossutil probe \
  --probe-item cycle-symlink \
  "<LOCAL_DIRECTORY_OR_FILE>" \
  --user-agent AlibabaCloud-Agent-Skills
  • 如果命令返回
    stat <path>: no such file or directory
    ,明确说明当前执行环境中不存在该本地路径;该流程仍为纯本地流程,未访问OSS。
  • 当本地路径不存在时,严禁执行以下操作
    • 将其解释为“这是容器化/沙箱环境的限制”
    • 自动改写为“用户应该在其他机器/生产环境运行”
    • 生成脚本文件提示“在正确环境中运行该命令”
    • ls
      检查父目录后直接放弃
    正确处理方式:引用原始错误
    stat <path>: no such file or directory
    ,明确告知用户当前环境中不存在该路径,询问用户是否提供了正确路径。除非用户主动说明当前会话不在目标机器上,不要替用户做出该判断。
上报该探测结果时,至少包含以下内容:
  • 该流程为纯本地流程 — 未发生OSS访问
  • 哪些软链接存在异常,以及哪些链接链是直接验证过的;如果仅能验证部分链,明确区分“已确认的链段”和“探测错误证明的异常点”,例如
    loop-b -> loop-a
    ,解析
    loop-a
    时返回
    too many levels of symbolic links
  • 如果探测输出包含原始错误,至少引用一个关键错误,例如
    too many levels of symbolic links
  • 最低修复前提,例如断开其中一个循环链接,或将异常链接重新指向真实目标后重试
如果需要明确异常链接链,可以对同一路径执行只读本地排查(例如
readlink
stat -f "%N -> %Y"
)。仅当这些补充结果实际可读取时,才写入精确的链接链;如果补充排查本身失败,仅上报已验证的链段 — 不要伪造完整循环。
如果输出列出了异常软链接,必须由用户或本地脚本根据业务语义修复;本技能不会自动重写软链接目标。

E. Upload bandwidth probe with suggested concurrency

E. 上传带宽探测(带推荐并发值)

Basic command:
bash
aliyun ossutil probe \
  --probe-item upload-speed \
  --bucket "<BUCKET_NAME>" \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills
To limit runtime, add:
bash
aliyun ossutil probe \
  --probe-item upload-speed \
  --bucket "<BUCKET_NAME>" \
  --runtime "<RUNTIME_IF_CONFIRMED>" \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills
Successful output will contain
suggest parallel is <N>
.
基础命令:
bash
aliyun ossutil probe \
  --probe-item upload-speed \
  --bucket "<BUCKET_NAME>" \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills
如需限制运行时长,添加对应参数:
bash
aliyun ossutil probe \
  --probe-item upload-speed \
  --bucket "<BUCKET_NAME>" \
  --runtime "<RUNTIME_IF_CONFIRMED>" \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills
执行成功的输出会包含
suggest parallel is <N>

F. Download bandwidth probe with suggested concurrency

F. 下载带宽探测(带推荐并发值)

  • object_name
    is required.
  • Official recommendation: target object should be larger than 5 MiB.
  • If the user has no suitable object, first confirm a local file path, then upload a cleanable test object via
    aliyun ossutil cp
    .
Optional preparation step:
bash
aliyun ossutil cp \
  "<LOCAL_FILE_TO_UPLOAD>" \
  "oss://<BUCKET_NAME>/<OBJECT_NAME>" \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills
Run download bandwidth probe:
bash
aliyun ossutil probe \
  --probe-item download-speed \
  --bucket "<BUCKET_NAME>" \
  --object "<OBJECT_NAME>" \
  --runtime "<RUNTIME_IF_CONFIRMED>" \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills
  • object_name
    为必填参数。
  • 官方建议:目标对象应大于5 MiB。
  • 如果用户没有合适的对象,首先确认本地文件路径,然后通过
    aliyun ossutil cp
    上传可清理的测试对象。
可选准备步骤:
bash
aliyun ossutil cp \
  "<LOCAL_FILE_TO_UPLOAD>" \
  "oss://<BUCKET_NAME>/<OBJECT_NAME>" \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills
执行下载带宽探测:
bash
aliyun ossutil probe \
  --probe-item download-speed \
  --bucket "<BUCKET_NAME>" \
  --object "<OBJECT_NAME>" \
  --runtime "<RUNTIME_IF_CONFIRMED>" \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills

G. Download time probe

G. 下载时长探测

Basic command:
bash
aliyun ossutil probe \
  --probe-item download-time \
  --bucket "<BUCKET_NAME>" \
  --object "<OBJECT_NAME>" \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills
To explicitly control concurrency and part size, add:
bash
aliyun ossutil probe \
  --probe-item download-time \
  --bucket "<BUCKET_NAME>" \
  --object "<OBJECT_NAME>" \
  --parallel "<PARALLEL_IF_CONFIRMED>" \
  --part-size "<PART_SIZE_IF_CONFIRMED>" \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills
--parallel
and
--part-size
are only meaningful in the
download-time
scenario; do not misuse them with
upload-speed
.
基础命令:
bash
aliyun ossutil probe \
  --probe-item download-time \
  --bucket "<BUCKET_NAME>" \
  --object "<OBJECT_NAME>" \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills
如需显式控制并发数和分片大小,添加对应参数:
bash
aliyun ossutil probe \
  --probe-item download-time \
  --bucket "<BUCKET_NAME>" \
  --object "<OBJECT_NAME>" \
  --parallel "<PARALLEL_IF_CONFIRMED>" \
  --part-size "<PART_SIZE_IF_CONFIRMED>" \
  --region "<REGION_ID_IF_NEEDED>" \
  --user-agent AlibabaCloud-Agent-Skills
--parallel
--part-size
仅在
download-time
场景下有意义,不要在
upload-speed
场景中误用。

3. Interpret the output

3. 解读输出

  • When upload/download probes succeed, the output will contain
    upload file:success
    or
    download file:success
  • When bandwidth probes succeed, the output will contain multiple
    parallel:<N>
    statistics and
    suggest parallel is <N>
  • When download time probes succeed, the output will contain
    total bytes
    ,
    cost
    ,
    avg speed
  • All probe modes typically generate a
    logOssProbe*.log
    local log file; after probe execution, you must check whether
    logOssProbe*.log
    was generated in the current directory
    and report the log path in the final answer
  • If a real command returns an error or has no success marker, the final conclusion must explicitly state failure/blocked and quote the raw error message — do not write "task completed successfully" or describe a failure as successful verification
  • When a command fails, the final answer must explicitly state the termination reason (e.g. "stopped due to AccessDenied", "stopped due to path not found") — do not end silently
  • For errors like
    The bucket you are attempting to access must be addressed using the specified endpoint
    , this only means the current access endpoint does not match the bucket's requirements; stop immediately, ask the user to confirm the correct region/endpoint — do not infer or try other region/endpoints on your own
See
references/verification-method.md
for more detailed verification steps.
  • 上传/下载探测成功时,输出会包含
    upload file:success
    download file:success
  • 带宽探测成功时,输出会包含多个
    parallel:<N>
    统计数据和
    suggest parallel is <N>
  • 下载时长探测成功时,输出会包含
    total bytes
    cost
    avg speed
  • 所有探测模式通常会生成本地日志文件
    logOssProbe*.log
    探测执行完成后,必须检查当前目录是否生成了
    logOssProbe*.log
    ,并在最终结果中上报日志路径
  • 如果真实命令返回错误或没有成功标记,最终结论必须明确说明失败/受阻,并引用原始错误信息 — 不要写“任务执行成功”,或将失败描述为成功验证
  • 命令失败时,最终结果必须明确说明终止原因(例如“因AccessDenied终止”、“因路径不存在终止”) — 不要无声结束
  • 对于
    The bucket you are attempting to access must be addressed using the specified endpoint
    这类错误,仅表示当前访问endpoint与Bucket要求不匹配;立即停止操作,要求用户确认正确的地域/endpoint — 不要自行推断或尝试其他地域/endpoint
更详细的校验步骤参考
references/verification-method.md

Success Verification Method

成功校验方法

Follow the steps in
references/verification-method.md
to confirm each item:
  1. CLI version and profile are valid
  2. Probe output contains success markers or suggested concurrency
  3. You must run
    ls logOssProbe*.log
    to check whether log files were generated locally
    , and report the log path in the final answer; if no log files were generated, it means the probe may not have reached the actual probing stage
  4. If an explicit test object was used, confirm whether it should be retained or enter the cleanup step
  5. If any of the above steps fail, the final answer must explicitly state failure and quote the raw error with termination reason
按照
references/verification-method.md
中的步骤确认每个项:
  1. CLI版本和配置文件有效
  2. 探测输出包含成功标记或推荐并发值
  3. 必须执行
    ls logOssProbe*.log
    检查本地是否生成了日志文件
    ,并在最终结果中上报日志路径;如果未生成日志文件,说明探测可能未进入实际探测阶段
  4. 如果使用了显式测试对象,确认是否需要保留或进入清理步骤
  5. 以上任意步骤失败时,最终结果必须明确说明失败,并引用原始错误和终止原因

Cleanup

清理

  • Upload/download connectivity probes without an explicit
    --object
    will auto-clean temporary objects
  • If you explicitly uploaded a test object in the
    download-speed
    preparation step, decide whether to delete it based on user confirmation after probing
Delete an OSS test object:
bash
aliyun ossutil rm \
  "oss://<BUCKET_NAME>/<OBJECT_NAME>" \
  --user-agent AlibabaCloud-Agent-Skills
If a temporary test file was downloaded locally, it should also be deleted or retained based on user confirmation.
After all probe and cleanup steps are finished, disable AI safety mode:
bash
aliyun configure ai-mode disable
  • 未显式指定
    --object
    的上传/下载连通性探测会自动清理临时对象
  • 如果在
    download-speed
    准备步骤中显式上传了测试对象,探测完成后根据用户确认决定是否删除
删除OSS测试对象:
bash
aliyun ossutil rm \
  "oss://<BUCKET_NAME>/<OBJECT_NAME>" \
  --user-agent AlibabaCloud-Agent-Skills
如果本地下载了临时测试文件,也应根据用户确认决定删除或保留。
所有探测和清理步骤完成后,禁用AI安全模式:
bash
aliyun configure ai-mode disable

API and Command Tables

API与命令对照表

For all commands, underlying OSS capability mappings, and which steps are local client-side logic only, see
references/related-apis.md
.
所有命令、底层OSS能力映射、哪些步骤仅为本地客户端逻辑,参考
references/related-apis.md

Best Practices

最佳实践

  1. Always use
    aliyun ossutil probe
    — do not fabricate non-existent commands like
    aliyun oss api probe
  2. Confirm all user-variable parameters before execution, especially
    bucket_name
    ,
    object_name
    ,
    download_url
    ,
    local_path
  3. Only retain probe objects when the user explicitly confirms; otherwise prefer temporary objects or explicit cleanup
  4. For
    download-speed
    , choose a real object larger than 5 MiB for more stable results
  5. In proxy, dedicated line, or custom domain scenarios, explicitly confirm
    --addr
    ,
    --region
    ,
    --endpoint
  6. Use
    suggest parallel is <N>
    as an empirical baseline, then do small-scale validation combined with actual business concurrency
  7. For
    cycle-symlink
    , only diagnose — do not auto-fix
  8. After command failure, prefer same-target validation (e.g.
    ossutil stat
    ) — do not expand into listing buckets, guessing regions, trying unsupported flags, or reading local credential files
  9. Do not expose AK/SK, STS tokens, or full presigned URL query strings in logs or final results
  10. A successful presign, resolvable DNS, or reachable ping/traceroute does not guarantee the object exists or that the probe will succeed; conclusions must be based on actual probe/validation results
  1. 始终使用
    aliyun ossutil probe
    — 不要伪造
    aliyun oss api probe
    这类不存在的命令
  2. 执行前确认所有用户可变参数,尤其是
    bucket_name
    object_name
    download_url
    local_path
  3. 仅当用户明确确认时保留探测对象,否则优先使用临时对象或显式清理
  4. 对于
    download-speed
    场景,选择5 MiB以上的真实对象以获得更稳定的结果
  5. 在代理、专线或自定义域名场景下,显式确认
    --addr
    --region
    --endpoint
    参数
  6. suggest parallel is <N>
    作为经验基线,结合实际业务并发做小规模验证
  7. 对于
    cycle-symlink
    场景,仅做诊断 — 不要自动修复
  8. 命令失败后,优先做同目标校验(例如
    ossutil stat
    ) — 不要扩展到列出Bucket、猜测地域、尝试不支持的参数、读取本地凭证文件等操作
  9. 不要在日志或最终结果中暴露AK/SK、STS令牌或完整预签名URL查询字符串
  10. 预签名成功、DNS可解析、ping/traceroute可达不代表对象存在或探测会成功;结论必须基于实际探测/校验结果

Reference Links

参考链接

ReferencePurpose
references/cli-installation-guide.md
Installing and upgrading Aliyun CLI
references/verification-method.md
Checking success by probe mode
references/related-apis.md
Command to underlying OSS capability/permission mapping
references/ram-polices.md
RAM permission checklist and policy examples
references/acceptance-criteria.md
Skill acceptance criteria and counter-examples
references/implementation-boundaries.md
Boundaries that cannot be fully automated via CLI or code
参考文件用途
references/cli-installation-guide.md
安装和升级阿里云CLI
references/verification-method.md
按探测模式检查执行结果
references/related-apis.md
命令与底层OSS能力/权限映射
references/ram-polices.md
RAM权限检查清单和策略示例
references/acceptance-criteria.md
技能验收标准和反例
references/implementation-boundaries.md
无法通过CLI或代码完全自动化的边界