How to discover the culprit in postinst scripts causing uci: Parse error (too many arguments)

Lately observing repeated

uci: Parse error (too many arguments) at line 42, byte 36

when LuCI packages are getting updated. This appears to be triggered by various postinst scripts and since the output is the same it would appear that the same stanza is being parsed repeatedly, one time for each postinst script.

However, the output is scarce on the source of the issue and thus would like to know how debug/discover the culprit.

Why are you updating your LuCI packages?

Mass-update of packages is known to cause significant issues of multiple kinds, including failure of connectivity and key services. Much of this is due to inconsistent ABIs between the various packages.

The preferred method is to flash a new image with a self-consistent set of packages.

Thanks for the response but that is off the mark/topic. Do you know how to debug the parse error?

No, it's likely spot on the mark, as you're likely mixing packages that are incompatible.

Source code for the packages can be found directly, or the scripts can be extracted from the .ipk files (tar/gzip).

tar tvf control.tar.gz 
drwxr-xr-x root/root         0 2019-06-20 13:34 ./
-rw-r--r-- root/root       448 2019-06-20 13:34 ./control
-rwxr-xr-x root/root       160 2019-06-20 13:34 ./postinst
-rwxr-xr-x root/root       117 2019-06-20 13:34 ./prerm

Well, there is a difference in opinion - you appear wanting to argue your perspective but not actually being able to answer the question.

This is a question being asked and not polling for opinion.

If you can help then please do so. I know where to find the source code but not where line 42, byte 36 is located as the uci appears scarce about it in its error statement.

set -vx
man tar

I got as far as

src/lib/subprocess.c:107 (subprocloc):Running subprocess: /usr/lib/opkg/info//luci-theme-material.postinst configure
uci: Parse error (too many arguments) at line 42, byte 36

cat /usr/lib/opkg/info//luci-theme-material.postinst

[ "${IPKG_NO_SCRIPT}" = "1" ] && exit 0
[ -x ${IPKG_INSTROOT}/lib/ ] || exit 0
default_postinst $0 $@

Not that I figured it out but for sharing

  • a uci file in /etc/config/ been broken
  • discoverable with for x in /etc/config/*; do uci show "${x##*/}" >/dev/null || echo "$x is broken"; done

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