Check that the input contains the field
Run these commands in an SSH session on the router. Save the response in a new temporary directory and inspect the JSON that ubus returns. Look for the release object and its description field. If the response is empty, contains an error or lacks that field, check the service and the field path first. These queries only read system information.
work=$(mktemp -d /tmp/jsonfilter.XXXXXX) && cd "$work" || exit 1
ubus call system board > board.json && cat board.json
Compare two input paths using the same data
The first command passes the file through a pipe. The second uses -i to read the same file with the same expression. Read each exit status immediately. Finally, request a field missing from the sample as a control.
cat board.json | jsonfilter -e '@.release.description'; echo "pipe_rc=$?"
jsonfilter -i board.json -e '@.release.description'; echo "file_rc=$?"
jsonfilter -i board.json -e '@.absent63'; echo "missing_rc=$?"
If both paths print the same release and exit with 0, that field is readable. If only your application expression returns nothing, check its keys, array elements and filter conditions in turn. If the response contains the field and file input works, but the pipe prints nothing and exits with 1, record the installed package version and check the jsonfilter source revision used for that build. Exit status 1 alone cannot identify the cause.
Compare the results over SSH
The recorded terminal starts in a temporary directory. Read the board information, then save a response to a file. The isolated guest runs OpenWrt 25.12.6 x86/64 and demonstrates successful reads and a missing field.
apk list --installed jsonfilter | cut -d' ' -f1
ubus call system board | jsonfilter -e '@.release.description'; echo "pipe_rc=$?"
ubus call system board > board.json && jsonfilter -i board.json -e '@.release.description'; echo "file_rc=$?"
jsonfilter -i board.json -e '@.absent63'; echo "missing_rc=$?"

Similar symptoms occurred in a custom OpenWrt 25.12.0 image for a Dell Edge 620 and a custom SNAPSHOT for the BPI-R3. In March 2026 the upstream project corrected how it decides whether to parse standard input. A separate change fixed a case where only the last of several expressions ran. The official 25.12.6 package definition points to b9034210. For a custom image, check the installed package and source revision.
If file input works, use -i to read one field from a saved response while investigating. Back up the configuration before changing packages or firmware and use a feed matching the build. After the change, retry the original expression on a fresh response. If your script uses two -e options, verify both results. Keep the working file-based method available until the original input path passes.
Why quote the JSON passed to jsonfilter -s?
Use one small JSON value containing a space. The pipe supplies standard input. With -s, the quoted variable supplies a single argument. An unquoted expansion can split before jsonfilter starts and invalidate the comparison.
sample='{"label":"west uplink","port":2}'
printf '%s\n' "$sample" | jsonfilter -e '@.label'
jsonfilter -s "$sample" -e '@.label'
jsonfilter -s "$sample" -e '@.missing'
echo "missing_rc=$?"

On OpenWrt 25.12.6 x86/64 both reads printed west uplink. The absent field produced no value and missing_rc=1. If both reads work, check that the real producer returned complete JSON, then test its field path. If only the pipe fails, record the version and exit codes and use a verified file input temporarily. Keep large or sensitive data off the command line. Retest the original field before switching back and restore the saved script if it starts returning empty results.
A LuCI menu opens but the service fails: check packages, processes and client traffic
Comments