Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALiddns.py不能使用 #8

Open
shen-zhefeng opened this issue Jul 24, 2018 · 4 comments
Open

ALiddns.py不能使用 #8

shen-zhefeng opened this issue Jul 24, 2018 · 4 comments

Comments

@shen-zhefeng
Copy link
Contributor

1一些小错误 74行myip()后面少了:
2修复1之后提示

“Traceback (most recent call last):
File "ddns.py", line 133, in
add_dns(rc_rr, rc_domain, rc_type, rc_value, rc_ttl) # 添加 DNS 解析记录
File "ddns.py", line 105, in add_dns
return clt.do_action_with_exception(request) # 发送请求内容
File "/home/pi/.local/lib/python2.7/site-packages/aliyunsdkcore/client.py", line 274, in do_action_with_exception
request_id=request_id)
aliyunsdkcore.acs_exception.exceptions.ServerException: HTTP Status: 400 Error:SubDomainInvalid.Value The DNS record is invalid or in the wrong format. RequestID:

换成非sdk版本之后就能正常使用了 不知道为什么

@XAS-712
Copy link
Owner

XAS-712 commented Aug 4, 2018

很抱歉,SDK版本是另一位贡献者提供的。
就错误来看,看起来是add_dns(rc_rr, rc_domain, rc_type, rc_value, rc_ttl) # 添加 DNS 解析记录这句中的某些参数格式错误
可以在这句话之前来一句print把这五个变量打出来看看。

@AndroidOL
Copy link
Contributor

@shanzhoupeng @XAS-712
两位好,非常抱歉隔了半年才修复这个问题,目前已经适配了最新的 SDK,通过 pip 安装可能会避免更多的版本差异导致的问题。由于已经彻底放弃 Python 2.x,故更新后请使用 Python 3.x 运行脚本,请再次确认已经使用 pip 安装官方最新的 SDK。

之前所出现的这个问题是由于子域名无效,请检查变量 rc_rr 是否正确填写。rc_rr 所允许的值为任意可使用的子域名的全部或一部分(特殊字符仅限 @,为二级域名本身)。并且支持模糊查询,但本脚本并未对模糊查询提供支持(您可以查询所有,会匹配完全相同的子域名,若未找到则直接结束)。

您可以在阿里云官网找到错误码对照表:https://error-center.aliyun.com/status/product/Alidns。
输入错误信息 SubDomainInvalid.Value 可得知原因为“解析记录值(RR value)的输入内容不合法或格式错误”。

如遇到问题建议使用官方 API 工具进行排查:https://api.aliyun.com/。

@AndroidOL
Copy link
Contributor

新提交的代码没有经过完整的测试,只是可以正常更新 DNS, @XAS-712 如果方便能否帮助测试更新、新增 DNS 以及邮件提醒是否正确。

@AndroidOL
Copy link
Contributor

该问题已在最近一次 commit 中解决,实际问题出现在子域名错误的填写为了记录类型 rc_type 而非 rc_value。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants