XIU2/CloudflareSpeedTest · warning

CFST 测速结果 IP 数量为 0,跳过下面步骤...

Error message

CFST 测速结果 IP 数量为 0,跳过下面步骤...

What it means

In _UPDATE() (script/cfst_ddns.sh:34-45), after ./cfst -o result_ddns.txt runs inside ${FOLDER} (cd happens at line 64), the script checks [[ ! -e result_ddns.txt ]] at line 39. CFST only writes its output file when at least one IP passes all filters, so a missing file is equated with '0 qualifying IPs'; the script prints this message and exits 0 — a deliberate graceful skip that leaves the Cloudflare record unchanged (stale IP stays).

Source

Thrown at script/cfst_ddns.sh:39

	[[ -z "${KEY}" ]] && echo -e "[错误] 缺少配置项 [KEY] !" && exit 1
	EMAIL=$(echo "${CONFIG}"|grep 'EMAIL='|awk -F '=' '{print $NF}')
	[[ -z "${EMAIL}" ]] && echo -e "[信息] 缺少配置项 [EMAIL],由 [API 密钥] 方式转为 [API 令牌] 方式!"
	TYPE=$(echo "${CONFIG}"|grep 'TYPE='|awk -F '=' '{print $NF}')
	[[ -z "${TYPE}" ]] && echo -e "[错误] 缺少配置项 [TYPE] !" && exit 1
	NAME=$(echo "${CONFIG}"|grep 'NAME='|awk -F '=' '{print $NF}')
	[[ -z "${NAME}" ]] && echo -e "[错误] 缺少配置项 [NAME] !" && exit 1
	TTL=$(echo "${CONFIG}"|grep 'TTL='|awk -F '=' '{print $NF}')
	[[ -z "${TTL}" ]] && echo -e "[错误] 缺少配置项 [TTL] !" && exit 1
	PROXIED=$(echo "${CONFIG}"|grep 'PROXIED='|awk -F '=' '{print $NF}')
	[[ -z "${PROXIED}" ]] && echo -e "[错误] 缺少配置项 [PROXIED] !" && exit 1
}

_UPDATE() {
	# 这里可以自己添加、修改 CFST 的运行参数
	./cfst -o "result_ddns.txt"

	# 判断结果文件是否存在,如果不存在说明结果为 0
	[[ ! -e "result_ddns.txt" ]] && echo "CFST 测速结果 IP 数量为 0,跳过下面步骤..." && exit 0

	CONTENT=$(sed -n "2,1p" result_ddns.txt | awk -F, '{print $1}')
	if [[ -z "${CONTENT}" ]]; then
		echo "CFST 测速结果 IP 数量为 0,跳过下面步骤..."
		exit 0
	fi
	# 如果 EMAIL 变量是空的,那么就代表要使用 API 令牌方式
	if [[ -n "${EMAIL}" ]]; then
		# API 密钥方式(全局权限)
		curl -X PUT "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records/${DNS_RECORDS_ID}" \
			-H "X-Auth-Email: ${EMAIL}" \
			-H "X-Auth-Key: ${KEY}" \
			-H "Content-Type: application/json" \
			--data "{\"type\":\"${TYPE}\",\"name\":\"${NAME}\",\"content\":\"${CONTENT}\",\"ttl\":${TTL},\"proxied\":${PROXIED}}"
	else
		# API 令牌方式(自定义权限)
		curl -X PUT "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records/${DNS_RECORDS_ID}" \
			-H "Authorization: Bearer ${KEY}" \

View on GitHub (pinned to 1da0c025d7)

Solutions

  1. cd into ${FOLDER} and run ./cfst -o result_ddns.txt manually to see the tester's real output and exit status
  2. Verify the cfst binary is executable and ip.txt exists in that folder
  3. Relax the CFST arguments added at line 36 (raise -t, lower -sl) or refresh ip.txt
  4. Check outbound connectivity to port 443 on Cloudflare IPs; for cron, confirm FOLDER is valid from cron's working directory
  5. For retry-until-found behavior, the comment at line 37 notes replacing this exit 0 with _UPDATE

Example fix

# script/cfst_ddns.sh line 36 (before)
./cfst -o "result_ddns.txt"
# (after) fail loudly when the tester itself is broken
./cfst -o "result_ddns.txt" || { echo "cfst run failed (exit $?)"; exit 1; }
Defensive patterns

Strategy: retry

Validate before calling

cd "$(grep '^FOLDER=' cfst_ddns.conf | cut -d= -f2-)" || exit 1
[ -x ./cfst ] && [ -f ip.txt ] || { echo 'cfst binary or ip.txt missing' >&2; exit 1; }

Try / catch

if ! ./cfst -o result_ddns.txt; then echo "cfst exited $?: check filters/network" >&2; exit 1; fi

Prevention

When it happens

Trigger: cfst found no IP meeting the latency/download filters (-t/-dt/-sl/-tp); all candidate IPs failed the TCP latency stage; the cfst binary or ip.txt is missing/not executable in FOLDER so ./cfst failed and produced no file; outbound testing ports (443/80) are blocked.

Common situations: Overly strict -sl lower bound on download speed; an aged ip.txt whose IPs no longer answer; a broken FOLDER path after moving the installation (the cd at line 64 lands somewhere without cfst); ISP/firewall blocking Cloudflare ranges so every test times out.

Related errors


AI-assisted analysis of XIU2/CloudflareSpeedTest@1da0c025d7 (2026-08-15). Data as JSON: /api/errors/611d41ee2f0dad78. Report an issue: GitHub.