Skip to content

ddns-scripts: fix netcup.com for multiple runs#29098

Merged
feckert merged 3 commits intoopenwrt:masterfrom
flubshi:fix/ddns_netcup.com
Apr 27, 2026
Merged

ddns-scripts: fix netcup.com for multiple runs#29098
feckert merged 3 commits intoopenwrt:masterfrom
flubshi:fix/ddns_netcup.com

Conversation

@flubshi
Copy link
Copy Markdown

@flubshi flubshi commented Apr 8, 2026

📦 Package Details

Maintainer: @feckert
(You can find this by checking the history of the package Makefile.)

Description:

This PR fixes an issue where the netcup DDNS update script fails on subsequent runs due to reassigning a readonly variable. The variable has been changed to a regular assignment to ensure the script can be sourced multiple times without errors.

Additionally, error handling has been improved:

  • Several hard failures (write_log 14) have been replaced with soft failures (return 1) to allow the ddns framework to retry updates according to the configured retry policy.
  • Hard failures are now reserved for critical issues such as missing dependencies or invalid configuration.
  • JSON parsing has been made more robust by replacing cat-based loading with json_load_file, which is the intended method for handling JSON input in this context.

🧪 Run Testing Details

  • OpenWrt Version: OpenWrt 25.12.2 r32802-f505120278
  • OpenWrt Target/Subtarget:
  • OpenWrt Device: TP-Link Archer C7 v4

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc., using
    make package/<your-package>/refresh V=s
  • It is structured in a way that it is potentially upstreamable
    (e.g., subject line, commit description, etc.)
    We must try to upstream patches to reduce maintenance burden.

@BKPepe BKPepe requested a review from Copilot April 8, 2026 21:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Fixes repeatability and retry behavior of the netcup.com DDNS updater by removing a readonly reassignment error, improving JSON loading, and converting several hard-fail exits into retryable failures.

Changes:

  • Make __NETCUP_ENDPOINT re-source-safe by removing readonly assignment.
  • Use json_load_file for parsing the provider response stored in $DATFILE.
  • Convert several hard failures into return 1 paths to allow ddns framework retries.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
net/ddns-scripts/files/usr/lib/ddns/update_netcup_com.sh Makes the netcup updater safe to source multiple times; improves JSON loading and makes several failures retryable.
net/ddns-scripts/Makefile Bumps package release to publish the behavior fixes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread net/ddns-scripts/files/usr/lib/ddns/update_netcup_com.sh
Comment thread net/ddns-scripts/files/usr/lib/ddns/update_netcup_com.sh
Comment thread net/ddns-scripts/files/usr/lib/ddns/update_netcup_com.sh
@feckert
Copy link
Copy Markdown
Member

feckert commented Apr 20, 2026

Can you please split this into 3 changes:

  • Remove readonly
  • Improve json_init with json_init_file
  • Update error path

You're wondering why this should be split into separate commits. Here's my explanation:
To split them up makes the patch handling much clearer. Because with the change in the error path, I’m not sure if that might cause problems, as it behaves differently. If that’s causing the problems, I’d like to revert just that change. The other two are definitely fixes or improvements and can be backported to the stable branches as well.

@flubshi
Copy link
Copy Markdown
Author

flubshi commented Apr 21, 2026

@feckert Thanks for your reply! I fully understand this. Do you prefer a single PR or should I create a separate PR for the readonly bug?

@feckert
Copy link
Copy Markdown
Member

feckert commented Apr 21, 2026

I am fine with one PR. Only split them up in 3 commits. I have seen that the provider is only available in the master Branch.

Tim Flubshi added 3 commits April 26, 2026 17:47
The netcup ddns update script fails on subsequent runs because a
readonly variable is assigned again. Fix this by removing the readonly
declaration to allow repeated execution.

Signed-off-by: Tim Flubshi <flubshi@gmail.com>
Replace manual file loading via cat with json_load_file for parsing
JSON data. This uses the intended helper function and improves
code clarity and robustness.

Signed-off-by: Tim Flubshi <flubshi@gmail.com>
Adjust the update error handling path to avoid hard failures on
recoverable errors. This allows ddns to retry updates after the
configured retry interval and improves reliability.

Signed-off-by: Tim Flubshi <flubshi@gmail.com>
@flubshi flubshi force-pushed the fix/ddns_netcup.com branch from 238478e to 2013f30 Compare April 26, 2026 16:01
@flubshi
Copy link
Copy Markdown
Author

flubshi commented Apr 26, 2026

@feckert PR is adjusted. I hope it is now fine as it is.

@feckert feckert merged commit e6e05d2 into openwrt:master Apr 27, 2026
12 checks passed
@feckert
Copy link
Copy Markdown
Member

feckert commented Apr 27, 2026

Thanks merged!

@flubshi flubshi deleted the fix/ddns_netcup.com branch April 27, 2026 16:13
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

Successfully merging this pull request may close these issues.

3 participants