Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency in records.yaml IP fields (ipv6 parsing) #11900

Open
ezelkow1 opened this issue Dec 6, 2024 · 5 comments
Open

Inconsistency in records.yaml IP fields (ipv6 parsing) #11900

ezelkow1 opened this issue Dec 6, 2024 · 5 comments
Assignees
Labels
Records Records related code. YAML

Comments

@ezelkow1
Copy link
Member

ezelkow1 commented Dec 6, 2024

We noticed here that when using dns.local_ipv6 ATS will complain while parsing, Im assuming due to all the extra colons in the ipv6 address so that is resolved by just wrapping in quotes. However it does not complain when having both an ipv4 and a 6 in outgoing_ip_to_bind. So wondering if there is a way to make ATS act consistently. Right now we just quote wrap all of them which seems to work

@brbzull0 brbzull0 added YAML Records Records related code. labels Dec 10, 2024
@brbzull0
Copy link
Contributor

This is not ATS but rather how YAML works. if we use special characters like the colon(which is an indicator character) inside a value, then it may need quotes, otherwise the YAML parser will fail as per specs.

I think we should wrap the string if we use special characters in it. Not sure if you have any other ideas?

@ezelkow1
Copy link
Member Author

ezelkow1 commented Dec 11, 2024

well I get that but thats why I found the inconsistency odd. Because the outgoing_ip_to_bind field ats/yamlcpp did not complain when that field was set with ip_to_bind: ipv4_addr ipv6_addr
without quote wrapping it

That is what led me to believe there is inconsistent parsing behavior going on. I have no issues quote wrapping and it makes sense, but the inconsistent behavior between 2 fields with ipv6 addresses in them had me wondering

@brbzull0
Copy link
Contributor

Because the outgoing_ip_to_bind field ats/yamlcpp did not complain when that field was set with ip_to_bind: ipv4_addr ipv6_addr
without quote wrapping it

it's the same, no inconsistency I think. You can assign the same ipv6 to local_ipv6 or the other one as long as you do not place the colon at the end or some other special character that makes the parser believe that it's a special character.

Do you have an example where the behave diffently?

@ezelkow1
Copy link
Member Author

ezelkow1 commented Dec 12, 2024

so here's my example (just using IP's for one of my VMs running 10):

outgoing_ip_to_bind: 192.168.5.16 [2601:282:4300:54:4d17:e14a:9a32:b49d]
dns:

 local_ipv4: 192.168.5.16
 local_ipv6: [2601:282:4300:54:4d17:e14a:9a32:b49d]

Error: Error: Error parsing /opt/ats10/etc/trafficserver/records.yaml. yaml-cpp: error at line 217, column 17: bad conversion

Like 217 is just the local_ipv6 field.

Now if I wrap the local_ipv6 address in quotes it will no longer error out. However that does not explain how the outgoing_ip_to_bind is apparently parsed correctly having a non-quoted ipv6 string. Thats the inconsistency I'm talking about, how it appears to need to be quoted in one field, but not another.

@maskit
Copy link
Member

maskit commented Dec 12, 2024

local_ipv6: [2601:282:4300:54:4d17:e14a:9a32:b49d]

The value is read as an array because of the brackets. You cannot have a string that has the format without quoting. I think you'd get a similar error on outgoing_ip_to_bind if you removed the IPv4 address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Records Records related code. YAML
Projects
None yet
Development

No branches or pull requests

3 participants