DHCP server on Windows 10=exception

50 views
Skip to first unread message

SDS

unread,
Nov 30, 2022, 12:42:59 AM11/30/22
to jagornet-dhcp-users
Hello,

Trying to run jagornet dhcp server on windows 10 as part of a development test environment.

I've tried as a service with the config files defined, had trouble (says it can't find the interface), now just trying to run it from command line with no options, still throws an exception.  Below output is from an elevated command prompt, logged in with local admin rights:

C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin>dhcpserver start

C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin>echo on

C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin>if "Windows_NT" == "Windows_NT"

C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin>rem C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin\ is expanded pathname of the current script under NT

C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin>set DEFAULT_JAGORNET_DHCP_HOME=C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin\..

C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin>if "" == "" set JAGORNET_DHCP_HOME=C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin\..

C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin>set DEFAULT_JAGORNET_DHCP_HOME=

C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin>set _JAVACMD=

C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin>if "C:\Program Files\Java\jre1.8.0_351\" == "" goto noJavaHome

C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin>if not exist "C:\Program Files\Java\jre1.8.0_351\\bin\java.exe" goto noJavaHome

C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin>if "" == "" set _JAVACMD=C:\Program Files\Java\jre1.8.0_351\\bin\java.exe

C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin>goto runApp

C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin>"C:\Program Files\Java\jre1.8.0_351\\bin\java.exe" -cp "C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin\..\config";"C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin\..\lib\*" -Djagornet.dhcp.home="C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin\.." com.jagornet.dhcp.server.JagornetDhcpServer start
Starting Jagornet DHCP Server: Wed Nov 30 00:36:31 EST 2022
jagornet-dhcp-server 4.0.0
Copyright 2009-2022 jagornet-dhcp-server.  All Rights Reserved.
jagornet.dhcp.home=C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin\..
DhcpServer ABORT!
javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXException: Scanner State 24 not Recognized ]
        at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(Unknown Source)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:548)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:234)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:199)
        at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
        at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
        at com.jagornet.dhcp.server.config.DhcpServerConfiguration.loadXmlConfig(DhcpServerConfiguration.java:1194)
        at com.jagornet.dhcp.server.config.DhcpServerConfiguration.loadConfig(DhcpServerConfiguration.java:1149)
        at com.jagornet.dhcp.server.config.DhcpServerConfiguration.init(DhcpServerConfiguration.java:226)
        at com.jagornet.dhcp.server.JagornetDhcpServer.start(JagornetDhcpServer.java:222)
        at com.jagornet.dhcp.server.JagornetDhcpServer.main(JagornetDhcpServer.java:1190)
Caused by: org.xml.sax.SAXException: Scanner State 24 not Recognized
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:228)
        ... 8 more
Stopping Jagornet DHCP Server: Wed Nov 30 00:36:31 EST 2022

C:\Jagornet\jagornet-dhcp-dist-4.0.0\bin>


SDS

unread,
Dec 1, 2022, 11:30:23 AM12/1/22
to jagornet-dhcp-users
Did some additional debug, the server will run with the default config files (xml and xsd), it will also run with our modified xsd.  It will NOT run with our custom config (we were under the impression that our config was loading when running the command line dhcpserver start command, so hadn't dug into the custom config file as potential source of trouble).

The configuration is a bit complicated, multiple V4 and V6 scopes, custom options in each:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:dhcpServerConfig xmlns:ns2="http://jagornet.com/dhcp/xml">
<!DOCTYPE xml>
<dhc:dhcpServerConfig xmlns:dhc="http://jagornet.com/dhcp/xml"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="http://jagornet.com/dhcpserver.xsd">
   
    <v4ServerIdOption>
        <!--  DHCPv4 ServerID must be a local IP address -->
        <ipAddress>10.10.0.71</ipAddress>
    </v4ServerIdOption>

    <v6ServerIdOption>
        <!-- DHCPv6 ServerID should be auto-generated hex data -->
        <opaqueData>
            <asciiValue>fd00::0071</asciiValue>
        </opaqueData>
    </v6ServerIdOption>
   
    <policies>
        <policyList>
            <name>dhcp.ignoreSelfPackets</name>
            <value>true</value>
        </policyList>
    </policies>

    <links>
        <!-- Must define at least one link for client requests -->
        <linkList>
            <name>IPv4 Client 10_10_0</name>
            <!-- All DHCPv4 links are defined in CIDR notation.
                 For local links, specify the interface as a
                 startup command-line option, and configure the
                 subnet for that interface's IPv4 address. -->
            <address>10.10.0.0/24</address>
            <v4ConfigOptions>
                <v4SubnetMaskOption>
                    <ipAddress>255.255.255.0</ipAddress>
                </v4SubnetMaskOption>
                <v4RoutersOption>
                    <ipAddressList>10.10.0.1</ipAddressList>
                </v4RoutersOption>
                <v4DomainServersOption>
                    <ipAddressList>10.10.0.1</ipAddressList>
                    <ipAddressList>8.8.8.8</ipAddressList>
                </v4DomainServersOption>
                <v4DomainNameOption>
                    <domainName>sdsdev.com.</domainName>
                </v4DomainNameOption>
            </v4ConfigOptions>
            <v4AddrPools>
                <poolList>
                    <range>10.10.0.200-10.10.0.230</range>
                </poolList>
            </v4AddrPools>
    </linkList>

    <linkList>
            <name>IPv4 Client 10_10_56</name>
            <!-- All DHCPv4 links are defined in CIDR notation.
                 For local links, specify the interface as a
                 startup command-line option, and configure the
                 subnet for that interface's IPv4 address. -->
            <address>10.10.56.0/24</address>
            <v4ConfigOptions>
                <v4SubnetMaskOption>
                    <ipAddress>255.255.255.0</ipAddress>
                </v4SubnetMaskOption>
                <v4RoutersOption>
                    <ipAddressList>10.10.56.1</ipAddressList>
                </v4RoutersOption>
                <v4DomainServersOption>
                    <ipAddressList>10.10.0.1</ipAddressList>
                    <ipAddressList>8.8.8.8</ipAddressList>
                </v4DomainServersOption>
                <v4DomainNameOption>
                    <domainName>sdsdev.com</domainName>
                </v4DomainNameOption>
            </v4ConfigOptions>
            <v4AddrPools>
                <poolList>
                    <range>10.10.56.200-10.10.56.230</range>
                </poolList>
            </v4AddrPools>
        </linkList>
    <linkList>
            <name>IPv4 Client 10_10_78</name>
            <!-- All DHCPv4 links are defined in CIDR notation.
                 For local links, specify the interface as a
                 startup command-line option, and configure the
                 subnet for that interface's IPv4 address. -->
            <address>10.10.78.0/24</address>
            <v4ConfigOptions>
                <v4SubnetMaskOption>
                    <ipAddress>255.255.255.0</ipAddress>
                </v4SubnetMaskOption>
                <v4RoutersOption>
                    <ipAddressList>10.10.78.1</ipAddressList>
                </v4RoutersOption>
                <v4DomainServersOption>
                    <ipAddressList>10.10.0.1</ipAddressList>
                    <ipAddressList>8.8.8.8</ipAddressList>
                </v4DomainServersOption>
                <v4DomainNameOption>
                    <domainName>sdsdev.com</domainName>
                </v4DomainNameOption>
        <optionDefList>
        <subOptions>
          <optionDefList code="184" name="Option184 SDS GW IPs">
            <uByteListOption>
                 <unsignedByteList>10</unsignedByteList>
                  <unsignedByteList>10</unsignedByteList>
                  <unsignedByteList>0</unsignedByteList>
            <unsignedByteList>71</unsignedByteList>
                  <unsignedByteList>10</unsignedByteList>
                  <unsignedByteList>10</unsignedByteList>
                  <unsignedByteList>0</unsignedByteList>
            <unsignedByteList>70</unsignedByteList>
            </uByteListOption>
        </subOptions>
        </optionDefList>
            </v4ConfigOptions>
            <v4AddrPools>
                <poolList>
                    <range>10.10.78.200-10.10.78.230</range>
                </poolList>
            </v4AddrPools>
        </linkList>
    <linkList>
        <name>Local IPv6 Client Link (Multicast traffic)</name>
        <!-- Local DHCPv6 links are defined by interface name -->
        <interface>Ethernet</interface>
        <v6MsgConfigOptions>
            <v6DnsServersOption>
                <ipAddressList>fd00::0001</ipAddressList>
            </v6DnsServersOption>
            <v6DomainSearchListOption>
                <domainNameList>sdsdev.com.</domainNameList>
            </v6DomainSearchListOption>
        </v6MsgConfigOptions>
        <v6NaAddrPools>
            <poolList>
                <range>fd00::00c8-fd00::e6</range>
            </poolList>
        </v6NaAddrPools>
    </linkList>
    <linkList>
        <name>Remote IPv6 Client Link (Unicast/Multicast traffic)</name>
        <!-- Remote DHCPv6 links are defined in CIDR notation -->
        <address>fd56::0000/64</address>
        <v6MsgConfigOptions>
            <v6DnsServersOption>
                <ipAddressList>fd00::0001</ipAddressList>
            </v6DnsServersOption>
            <v6DomainSearchListOption>
                <domainNameList>sdsdev.com.</domainNameList>
            </v6DomainSearchListOption>
        </v6MsgConfigOptions>
        <v6NaAddrPools>
            <poolList>
                <range>fd56::00c8-fd56::00e6</range>
            </poolList>
        </v6NaAddrPools>

    <linkList>
        <name>Remote IPv6 Client Link (Unicast/Multicast traffic)</name>
        <!-- Remote DHCPv6 links are defined in CIDR notation -->
        <address>fd78::0000/64</address>
        <v6MsgConfigOptions>
            <v6DnsServersOption>
                <ipAddressList>fd00::0001</ipAddressList>
            </v6DnsServersOption>
            <v6DomainSearchListOption>
                <domainNameList>sdsdev.com.</domainNameList>
            </v6DomainSearchListOption>
            <optionDefList>
            <subOptions>
            <optionDefList code="184" name="Option184 SDS GW IPs">
                <uByteListOption>
            <unsignedByteList>FD</unsignedByteList>
                 <unsignedByteList>00</unsignedByteList>
                <unsignedByteList>00</unsignedByteList>
                 <unsignedByteList>00</unsignedByteList>
                 <unsignedByteList>00</unsignedByteList>
                 <unsignedByteList>00</unsignedByteList>
                 <unsignedByteList>00</unsignedByteList>
                 <unsignedByteList>00</unsignedByteList>
                 <unsignedByteList>00</unsignedByteList>
                 <unsignedByteList>00</unsignedByteList>
                 <unsignedByteList>00</unsignedByteList>
                 <unsignedByteList>00</unsignedByteList>
                 <unsignedByteList>00</unsignedByteList>
                 <unsignedByteList>00</unsignedByteList>
                 <unsignedByteList>00</unsignedByteList>
                 <unsignedByteList>71</unsignedByteList>
                </uByteListOption>
            </subOptions>
            </optionDefList>
        </v6MsgConfigOptions>
        <v6NaAddrPools>
            <poolList>
                <range>fd78::00c8-fd78::00e6</range>
            </poolList>
        </v6NaAddrPools>
    </linkList>
    </links>

</dhc:dhcpServerConfig>

SDS

unread,
Dec 9, 2022, 12:01:31 PM12/9/22
to jagornet-dhcp-users
Doing some banging around and stare & compare, this line was blowing it up (which I believe was part of the example file):

<ns2:dhcpServerConfig xmlns:ns2="http://jagornet.com/dhcp/xml">

We removed that line after looking at the sample files, and without changing anything else it worked (we then found/fixed any of our own syntax problems in the configuration).

However, it appears there is a possible bug in the custom options logic-

We are using your DHCP server to provide info to sensors, ipv4 and ipv6.  The sensors support SLAAC, DHCP, and manual programming as well as combinations (where we SLAAC for an address and use DHCP for DNS servers and our own custom option (184) which provides IP addresses of our servers which the sensors speak to).

When we configure v4 and/or v6 options (using subOptions or vxOtherOptions) for anything other than 'string' the DHCP server throws an exception (null pointer) when trying to service a request that asks for that option.  No matter which type we use (ipAddress, opaqueDataOption, opaqueDataOptionList).  If we set to string, it works without issue, for any of the others it throws what looks like the same exception.  We have tried with the examples from the documentation (copy/paste) and see the same behavior.

This is reproducible every time.

Here is an example of the xml file, with the exception below:
 (this works)

<linkList>
            <name>Remote IPv6 Client Link (Unicast/Multicast traffic)</name>
            <address>fd78::0000/64</address>
            <v6MsgConfigOptions>
                <v6DnsServersOption>
                    <ipAddressList>fd00::71</ipAddressList>
                </v6DnsServersOption>
                <v6DomainSearchListOption>
                    <domainNameList>sdsdev.com.</domainNameList>
                </v6DomainSearchListOption>
                <v6OtherOptions>
                        <optionDefList code="184" name="Option184">
                        <stringOption>
                              <string>fd78:0000:0000:0000:0000:0000:0000:0071</string>
                        </stringOption>                    
              </optionDefList>
                </v6OtherOptions>
            </v6MsgConfigOptions>
        </linkList>

(this doesn't-we tried short & long notation for the IP, also same problem with V4, and with all the different data types-ip, opaque, ip list, opaque list, etc)

<linkList>
            <name>Remote IPv6 Client Link (Unicast/Multicast traffic)</name>
            <address>fd78::0000/64</address>
            <v6MsgConfigOptions>
                <v6DnsServersOption>
                    <ipAddressList>fd00::71</ipAddressList>
                </v6DnsServersOption>
                <v6DomainSearchListOption>
                    <domainNameList>sdsdev.com.</domainNameList>
                </v6DomainSearchListOption>
                <v6OtherOptions>
                        <optionDefList code="184" name="Option184">
                        <ipAddressOption>
                              <ipAddress>fd78:0000:0000:0000:0000:0000:0000:0071</ipAddress>
                        </ipAddressOption>                    
              </optionDefList>
                </v6OtherOptions>
            </v6MsgConfigOptions>
        </linkList>

From the server log:

2022-12-09 07:35:33,010 [unorderedThreadPoolEventExecutor-1-9] DEBUG netty.DhcpV6ChannelHandler - Received:
Relay-Forward (xactId=0) from fd00:0:0:0:0:0:0:1:547
MSG_DHCPOPTIONSRelay Message:
Info-Request (xactId=9297445) from fe80:0:0:0:72b3:d5ff:feeb:2a84:0
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG netty.DhcpV6PacketDecoder - Received datagram packet: localChannel=fd00:0:0:0:0:0:0:71:547 remoteSender=fd00:0:0:0:0:0:0:1:547
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] INFO  netty.DhcpV6UnicastChannelDecoder - Decoding unicast message: local=fd00:0:0:0:0:0:0:71:547 remote=fd00:0:0:0:0:0:0:1:547
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Decoding packet: size=72 localAddr=fd00:0:0:0:0:0:0:71:547 remoteAddr=fd00:0:0:0:0:0:0:1:547
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Message type byte=12
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6RelayMessage - Decoding DhcpRelayMessage from: /fd00:0:0:0:0:0:0:1:547
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - MessageType=Relay-Forward
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6RelayMessage - HopCount=0
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6RelayMessage - LinkAddress: /fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6RelayMessage - PeerAddress: /fe80:0:0:0:72b3:d5ff:feeb:2a84
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Option code=9
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Decoding packet: size=34 localAddr=fd78:0:0:0:0:0:0:0:547 remoteAddr=fe80:0:0:0:72b3:d5ff:feeb:2a84:0
2022-12-09 07:35:33,010 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Message type byte=11
2022-12-09 07:35:33,010 [unorderedThreadPoolEventExecutor-1-9] INFO  request.DhcpV6MessageHandler - Handling relay forward on link address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,011 [unorderedThreadPoolEventExecutor-1-9] INFO  request.DhcpV6MessageHandler - Handling client request on remote client link address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,011 [unorderedThreadPoolEventExecutor-1-9] DEBUG config.DhcpServerConfiguration - Looking for Link by remote global address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,011 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Decoding DhcpMessage from: fe80:0:0:0:72b3:d5ff:feeb:2a84:0
2022-12-09 07:35:33,011 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - MessageType=Info-Request
2022-12-09 07:35:33,011 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - TransactionId=9297445
2022-12-09 07:35:33,011 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Option code=1
2022-12-09 07:35:33,011 [unorderedThreadPoolEventExecutor-1-9] INFO  config.DhcpServerConfiguration - Found configured Link for client request: Remote IPv6 Client Link (Unicast/Multicast traffic)
2022-12-09 07:35:33,011 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Option code=8
2022-12-09 07:35:33,012 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - Option code=6
2022-12-09 07:35:33,012 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6Message - DhcpMessage decoded.
2022-12-09 07:35:33,012 [nioEventLoopGroup-5-1] DEBUG message.DhcpV6RelayMessage - DhcpRelayMessage decoded.
2022-12-09 07:35:33,012 [nioEventLoopGroup-5-1] INFO  netty.DhcpV6UnicastChannelDecoder - Unicast message decoded: msg=
Relay-Forward (xactId=0) from fd00:0:0:0:0:0:0:1:547
2022-12-09 07:35:33,011 [unorderedThreadPoolEventExecutor-1-9] DEBUG request.BaseDhcpV6Processor - Processing:
Info-Request (xactId=9297445) from fe80:0:0:0:72b3:d5ff:feeb:2a84:0
MSG_DHCPOPTIONS
DhcpV6ClientIdOption: data=0003000170b3d5eb2a84
DhcpV6OptionRequestOption: unsignedShortList=83,23,184
DhcpV6ElapsedTimeOption: unsignedShort=223
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] DEBUG netty.DhcpV6ChannelHandler - Received:
Relay-Forward (xactId=0) from fd00:0:0:0:0:0:0:1:547
MSG_DHCPOPTIONSRelay Message:
Info-Request (xactId=9297445) from fe80:0:0:0:72b3:d5ff:feeb:2a84:0
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] INFO  request.DhcpV6MessageHandler - Handling relay forward on link address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] INFO  request.DhcpV6MessageHandler - Handling client request on remote client link address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] DEBUG config.DhcpServerConfiguration - Looking for Link by remote global address: fd78:0:0:0:0:0:0:0
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] INFO  config.DhcpServerConfiguration - Found configured Link for client request: Remote IPv6 Client Link (Unicast/Multicast traffic)
2022-12-09 07:35:33,012 [unorderedThreadPoolEventExecutor-1-1] DEBUG request.BaseDhcpV6Processor - Processing:
Info-Request (xactId=9297445) from fe80:0:0:0:72b3:d5ff:feeb:2a84:0
MSG_DHCPOPTIONS
DhcpV6ClientIdOption: data=0003000170b3d5eb2a84
DhcpV6OptionRequestOption: unsignedShortList=83,23,184
DhcpV6ElapsedTimeOption: unsignedShort=223
2022-12-09 07:35:33,013 [nioEventLoopGroup-5-1] WARN  channel.DefaultChannelPipeline - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.lang.NullPointerException: null
      at com.jagornet.dhcp.core.message.DhcpV6Message.toStringWithOptions(DhcpV6Message.java:666) ~[jagornet-dhcp-core-4.0.0.jar:?]
      at com.jagornet.dhcp.server.request.BaseDhcpV6Processor.processMessage(BaseDhcpV6Processor.java:207) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
      at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleClientRequest(DhcpV6MessageHandler.java:196) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
      at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleRelayForward(DhcpV6MessageHandler.java:131) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
      at com.jagornet.dhcp.server.request.DhcpV6MessageHandler.handleMessage(DhcpV6MessageHandler.java:81) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
      at com.jagornet.dhcp.server.netty.DhcpV6ChannelHandler.channelRead0(DhcpV6ChannelHandler.java:85) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
      at com.jagornet.dhcp.server.netty.DhcpV6ChannelHandler.channelRead0(DhcpV6ChannelHandler.java:55) ~[jagornet-dhcp-server-4.0.0.jar:4.0.0]
      at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
      at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
      at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:370) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
      at io.netty.util.concurrent.UnorderedThreadPoolEventExecutor$NonNotifyRunnable.run(UnorderedThreadPoolEventExecutor.java:277) ~[netty-all-4.1.48.Final.jar:4.1.48.Final]
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_351]
      at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_351]
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) ~[?:1.8.0_351]
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[?:1.8.0_351]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:1.8.0_351]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:1.8.0_351]
      at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.48.Final.jar:4.1.48.Final]
      at java.lang.Thread.run(Unknown Source) [?:1.8.0_351]

Greg Rabil

unread,
Dec 11, 2022, 5:32:43 PM12/11/22
to jagornet-dhcp-users
Hello,
Thanks for your interest in Jagornet DHCP!

The default config/dhcpserver.xml file appears as follows in the distribution bundle:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:dhcpServerConfig xmlns:ns2="http://jagornet.com/dhcp/xml">
    <v4ServerIdOption/>
    <v6ServerIdOption/>
</ns2:dhcpServerConfig>

This config file is provided as-is to allow simple bootstap of the server with minimal configuration.  It will generate the v4 and v6 server IDs and rewrite the file.  Further configuration can be performed via the REST API.  The config/dhcpserver-basic.xml and config/dhcpserver-sample.xml files provide some example configs, and both include the full XML namespace declaration including the schema reference as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<dhc:dhcpServerConfig xmlns:dhc="http://jagornet.com/dhcp/xml"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="http://jagornet.com/dhcpserver.xsd">
...
</dhc:dhcpServerConfig>

This is for use by XML validating editors.  As you discovered, your initial problem in your config was that both of these XML namespace definitions were included:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:dhcpServerConfig xmlns:ns2="http://jagornet.com/dhcp/xml">
<!DOCTYPE xml>
<dhc:dhcpServerConfig xmlns:dhc="http://jagornet.com/dhcp/xml"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="http://jagornet.com/dhcpserver.xsd">   


The NullPointerException that you've discovered is now logged in GitHub here: https://github.com/jagornet/dhcp/issues/73

Thank you for reporting this bug!  We will be releasing a patch for this issue soon.

Regards,
Greg Rabil

SDS

unread,
Dec 11, 2022, 10:24:33 PM12/11/22
to jagornet-dhcp-users
Greg,

Thanks so much for your response, much appreciated.  I think I may have found another problem, but just as likely I'm doing something wrong :)

When I run the server via command line, other than our custom option problem, it seems to be working great.  When I try to run as a service (windows 10), it shows an exception in the wrapper log and defaults to a vanilla configuration (rather than pulling in the config from the wrapper.conf), where it only does V4 (no v6), and picks up both NICs/IPs for V4 (where we only want to serve on one of those NICs/IPs).

I'm pasting the wrapper.conf and the wrapper log file.  We did try several times to uninstall the service, adjust the wrapper.conf, reinstall the service, no matter what we do we get the default vanilla config when installing the service (we see the unknown host exception via commnd line, that doesn't seem to bother anything...but thinking the 'exception' 2 lines below that may be why the configuration from the wrapper.conf isn't loading)-

This is the output from the wrapper log file:

INFO|15884/0|Service jagornet-dhcpserver|22-12-10 23:17:48|Starting Jagornet DHCP Server: Sat Dec 10 23:17:48 EST 2022
INFO|15884/0|Service jagornet-dhcpserver|22-12-10 23:17:48|IP Address failure: java.net.UnknownHostException: -10.10.0.71
INFO|15884/0|Service jagornet-dhcpserver|22-12-10 23:17:48|jagornet-dhcp-server 4.0.0
INFO|wrapper|Service jagornet-dhcpserver|22-12-10 23:17:48|Trigger found: Exception
INFO|15884/0|Service jagornet-dhcpserver|22-12-10 23:17:48|Copyright 2009-2022 jagornet-dhcp-server.  All Rights Reserved.
INFO|15884/0|Service jagornet-dhcpserver|22-12-10 23:17:48|jagornet.dhcp.home=../
INFO|wrapper|Service jagornet-dhcpserver|22-12-10 23:17:48|start script scripts/trayMessage.gv
INFO|wrapper|Service jagornet-dhcpserver|22-12-10 23:17:48|end script scripts/trayMessage.gv
INFO|15884/0|Service jagornet-dhcpserver|22-12-10 23:17:48|DHCPv4 Unicast addresses: [/10.10.0.71, /192.168.1.214]
INFO|15884/0|Service jagornet-dhcpserver|22-12-10 23:17:48|DHCPv4 Broadcast Interface: eth3
INFO|15884/0|Service jagornet-dhcpserver|22-12-10 23:17:48|DHCPv4 Port number: 67
INFO|15884/0|Service jagornet-dhcpserver|22-12-10 23:17:48|DHCPv6 Unicast addresses: none
INFO|15884/0|Service jagornet-dhcpserver|22-12-10 23:17:48|DHCPv6 Multicast interfaces: none
INFO|wrapper|Service jagornet-dhcpserver|22-12-10 23:18:34|received service control 1
INFO|wrapper|Service jagornet-dhcpserver|22-12-10 23:18:34|reporting status 1
INFO|wrapper|Service jagornet-dhcpserver|22-12-10 23:18:34|Win service stop - timeout: 30000
INFO|wrapper|Service jagornet-dhcpserver|22-12-10 23:18:34|Win service wrapper.control -> stopping application
INFO|wrapper|Service jagornet-dhcpserver|22-12-10 23:18:34|set state RUNNING->STATE_USER_STOP

This is the wrapper.conf:
# WARNING - Do not modify any of the properties when an application
#  using this configuration file has been installed as a service or daemon.
#  Please uninstall the service before modifying this file.  The
#  service must then be reinstalled.

#********************************************************************
# Java Executable Properties
#********************************************************************
# Java Application
#wrapper.java.command=java

# or define conditions for YAJSW searching for a JVM
# currently only valid for windows
#wrapper.java.command.minVersion=1.5
#wrapper.java.command.maxVersion=1.6
#wrapper.java.command.jreOnly=true
#wrapper.java.command.jdkOnly=true
#wrapper.java.command.preferJre=true
#wrapper.java.command.preferJdk=true
#wrapper.java.command.javaw=true

# copy java.exe to <tmp>/java_<customProcName>_nnnn.exe
#wrapper.java.customProcName=

#********************************************************************
# working directory
#********************************************************************
wrapper.working.dir=..

# Java Main class.  
# YAJSW: default is "org.rzo.yajsw.app.WrapperJVMMain"
# DO NOT SET THIS PROPERTY UNLESS YOU HAVE YOUR OWN IMPLEMENTATION
# wrapper.java.mainclass=

#********************************************************************
# Application main class or native executable
# One of the following properties MUST be defined
#********************************************************************

# Java Application main class
wrapper.java.app.mainclass=com.jagornet.dhcp.server.JagornetDhcpServer

# or jar file
#wrapper.java.app.jar=

# or groovy script file
#wrapper.groovy=

#or a native executable
#wrapper.image=

#********************************************************************
# Application process cpu priority and affinity
#********************************************************************

# Process priority: LOW, BELOW_NORMAL, NORMAL, ABOVE_NORMAL, HIGH
#wrapper.priority

# CPU affinity of the process. this is a bit-array representing the cpus
#wrapper.affinity=


#********************************************************************
# Application Account
# Equivalent to Posix sudo or windows runas
# Note Posix:
#     <group>\<user> (note: use \\ in configuration file).
#     If no group is configured default group of the user is used
#********************************************************************
#wrapper.app.account=
#wrapper.app.password=

#********************************************************************
# Java/Groovy Application Properties
#********************************************************************

# Java Classpath (include wrapper.jar)  Add class path elements as
#  needed starting from 1
# YAJSW: all libs required by YAJSW are in the manifest of the wrapper.jar -> only classpath of your application is required
#wrapper.java.classpath.1=
wrapper.java.classpath.1=../config
wrapper.java.classpath.2=../lib/*.jar

# Java Library Path
# YAJSW: required dll are encapsulated in jar files -> only library path of your application required
# wrapper.java.library.path.1=../lib

# Java Additional Parameters
#wrapper.java.additional.1=
wrapper.java.additional.1=-Djagornet.dhcp.home=../
# The log4j.properties file is found in the classpath
#wrapper.java.additional.2=-Dlog4j.configuration=log4j.properties

# Initial Java Heap Size (in MB)
# alternative for wrapper.java.additional.<n>=-Xms
#wrapper.java.initmemory=3

# % of total RAM
#wrapper.java.initmemory.relative=10

# Maximum Java Heap Size (in MB)
# alternative for wrapper.java.additional.<n>=-Xmx
#wrapper.java.maxmemory=64

# % of total RAM
#wrapper.java.maxmemory.relative=30

# JSW requires that main class is set as app.parameter property
# YAJSW: to specify the main class please use wrapper.java.app.mainclass=

wrapper.app.parameter.1=-4b
wrapper.app.parameter.2=eth3
wrapper.app.parameter.3=-4u
wrapper.app.parameter.4=-10.10.0.71
wrapper.app.parameter.5=-6u
wrapper.app.parameter.6=fd00::71
wrapper.app.parameter.7=-6m
wrapper.app.parameter.8=eth3

#********************************************************************
# Application environment properties.
#********************************************************************
# Adds an environment to the application
#wrapper.app.env.<key>=<value>

#********************************************************************
# Wrapper Logging Properties
#********************************************************************
# Format of output for the console.  (See docs for formats)
# wrapper.console.format=PM

# Log Level for console output.  (See docs for log levels)
#wrapper.console.loglevel=INFO

# Log file to use for wrapper output logging.
wrapper.logfile=${wrapper.working.dir}/logs/wrapper.log

# Format of output for the log file.  (See docs for formats)
#wrapper.logfile.format=LPTM

# Log Level for log file output.  (See docs for log levels)
wrapper.logfile.loglevel=INFO

# Maximum size that the log file will be allowed to grow to before
#  the log is rolled. Size is specified in bytes.  The default value
#  of 0, disables log rolling.  May abbreviate with the 'k' (kb) or
#  'm' (mb) suffix.  For example: 10m = 10 megabytes.
#wrapper.logfile.maxsize=10m

# Maximum number of rolled log files which will be allowed before old
#  files are deleted.  The default value of 0 implies no limit.
#wrapper.logfile.maxfiles=10

#********************************************************************
# Application Console Properties
#********************************************************************
# Indicate if console of the application is visible.
#wrapper.console.visible=true

# Title to use when running as a console
#wrapper.console.title=Jagornet DHCP Server

#********************************************************************
# Wrapper Windows Service and Posix Daemon Properties
#********************************************************************
# Name of the service
wrapper.ntservice.name=jagornet-dhcpserver

# Display name of the service
wrapper.ntservice.displayname=Jagornet DHCP Server

# Description of the service
wrapper.ntservice.description=Jagornet DHCP Server

# Service dependencies.  Add dependencies as needed starting from 1
# wrapper.ntservice.dependency.1=

# Mode in which the service is installed.  AUTO_START or DEMAND_START
wrapper.ntservice.starttype=AUTO_START

# Allow the service to interact with the desktop.
#wrapper.ntservice.interactive=true

# wrapper service user. only for windows. on *nix system this is root.
# see also wrapper.app.account
#wrapper.ntservice.account=
#wrapper.ntservice.user=

#********************************************************************
# Wrapper Posix Daemon Properties
#********************************************************************
# Directory in which to create and execute daemon init scripts. Default: /etc/init.d
#wrapper.daemon.dir =

# Directory where to store the wrapper pid file. Default: /var/run
#wrapper.daemon.pid.dir =

# Directory in which to create K... and S... links.
# Default: <wrapper.daemon.dir>/rcX.d
# For Ubuntu set to /etc/rcX.d
# The following grooy script should set it correctly for most distros
#wrapper.daemon.run_level_dir=${if (new File('/etc/rc0.d').exists()) return '/etc/rcX.d' else return '/etc/init.d/rcX.d'}

# Setting the runlevels and priorities for automatic startup and stop of the daemon.
# Similar syntax as the update_rc.d command
# Default: equivalent to default of update_rc.d
#wrapper.update_rc = start 20 2 3 4 . start 30 5 . stop 80 0 1 6

#********************************************************************
# Wrapper System Tray Properties
#********************************************************************
# enable system tray
#wrapper.tray = true

# TCP/IP port. If none is defined multicast discovery is used to find the port
# Set the port in case multicast is not possible.
#wrapper.tray.port = 15002

# icon file to use, per default a console icon is used
#wrapper.tray.icon=

#********************************************************************
# Exit Code Properties
# Restart on non zero exit code
#********************************************************************
wrapper.on_exit.0=SHUTDOWN
#wrapper.on_exit.default=RESTART

#********************************************************************
# Trigger actions on console output
#********************************************************************
# On Exception show message in system tray
wrapper.filter.trigger.0=Exception
wrapper.filter.script.0=scripts/trayMessage.gv
wrapper.filter.script.0.args=Exception

#********************************************************************
# Wrapper JMX
#
# connect using for example jconsole per remote access using the url
#
# service:jmx:rmi:///jndi/rmi://localhost:1099/server
#
# eventl. change port and server name
#********************************************************************
# Enable wrapper JMX
#wrapper.jmx = true

# JMX RMI port. default is 1099
#wrapper.jmx.rmi.port =

# JMX RMI credentials
# mandatory if accessing from remote server
#wrapper.jmx.rmi.user =
#wrapper.jmx.rmi.password =

#********************************************************************
# Wrapper timeouts
#********************************************************************
# Number of seconds to allow between the time that the Wrapper starts the application
# and the  application logon to the wrapper.
# Default: 30 seconds
#wrapper.startup.timeout =

# Number of seconds to allow between the time that the Wrapper asks the application to shutdown and the time that the JVM shuts down.
# Default: 30 seconds
#wrapper.shutdown.timeout =

# Number of seconds the wrapper waits for a ping message from the java application.
# If no heart beat is received within a timeout the wrapper assumes that the application
# is non responsive and will restart it.
# Default: 30 seconds
#wrapper.ping.timeout =



#********************************************************************
# genConfig: further Properties generated by genConfig
#********************************************************************
placeHolderSoGenPropsComeHere=

Greg Rabil

unread,
Dec 11, 2022, 10:40:03 PM12/11/22
to jagornet-dhcp-users
I think you may have a typo here:

wrapper.app.parameter.4=-10.10.0.71

There is an unnecessary dash (-) preceeding the IP address.  It is more clearly seen in the log message:

INFO|15884/0|Service jagornet-dhcpserver|22-12-10 23:17:48|IP Address failure: java.net.UnknownHostException: -10.10.0.71

Thanks again for reporting this bug with the complex option defs.  Issue #73 has been fixed.
Jagornet DHCP Server 4.0.1 release is available.  See the GitHub project - https://github.com/jagornet/dhcp

SDS

unread,
Dec 12, 2022, 2:49:35 PM12/12/22
to jagornet-dhcp-users
Greg,

Thanks for catching that.  I looked at that file a hundred times before posing the question...can't believe I missed that.  Sorry to bother you with it.  We did grab the latest build and fix our typo and it works perfectly, thanks so much for the fix for the null pointer.

I'm going to lobby my company for a donation for your product.

Thanks,
Steve

Greg Rabil

unread,
Dec 12, 2022, 6:46:40 PM12/12/22
to jagornet-d...@googlegroups.com
Hi Steve,
No problem, glad I could help.

Donations would be greatly appreciated!

Thanks,
Greg

--
You received this message because you are subscribed to the Google Groups "jagornet-dhcp-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jagornet-dhcpv6-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jagornet-dhcpv6-users/13160846-eba4-451f-a77b-ecfc00b5f729n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages