Reply
New Member
Posts: 5
Registered: ‎05-09-2016
Kudos: 1
Accepted Solution

USG Pro 4.4.21 config.gateway.json

Hello!

After USG upgrade from 4.4.18 to 4.4.21 my config.gateway.json stopped working and USG get stuck in provisioning.

 

config.gateway.json:

{
    "service": {
        "dhcp-server": {
            "shared-network-name": {
                "net_Users_192.168.10.0-24": {
                    "subnet": {
                        "192.168.10.0/24": {
                            "static-mapping": {
                                "cc-6d-a0-eb-24-0e": {
                                    "mac-address": "cc:6d:a0:eb:24:0e",
                                    "static-mapping-parameters": [
                                        "option domain-name-servers 82.103.129.240, 46.246.29.68;"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

Errors:

configuration commit error. Error message: { "COMMIT" : { "error" : "\ufffe[ service dhcp-server ]\nUndefined subroutine &main::decode_entities called at /opt/vyatta/sbin/dhcpd-config.pl line 805.\n\n\uffff0\nCommit failed\n" , "failure" : "1" , "success" : "1"} , "DELETE" : { "failure" : "0" , "success" : "1"} , "SESSION_ID" : "41778057caa9512a61573911d6" , "SET" : { "failure" : "0" , "success" : "1"}}
configuration commit error. Error message: { "COMMIT" : { "error" : "\ufffe[ interfaces ethernet eth3 dhcp-options ]\nRenewing DHCP lease on eth3 ...\n\n\uffff1\n\ufffe[ interfaces ethernet eth2 dhcp-options ]\nRenewing DHCP lease on eth2 ...\n\n\uffff1\n\ufffe[ service gui ]\nStarting the GUI service.\nWarning - the service might have not started properly:\nDuplicate config variable in conditional 0 global: url.rewrite-once\n2018-05-05 20:02:28: (configfile.c.957) source: /etc/lighttpd/lighttpd.conf line: 44 pos: 1 parser failed somehow near here: (EOL) \n\n\uffff1\n\ufffe[ service dhcp-server ]\nUndefined subroutine &main::decode_entities called at /opt/vyatta/sbin/dhcpd-config.pl line 805.\n\n\uffff0\nCommit failed\n" , "failure" : "1" , "success" : "1"} , "DELETE" : { "failure" : "0" , "success" : "1"} , "SESSION_ID" : "41778057caa9512a61573911d6" , "SET" : { "failure" : "0" , "success" : "1"}}

this config.gateway.json was working perfectly before 4.4.21, what changed?

 

BR Daniel


Accepted Solutions
Highlighted
New Member
Posts: 4
Registered: ‎03-22-2018
Kudos: 2
Solutions: 1

Re: USG Pro 4.4.21 config.gateway.json

[ Edited ]

Took the freedom to search for the error/solution. I think I found it, but I do not recommend applying this fix. It will be undone by the next firmware upgrade, and who knows what else might be broken.

 

Edit: I guess I can recommend it now Icon Smile

 

But for those in dire need of the upgrade and being held back by this error, here it goes:

 

The error is not in the .json syntax, somebody simply forgot to load the Perl module which provides the function "decode_entities" in the /opt/vyatta/sbin/dhcpd-config.pl script. Which is quite unfortunate because the module is actually available on the system by default.

 

I've added the this line to the /opt/vyatta/sbin/dhcpd-config.pl script with the other "use" statements:

 

use HTML::Entities; # This library is available via libhtml-parser-perl

It looks like:

 

 

....

use strict;
use lib "/opt/vyatta/share/perl5/";

use Getopt::Long;
use NetAddr::IP; # This library is available via libnetaddr-ip-perl.deb
use HTML::Entities; # This library is available via libhtml-parser-perl
use Vyatta::Config;

...

 

 

This makes the script find the "decode_entities" function (provided by the HTML::Entities module") and work properly again.

 

View solution in original post


All Replies
New Member
Posts: 2
Registered: ‎03-01-2017

Re: USG Pro 4.4.21 config.gateway.json

Just curious - did it also kill the web gui?

New Member
Posts: 5
Registered: ‎05-09-2016
Kudos: 1

Re: USG Pro 4.4.21 config.gateway.json

Hi!

 

No the gui worked, internet to until i powercycled the USG. After that nothing worked. Probably because the USG couldnt boot correctly. 

New Member
Posts: 15
Registered: ‎02-09-2018
Kudos: 1

Re: USG Pro 4.4.21 config.gateway.json

I have the same problem!

Member
Posts: 256
Registered: ‎12-12-2015
Kudos: 80
Solutions: 10

Re: USG Pro 4.4.21 config.gateway.json

Probably a change in the way it stores the json, I'm guessing the way it deals with static-mapping-params.

 

  1. Remove the json
  2. Provision
  3. Apply the changes at the USG command line 
  4. `mca-ctrl -t dump-cfg` to get the new syntax
  5. rebuild config.gateway.json

 

 

Ubiquiti Employee
Posts: 4,882
Registered: ‎08-08-2016
Kudos: 5130
Solutions: 342

Re: USG Pro 4.4.21 config.gateway.json

I see the issue. It's been fixed for 4.4.22 which will be posted to beta on Wednesday. 

New Member
Posts: 5
Registered: ‎05-09-2016
Kudos: 1

Re: USG Pro 4.4.21 config.gateway.json

Hi!

4.4.22 doesnt solve this.

 

configuration commit error. Error message: { "COMMIT" : { "error" : "\ufffe[ interfaces ethernet eth3 dhcp-options ]\nRenewing DHCP lease on eth3 ...\n\n\uffff1\n\ufffe[ interfaces ethernet eth2 dhcp-options ]\nRenewing DHCP lease on eth2 ...\n\n\uffff1\n\ufffe[ service gui ]\nStarting the GUI service.\n\n\uffff1\n\ufffe[ service dhcp-server ]\nUndefined subroutine &main::decode_entities called at /opt/vyatta/sbin/dhcpd-config.pl line 805.\n\n\uffff0\nCommit failed\n" , "failure" : "1" , "success" : "1"} , "DELETE" : { "failure" : "0" , "success" : "1"} , "SESSION_ID" : "ca4d81097474f4184d05096202" , "SET" : { "failure" : "0" , "success" : "1"}}

Reverting back to 4.4.18 makes everything happy again.

 

BR Daniel

New Member
Posts: 4
Registered: ‎03-22-2018
Kudos: 2
Solutions: 1

Re: USG Pro 4.4.21 config.gateway.json

Care to share the exact issue? It's doesn't seem fixed in 4.4.22 sadly. 

New Member
Posts: 15
Registered: ‎02-09-2018
Kudos: 1

Re: USG Pro 4.4.21 config.gateway.json

Yes, the same issue wth json script in the 4.4.22

 

configuration commit error. Error message: { "COMMIT" : { "error" : "\ufffe[ service dhcp-server ]\nUndefined subroutine &main::decode_entities called at /opt/vyatta/sbin/dhcpd-config.pl line 805.\n\n\uffff0\nCommit failed\n" , "failure" : "1" , "success" : "1"} , "DELETE" : { "failure" : "0" , "success" : "1"} , "SESSION_ID" : "61cea0579e27372b65e4d36135" , "SET" : { "failure" : "0" , "success" : "1"}}

Highlighted
New Member
Posts: 4
Registered: ‎03-22-2018
Kudos: 2
Solutions: 1

Re: USG Pro 4.4.21 config.gateway.json

[ Edited ]

Took the freedom to search for the error/solution. I think I found it, but I do not recommend applying this fix. It will be undone by the next firmware upgrade, and who knows what else might be broken.

 

Edit: I guess I can recommend it now Icon Smile

 

But for those in dire need of the upgrade and being held back by this error, here it goes:

 

The error is not in the .json syntax, somebody simply forgot to load the Perl module which provides the function "decode_entities" in the /opt/vyatta/sbin/dhcpd-config.pl script. Which is quite unfortunate because the module is actually available on the system by default.

 

I've added the this line to the /opt/vyatta/sbin/dhcpd-config.pl script with the other "use" statements:

 

use HTML::Entities; # This library is available via libhtml-parser-perl

It looks like:

 

 

....

use strict;
use lib "/opt/vyatta/share/perl5/";

use Getopt::Long;
use NetAddr::IP; # This library is available via libnetaddr-ip-perl.deb
use HTML::Entities; # This library is available via libhtml-parser-perl
use Vyatta::Config;

...

 

 

This makes the script find the "decode_entities" function (provided by the HTML::Entities module") and work properly again.

 

Emerging Member
Posts: 45
Registered: ‎07-21-2016
Kudos: 20

Re: USG Pro 4.4.21 config.gateway.json

[ Edited ]

@FotringDo you have a network "net_Users" or just "Users"? your config.gateway.json talks about the network net_Users. Maybe the is a collision where config json, in the past, used the net_ prefix somehow?

 

Just remove the net_ from your config.gateway.json and reprovision? Worth a try?

New Member
Posts: 4
Registered: ‎03-22-2018
Kudos: 2
Solutions: 1

Re: USG Pro 4.4.21 config.gateway.json

[ Edited ]

Probably won't work, the dhcpd-config.pl script will still call the "decode_entities" function (which it can't locate) on the "static-mapping-parameters" options.

 

If you try to add these options via the CLI commands it will fail as well.

 

If you remove the static-mapping-parameters from the .json it will work. 

Emerging Member
Posts: 45
Registered: ‎07-21-2016
Kudos: 20

Re: USG Pro 4.4.21 config.gateway.json

Hmmm, just checked my own config.boot, has also got the net_ prefix so thats not it.

Sorry for the noise in this topic...

Ubiquiti Employee
Posts: 4,882
Registered: ‎08-08-2016
Kudos: 5130
Solutions: 342

Re: USG Pro 4.4.21 config.gateway.json

There were two problems in the original post and I only noticed one of them. One is fixed in 4.4.22. The other I'm investigating now. It can be worked around with what @dkanbier posted. 

Ubiquiti Employee
Posts: 4,882
Registered: ‎08-08-2016
Kudos: 5130
Solutions: 342

Re: USG Pro 4.4.21 config.gateway.json

Second problem fixed too. You can add what @dkanbier noted now, and then next version you won't have to worry about it being overwritten as it'll be fixed. 

New Member
Posts: 5
Registered: ‎05-09-2016
Kudos: 1

Re: USG Pro 4.4.21 config.gateway.json

What @dkanbier wrote solved the problems! Big kudos!

 

BR Daniel

Reply