Luci Attended Sysupgrade errors

I am trying to upgrade OpenWrt 19.07.7 on x86 and am getting:
Could not reach API at "https://sysupgrade.openwrt.org" and
SyntaxError: Unexpected end of JSON input.
I would appreciate some help on troubleshooting this. Thanks!

I am trying to upgrade OpenWrt 19.07.7 on x86 and am getting:
Could not reach API at "https://sysupgrade.openwrt.org " and
SyntaxError: Unexpected end of JSON input.
I would appreciate some help on troubleshooting this. Thanks!

You'll need to upgrade manually at first because that version of OpenWRT doesn't have necessary packages and package versions required by Attended SysUpgrade (e.g., ca-certificates). Just download the correct squashfs file and perform a manual upgrade that overwrites all the settings.

NOTE If you ssh into the router and install auc (Attended SysUpgrade CMD Line Client) like this:

root@OpenWRT:~# opkg install auc

that will allow you to see more descriptive and useful errors when attempting an attended sysupgrade.

Errant Router

I'm running that same version on one of my unused routers and I get the same error that you're seeing...

root@OpenWrt:~# cat /etc/os-release 
NAME="OpenWrt"
VERSION="19.07.7"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt 19.07.7"
VERSION_ID="19.07.7"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r11306-c4a6851c72"
OPENWRT_BOARD="mvebu/cortexa9"
OPENWRT_ARCH="arm_cortex-a9_vfpv3-d16"
OPENWRT_TAINTS=""
OPENWRT_DEVICE_MANUFACTURER="OpenWrt"
OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="OpenWrt 19.07.7 r11306-c4a6851c72"

After installing auc:

root@OpenWrt:~# auc
auc (0.1.4)
No CA certificates loaded, please install ca-certificates

Unfortunately, the ca-certificates package is not available on this version of OpenWRT—the ucert-full package was used for this revision and is no longer adequate.

root@OpenWrt:~# opkg find 'ca-certificates'
root@OpenWrt:~# opkg find 'certs'
root@OpenWrt:~# opkg find '*cert*'
ucert-full - 2020-05-24-00b921d8-1

Working Router

root@owrt1:~# cat /etc/os-release
NAME="OpenWrt"
VERSION="22.03.2"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt 22.03.2"
VERSION_ID="22.03.2"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r19803-9a599fee93"
OPENWRT_BOARD="mvebu/cortexa9"
OPENWRT_ARCH="arm_cortex-a9_vfpv3-d16"
OPENWRT_TAINTS=""
OPENWRT_DEVICE_MANUFACTURER="OpenWrt"
OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="OpenWrt 22.03.2 r19803-9a599fee93"

and

root@owrt1:~# opkg find 'ca-cert*'
ca-certificates - 20211016-1 - System CA certificates

Once you've upgraded manually to version 22.xx.x you should be able to use attended-sysupgrade without issue. If you're router doesn't support the latest release, I believe ca-certificates is available in the latter versions of OpenWRT v19.xx.x.

If you run into any issues, or if you're successful, reply back to this post and let us know.

Thank you for taking the time to look at this. I did essentially start over with 22.03.2. The auc and Luci Attended Sysupgrade are working with the initial steps of an upgrade. I did not attempt to go through to completion since I don't need to at this point.

Just correcting a bit of misinformation here...

ca-certificates packages has been available since year 2014, and is available on 19.07 release. It is quite normally available in 19.07.7 download repo:

But it is not installed by default, so you need to install it manually.

opkg update
opkg install ca-certificates

Note that 19.07 did not have SSL readiness by default, you had to enable it manually. Later OpenWrt versions have had SSL certs installed by default, since August 2020.
Also the OpenWrt package downloads were http at that time. That ancient auc in a end-of-life OpenWrt version is apparently a bit out of sync with dependencies needed for the current auc server.

1 Like

Just to make sure I am understanding hnyman's post correctly. ca-certificates are available for 19.07 but, despite installing them, this would still not allow for auc because of the "modern" server?

No, meant that the auc version does not explicitly specify the certs as a dependency (to be automatically installed by opkg), as it currently should.
(When it has been originally created, downloads were http.)

Sorry, to make sure I am understanding, if the certificates are properly installed, can 19.07 be upgraded via auc? Or it's just not possible, even though certificates can be installed.

No first hand knowledge, as I never use auc. (I compile my firmwares from sources)

I just pointed out that the ca-certificates can be installed and are available for 19.07, and that auc is missing formal dependency for it.
Just try installing the ca-certificates package, and test sysupgrading again.

But there was yesterday a commit in master from @aparcar, the author of auc/attendedupgrade, which hints that there may also be trouble with the public keys used by auc. Aparcar fixed master, but I am not sure if the problem exists in earlier OpenWrt versions. If it does, it might be a reason for your problem.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.