invalid expression type in print_expression: 45

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

invalid expression type in print_expression: 45

Shraddha Pandhe
Hi folks,

I am using dhcp-4.1.1-49.

What are the possible reasons for getting this error? I have been using the same dhcpd.conf without any issues. Today, I removed "dhcp-domain" option from the subnet definition and I started seeing this issue. Adding dhcp-domain back didn't help, so I am not sure if that caused anything.



My dhcpd config file:


# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
log-facility local6;
allow booting;
deny unknown-clients;
ddns-update-style none;
default-lease-time 3600;

lease-file-name "/home/neutron/dhcpd/dhcpd.leases";
pid-file-name "/home/neutron/dhcpd/pid";

next-server <ip-address>;
server-name "<ip-address>";

omapi-port 7911;

# Local subnet definition is required to start dhcpd
subnet <ip-address> netmask 255.255.255.255 {
}


if exists user-class and option user-class = "iPXE" {
   filename "init.ipxe";
}
elsif exists user-class and option user-class = "gPXE" {
   filename "init.gpxe";
}
else {
   filename "undionly.kpxe";
}

####################################################################
#           DHCP Subnet Definitions to follow               #
####################################################################
# NETWORK_ID 0b00f86d-2dbd-4931-8a17-8ddaea74f475
subnet 192.168.122.0 netmask 255.255.255.0 {
  option broadcast-address 192.168.122.255;
  option domain-name-servers 192.168.122.1;
  range 192.168.122.2 192.168.122.254;
}



_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: invalid expression type in print_expression: 45

Bob Harold

On Mon, Nov 2, 2015 at 6:45 PM, Shraddha Pandhe <[hidden email]> wrote:
Hi folks,

I am using dhcp-4.1.1-49.

What are the possible reasons for getting this error? I have been using the same dhcpd.conf without any issues. Today, I removed "dhcp-domain" option from the subnet definition and I started seeing this issue. Adding dhcp-domain back didn't help, so I am not sure if that caused anything.



My dhcpd config file:


# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
log-facility local6;
allow booting;
deny unknown-clients;
ddns-update-style none;
default-lease-time 3600;

lease-file-name "/home/neutron/dhcpd/dhcpd.leases";
pid-file-name "/home/neutron/dhcpd/pid";

next-server <ip-address>;
server-name "<ip-address>";

omapi-port 7911;

# Local subnet definition is required to start dhcpd
subnet <ip-address> netmask 255.255.255.255 {
}


if exists user-class and option user-class = "iPXE" {
   filename "init.ipxe";
}
elsif exists user-class and option user-class = "gPXE" {
   filename "init.gpxe";
}
else {
   filename "undionly.kpxe";
}

####################################################################
#           DHCP Subnet Definitions to follow               #
####################################################################
# NETWORK_ID 0b00f86d-2dbd-4931-8a17-8ddaea74f475
subnet 192.168.122.0 netmask 255.255.255.0 {
  option broadcast-address 192.168.122.255;
  option domain-name-servers 192.168.122.1;
  range 192.168.122.2 192.168.122.254;
}

Guessing here, but worth a try.
The "45" in the error message is probably the line number, but that would be the very end of your file, from what I see.  One possibility is that there is an invisible control character somewhere in the file, or some punctuation is unicode instead of ascii.
By any chance did you copy/paste from a work processor?  They often use different quote and hyphen characters that look similar but are not the right character. 

On Linux or Unix, try this:
    cat -v /etc/dhcpd.conf > /tmp/dhcpd.conf
    diff /etc/dhcpd.conf /tmp/dhcpd.conf
If there are any differences, delete and retype that line (do not copy/paste).

Or
Open in a plain text editor like Notepad on Windows or gedit on Linux and then save as a new file, and try the new file.

Or
Open in "vi" or "vim" and look for control characters - should show as "^" followed by some character, but you won't be able to search for the "^".

--
Bob Harold




_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: invalid expression type in print_expression: 45

glenn.satchell
On Thu, November 5, 2015 12:42 am, Bob Harold wrote:

> On Mon, Nov 2, 2015 at 6:45 PM, Shraddha Pandhe
> <[hidden email]
>> wrote:
>
>> Hi folks,
>>
>> I am using dhcp-4.1.1-49.
>>
>> What are the possible reasons for getting this error? I have been using
>> the same dhcpd.conf without any issues. Today, I removed "dhcp-domain"
>> option from the subnet definition and I started seeing this issue.
>> Adding
>> dhcp-domain back didn't help, so I am not sure if that caused anything.
>>
>>
>>
>> My dhcpd config file:
>>
>>
>> # dhcpd.conf
>> #
>> # Sample configuration file for ISC dhcpd
>> #
>> log-facility local6;
>> allow booting;
>> deny unknown-clients;
>> ddns-update-style none;
>> default-lease-time 3600;
>>
>> lease-file-name "/home/neutron/dhcpd/dhcpd.leases";
>> pid-file-name "/home/neutron/dhcpd/pid";
>>
>> next-server <ip-address>;
>> server-name "<ip-address>";
>>
>> omapi-port 7911;
>>
>> # Local subnet definition is required to start dhcpd
>> subnet <ip-address> netmask 255.255.255.255 {
>> }
>>
>>
>> if exists user-class and option user-class = "iPXE" {
>>    filename "init.ipxe";
>> }
>> elsif exists user-class and option user-class = "gPXE" {
>>    filename "init.gpxe";
>> }
>> else {
>>    filename "undionly.kpxe";
>> }
>>
>> ####################################################################
>> #           DHCP Subnet Definitions to follow               #
>> ####################################################################
>> # NETWORK_ID 0b00f86d-2dbd-4931-8a17-8ddaea74f475
>> subnet 192.168.122.0 netmask 255.255.255.0 {
>>   option broadcast-address 192.168.122.255;
>>   option domain-name-servers 192.168.122.1;
>>   range 192.168.122.2 192.168.122.254;
>> }
>>

Here is the line in the source, ./common/tree.c - it is evaluating an
expression and the 45 is the "operation". Looking in includes/tree.c,
operator 46 is expr_funcall (whatever that means)

int write_expression (file, expr, col, indent, firstp)
...
        switch (expr -> op) {
...
              default:
                log_fatal ("invalid expression type in print_expression: %d",
                           expr -> op);
        }
        return col;
}

I have a pretty early copy of the 4.1.1 source, but when I compare with
4.3.2 source there is a case expr_funcall in that switch statement now. Is
it possible you used a late version that has written something the older
version can now no longer parse? Is it possible to upgrade to the newest
release you can (ie later 4.1.1 or perhaps compile your own latest
version?

My guess is that it has written something to the leases file, and now
can't evaluate it properly. So that's where I'd look.

regards,
-glenn


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: invalid expression type in print_expression: 45

Shraddha Pandhe
Hi,

Thanks Bob and Glenn for the pointers. I had wrong configuration in the leases file. I removed it and it worked fine.



On Wed, Nov 4, 2015 at 6:06 AM, Glenn Satchell <[hidden email]> wrote:
On Thu, November 5, 2015 12:42 am, Bob Harold wrote:
> On Mon, Nov 2, 2015 at 6:45 PM, Shraddha Pandhe
> <[hidden email]
>> wrote:
>
>> Hi folks,
>>
>> I am using dhcp-4.1.1-49.
>>
>> What are the possible reasons for getting this error? I have been using
>> the same dhcpd.conf without any issues. Today, I removed "dhcp-domain"
>> option from the subnet definition and I started seeing this issue.
>> Adding
>> dhcp-domain back didn't help, so I am not sure if that caused anything.
>>
>>
>>
>> My dhcpd config file:
>>
>>
>> # dhcpd.conf
>> #
>> # Sample configuration file for ISC dhcpd
>> #
>> log-facility local6;
>> allow booting;
>> deny unknown-clients;
>> ddns-update-style none;
>> default-lease-time 3600;
>>
>> lease-file-name "/home/neutron/dhcpd/dhcpd.leases";
>> pid-file-name "/home/neutron/dhcpd/pid";
>>
>> next-server <ip-address>;
>> server-name "<ip-address>";
>>
>> omapi-port 7911;
>>
>> # Local subnet definition is required to start dhcpd
>> subnet <ip-address> netmask 255.255.255.255 {
>> }
>>
>>
>> if exists user-class and option user-class = "iPXE" {
>>    filename "init.ipxe";
>> }
>> elsif exists user-class and option user-class = "gPXE" {
>>    filename "init.gpxe";
>> }
>> else {
>>    filename "undionly.kpxe";
>> }
>>
>> ####################################################################
>> #           DHCP Subnet Definitions to follow               #
>> ####################################################################
>> # NETWORK_ID 0b00f86d-2dbd-4931-8a17-8ddaea74f475
>> subnet 192.168.122.0 netmask 255.255.255.0 {
>>   option broadcast-address 192.168.122.255;
>>   option domain-name-servers 192.168.122.1;
>>   range 192.168.122.2 192.168.122.254;
>> }
>>

Here is the line in the source, ./common/tree.c - it is evaluating an
expression and the 45 is the "operation". Looking in includes/tree.c,
operator 46 is expr_funcall (whatever that means)

int write_expression (file, expr, col, indent, firstp)
...
        switch (expr -> op) {
...
              default:
                log_fatal ("invalid expression type in print_expression: %d",
                           expr -> op);
        }
        return col;
}

I have a pretty early copy of the 4.1.1 source, but when I compare with
4.3.2 source there is a case expr_funcall in that switch statement now. Is
it possible you used a late version that has written something the older
version can now no longer parse? Is it possible to upgrade to the newest
release you can (ie later 4.1.1 or perhaps compile your own latest
version?

My guess is that it has written something to the leases file, and now
can't evaluate it properly. So that's where I'd look.

regards,
-glenn


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users