UCI and the "-" (hyphen) parse errors

Always a Noobie => so be gentle

Have 23.05.02 running on a RPi CM4 with a DFRobot DFR0767 (IoT router CM4 Carrier). In the middle of shakedown with DHCP (first domain enroute to three) and have this silly Hyphen issue.

My home domain has a hyphen in it and uci complains - bitterly and irrationally, I might add.

In the dhcp config under the dnsmasq section is the line 17:
option domain 'Home.Not-Really.org'

and gives the complaint:
uci: Parse error (invalid character in name field) at line 17, byte 16 whenever I do a uci commit

After ALL the reading, I understand that "Section names may only contain alphanum and “_” (for shell compatibility). Hyphen '-' is not allowed."

HOWEVER - "Home.Not-Really.org" is NOT a "section name", it is a "value"! (At least according to the diagram on this page.)

So...

Either find a way to fix your parser to understand that it is not a section name, or point me to the place in the code where this can be corrected by removing the hyphen from the "bad" list or adding it to the "good" list when parsing the "VALUES".

Truth is - I like the domain name I have had all these years (15 or 20), much more than I value the need to listen to excuses and "... shell script ... secret code ... Danger!!! ..." like some overwrought Lost in Space robot.

Point is, it makes no sense whatsoever to cause values to be rejected for a rule that is limited to section names, UCI identifiers, and config file names! (I DID read it all!)

If it looks like a bug, and it stinks like a bug, it must be a ...

The other annoying thing is that even though I found the issue (well - at least I THINK I did), removing the offending line does not change the UCI error and THAT was the only hyphen, or entry of any type, on line 17 of any of the config files. If in fact this error is from somewhere other than the dhcp config, I will humbly bow out... AFTER someone explains how to identify the exact location of such a nebulus error message.

Tony

P.S. I just don't like to spend three hours on stupid s*** like this.

Check the line(s) above it. Note that byte 16 is the letter "H" after the opening single quote (not the hyphen), suggesting there is an unmatched quote in a previous line.

All option lines must be indented. UCI is not strict like Python, but any line that starts with text at column zero without any space or tab is treated as a section heading not an option.

1 Like

Yea, adding home.not-really.org works here. The information in the OP seems not relevant. I also added uppercase in the LuCI, it didn't give an error either.

1 Like

Okay - I'll agree -

IF anyone can tell me how to trace down the config file that has the error (given this not be the error).

  • Still f**ting around -

cat /etc/config/dhcp

If you post the contents, we can assist you.

(I assumed you were editing that file since you mentioned option domain syntax - if not, what were you editing?)

I think it may also be wise to verify you have the correct Wiki link for this configuration:

In a fit of brilliance (sound of dripping irony) I ran this little script:

for FILE in * ; do echo $FILE ; uci commit $FILE; done

and the REAL culprit pooped/popped out -

I am embarrassed and apologize ... There was a file with a line:

option 0.0.0.0

that should have been

option address 0.0.0.0

And that was the problem - Thanks all for letting me vent - you were more than kind.

2 Likes

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