os-ddclient: GoDaddy updates still fail with the ddclient backend (TTL sent as a string), same as #5220

Đang mở
#5,972 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
58/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
json, perl, php
Lĩnh vực
backend, devops

Hướng nghiên cứu

Start by checking how os-ddclient installs or configures ddclient 3.11.2 and where its GoDaddy backend is maintained; the report identifies nic_godaddy_update and the TTL value passed to encode_json. Reproduce with the provided ddclient -daemon=0 -verbose -noquiet -force -file /usr/local/etc/ddclient.conf command using TTL 600. Done means GoDaddy accepts the update with a numeric TTL, and the plugin’s handling of the requested default and failed update logging is addressed.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

incomplete

This is #5220 again; that issue was closed as "not planned" by the stale bot, and the bug is still there.

Versions: OPNsense 26.7.10-amd64 (FreeBSD 15.1-RELEASE-p7), os-ddclient 1.34, ddclient 3.11.2_2

What happens: with the ddclient backend and service GoDaddy, no update ever succeeds, and nothing shows in the plugin's log or status columns. Running ddclient by hand shows two problems in a row:

  1. With the default TTL (300), GoDaddy rejects the update:
    SENDING:  data="[{\"ttl\":300, ...}]"
    RECEIVE:  HTTP/1.1 422 Unprocessable Entity
    {"code":"INVALID_BODY","fields":[{"code":"UNKNOWN_RESTRICTION","message":"must have a minimum value of 600","path":"records[0].ttl"}], ...}
    
  2. With TTL set to 600 in the account, ddclient sends it as a JSON string, and GoDaddy rejects that too:
    SENDING:  data="[{... \"ttl\":\"600\" ...}]"
    RECEIVE:  HTTP/1.1 422 Unprocessable Entity
    {"code":"INVALID_BODY","fields":[{"code":"UNEXPECTED_TYPE","message":"is not a integer","path":"records[0].ttl"}], ...}
    

So no TTL value works with GoDaddy.

Cause: in ddclient 3.11.2, nic_godaddy_update passes the config value straight into encode_json:

defined($config{$host}{'ttl'}) ? (ttl => $config{$host}{'ttl'}) : (),

Values read from ddclient.conf are strings, so JSON::PP encodes them quoted. Upstream ddclient tracked this as ddclient/ddclient#836, closed as fixed in 4.x, but OPNsense still ships 3.11.2.

Workaround (verified): forcing the value to a number makes the update succeed ("ttl":600, HTTP 200):

defined($config{$host}{'ttl'}) ? (ttl => 0 + $config{$host}{'ttl'}) : (),

The workaround is lost on every update that reinstalls ddclient.

Suggested fix:

  • Ship a ddclient with the upstream fix, or carry this one-line patch in the package.
  • Default the GoDaddy TTL to 600, GoDaddy's minimum, as #5220 proposed.
  • It would also help if failed updates showed up in the plugin's log page. Here they only appeared when ddclient was run by hand with -verbose.

To reproduce: os-ddclient, backend ddclient, service GoDaddy, any API key with DNS access, any TTL. Then run:

ddclient -daemon=0 -verbose -noquiet -force -file /usr/local/etc/ddclient.conf
Ngôn ngữ chính
PHP
Star
1.2k
Fork
926
Merge trung bình
1 ngày 10 giờ
Pull request đã merge (30 ngày)
25

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của opnsense/plugins

Tất cả issue của opnsense/plugins

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.