You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Doing a plan against previously created routeros_ip_dhcp_server_lease resource fails when [bound] host name has unusual characters.
It looks like the provider is trying to read and keep track of host_name associated with the lease, then when \x1b [escape character?) is encountered provider exists with an error, and the plan fails with the following error:
Error: invalid character '\x1b' in string literal
with routeros_ip_dhcp_server_lease.dhcp_reservation["oven"],
on dhcp.tf line 2, in resource "routeros_ip_dhcp_server_lease" "dhcp_reservation":
2: resource "routeros_ip_dhcp_server_lease" "dhcp_reservation" {
To Reproduce
Might be difficult to reproduce without the hardware that's acquiring the IP and reporting a messy hostname. In this case it's a GE smart oven.
Host name reported by Mikrotik Winbox looks like this TÇ�0�÷��� .
TF code, not sure if relevant to this scenario"
resource "routeros_ip_dhcp_server_lease" "dhcp_reservation" {
for_each = { for idx, reservation in local.dhcp_mapping : reservation.name => reservation }
address = each.value.ip
mac_address = each.value.mac
comment = "${lookup(each.value, "brand", "")}_${each.value.name}"
server = lookup(each.value, "server", null)
}
locals {
dhcp_mapping = flatten([for k, v in local.dhcp_reservations : [for a, b in v : merge(b, { server = k, name = a })]])
# .....
dhcp_reservations = {
# NETWORK BOUNDRY
defconf = {
oven = {
mac = "D8:28:C9:35:09:57",
ip = "192.168.88.130",
brand = "general_electric"
},
}
# .....
}
}
Expected behavior
Working plan. Host name information in this case is not critical and even if it can't be handled properly a more graceful failure would be desirable (like setting the attribute to null).
Stack Trace
Can provide if necessary.
Additional context
N/A
The text was updated successfully, but these errors were encountered:
OK, I have an idea how to reproduce this problem. But I am not sure that it will be possible to solve it beautifully. Please make a plan with debugging. I'm interested in the lines highlighted in green.
Describe the bug
Doing a plan against previously created
routeros_ip_dhcp_server_lease
resource fails when [bound] host name has unusual characters.It looks like the provider is trying to read and keep track of
host_name
associated with the lease, then when\x1b
[escape character?) is encountered provider exists with an error, and the plan fails with the following error:To Reproduce
Might be difficult to reproduce without the hardware that's acquiring the IP and reporting a messy hostname. In this case it's a GE smart oven.
Host name reported by Mikrotik Winbox looks like this
TÇ�0�÷���
.TF code, not sure if relevant to this scenario"
Expected behavior
Working plan. Host name information in this case is not critical and even if it can't be handled properly a more graceful failure would be desirable (like setting the attribute to null).
Stack Trace
Can provide if necessary.
Additional context
N/A
The text was updated successfully, but these errors were encountered: