XIU2/CloudflareSpeedTest · warning
CFST 测速结果 IP 数量为 0,跳过下面步骤...
Error message
CFST 测速结果 IP 数量为 0,跳过下面步骤...
What it means
In cfst_dnsmasq.sh's _UPDATE(), after ./cfst -o result_hosts.txt the script checks [[ ! -e result_hosts.txt ]] at script/cfst_dnsmasq.sh:21. CFST only creates the output file when at least one IP survives its filters, so a missing file is treated as '0 IPs' and the script exits 0, skipping the dnsmasq cloudflare.conf regeneration from site.conf entirely.
Source
Thrown at script/cfst_dnsmasq.sh:21
export PATH
# --------------------------------------------------------------
# 项目: CloudflareSpeedTest 自动更新 dnsmasq 配置文件
# 版本: 1.0.1
# 作者: XIU2,Sving1024
# 项目: https://github.com/XIU2/CloudflareSpeedTest
# --------------------------------------------------------------
_UPDATE() {
echo -e "开始测速..."
BESTIP=""
BESTIP_IPV6="::"
# 这里可以自己添加、修改 CFST 的运行参数
./cfst -o "result_hosts.txt"
# 需要测速 IPv6 请取消注释
#./cfst -o "result_hosts_ipv6.txt" -f ipv6.txt
# 如果需要 "找不到满足条件的 IP 就一直循环测速下去",那么可以将下面的两个 exit 0 改为 _UPDATE 即可
[[ ! -e "result_hosts.txt" ]] && echo "CFST 测速结果 IP 数量为 0,跳过下面步骤..." && exit 0
# 下面这行代码是 "找不到满足条件的 IP 就一直循环测速下去" 才需要的代码
# 考虑到当指定了下载速度下限,但一个满足全部条件的 IP 都没找到时,CFST 就会输出所有 IP 结果
# 因此当你指定 -sl 参数时,需要移除下面这段代码开头的 # 井号注释符,来做文件行数判断(比如下载测速数量:10 个,那么下面的值就设在为 11)
#[[ $(cat result_hosts.txt|wc -l) > 11 ]] && echo "CFST 测速结果没有找到一个完全满足条件的 IP,重新测速..." && _UPDATE
BESTIP=$(sed -n "2,1p" result_hosts.txt | awk -F, '{print $1}')
# 需要测速 IPv6 请取消注释
#BESTIP_IPV6=$(sed -n "2,1p" result_hosts_ipv6.txt | awk -F, '{print $1}')
if [[ -z "${BESTIP}" ]]; then
echo "CFST 测速结果 IP 数量为 0,跳过下面步骤..."
exit 0
fi
echo ${BESTIP} > nowip_hosts.txt
echo -e "最优 IPv4 IP 为 ${BESTIP}\n"
# 需要测速 IPv6 请取消注释
#echo -e "最优 IPv6 IP 为 ${BESTIP_IPV6}\n"View on GitHub (pinned to 1da0c025d7)
Solutions
- Run ./cfst -o result_hosts.txt by hand in the same directory to see the tester's own output
- Confirm cfst is executable (chmod +x cfst) and ip.txt exists next to it
- Loosen the CFST parameters or update ip.txt, then re-run the script
- For unattended retry, the in-file comment suggests replacing this exit 0 with _UPDATE to loop until a good IP appears (guard against tight infinite loops)
Example fix
# (before) silent skip when the tester never ran
[[ ! -e "result_hosts.txt" ]] && echo "CFST 测速结果 IP 数量为 0,跳过下面步骤..." && exit 0
# (after) distinguish tester failure from empty result
./cfst -o "result_hosts.txt" || { echo "cfst failed" >&2; exit 1; }
[[ ! -e "result_hosts.txt" ]] && echo "CFST 测速结果 IP 数量为 0,跳过下面步骤..." && exit 0 Defensive patterns
Strategy: retry
Validate before calling
[ -x ./cfst ] && [ -f ip.txt ] || { echo 'cfst/ip.txt missing in CWD' >&2; exit 1; } Try / catch
./cfst -o result_hosts.txt || { echo "cfst exited $?" >&2; exit 1; } Prevention
- Always invoke the script from its own directory (cd first in cron entries)
- Sanity-run ./cfst by hand after changing -t/-sl/-dn arguments
- If enabling the _UPDATE retry loop the comments mention, bound it with a max-attempts counter
When it happens
Trigger: All IPs failed CFST's latency/download filters in the current run; ./cfst could not run (binary missing/not executable, ip.txt absent in the working directory); testing ports blocked so no IP passed.
Common situations: Strict -sl/-t arguments added by the user; stale ip.txt; running via cron from the wrong directory so ./cfst resolves to nothing; network behind a firewall that drops Cloudflare 443 traffic.
Related errors
- CFST 测速结果 IP 数量为 0,跳过下面步骤...
- CFST 测速结果 IP 数量为 0,跳过下面步骤...
- CFST 测速结果 IP 数量为 0,跳过下面步骤...
- Failed to get the preferred IPv4 address.
- [错误] 缺少配置项 [FOLDER] !
AI-assisted analysis of XIU2/CloudflareSpeedTest@1da0c025d7 (2026-08-15).
Data as JSON: /api/errors/563c5bd0be41b299.
Report an issue: GitHub.