ERROR cannot unmarshal common settings: unexpected end of JSON input #148

Closed
opened 2025-11-20 04:20:56 -05:00 by saavagebueno · 1 comment
Owner

Originally created by @yefenghu on GitHub (Oct 1, 2021).

this is openwrt log:

stdout: Running version latest built on 2021-09-28T14:25:06Z (commit 963da5a)
stdout: 
stdout: 🔧 Need help? https://github.com/qdm12/ddns-updater/discussions/new
stdout: 🐛 Bug? https://github.com/qdm12/ddns-updater/issues/new
stdout: ✨ New feature? https://github.com/qdm12/ddns-updater/issues/new
stdout: ☕ Discussion? https://github.com/qdm12/ddns-updater/discussions/new
stdout: 💻 Email? quentin.mcgaw@gmail.com
stdout: 💰 Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12
stdout: 2021/10/02 03:33:39 ERROR cannot unmarshal common settings: unexpected end of JSON input
stdout: 2021/10/02 03:33:39 INFO Shutdown successful

this is my json:

{
    "settings": [
      {
        "provider": "porkbun",
        "domain": "yefenghu.***",
        "host": "@",
        "api_key": "***",
        "secret_api_key": "***",
        "ip_version": "ipv4"
      }
    ]
}
Originally created by @yefenghu on GitHub (Oct 1, 2021). this is openwrt log: ``` stdout: Running version latest built on 2021-09-28T14:25:06Z (commit 963da5a) stdout: stdout: 🔧 Need help? https://github.com/qdm12/ddns-updater/discussions/new stdout: 🐛 Bug? https://github.com/qdm12/ddns-updater/issues/new stdout: ✨ New feature? https://github.com/qdm12/ddns-updater/issues/new stdout: ☕ Discussion? https://github.com/qdm12/ddns-updater/discussions/new stdout: 💻 Email? quentin.mcgaw@gmail.com stdout: 💰 Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12 stdout: 2021/10/02 03:33:39 ERROR cannot unmarshal common settings: unexpected end of JSON input stdout: 2021/10/02 03:33:39 INFO Shutdown successful ``` this is my json: ```json { "settings": [ { "provider": "porkbun", "domain": "yefenghu.***", "host": "@", "api_key": "***", "secret_api_key": "***", "ip_version": "ipv4" } ] } ```
Author
Owner

@qdm12 commented on GitHub (Oct 2, 2021):

Make sure you have bind mounted the file correctly. Usually unexpected end of JSON input means it's an empty file or there is a missing bracket somewhere. The JSON you sent looks correct though, maybe try with https://jsonlint.com/ to be sure.

Also maybe the problem comes from Windows line endings \r\n in the file? 🤔 (probably not, but maybe)

@qdm12 commented on GitHub (Oct 2, 2021): Make sure you have bind mounted the file correctly. Usually `unexpected end of JSON input` means it's an empty file or there is a missing bracket somewhere. The JSON you sent looks correct though, maybe try with https://jsonlint.com/ to be sure. Also maybe the problem comes from Windows line endings `\r\n` in the file? 🤔 (probably not, but maybe)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ddns-updater#148