Skip to content

SIGSEGV: segmentation violation in OVH provider because of capitalization of domains #5384

Closed
@kevinvalk

Description

@kevinvalk

WORKAROUND: Make sure to lowercase all domains and subdomains!

What happened:

I have been using external dns for a couple of weeks now and all was working great. However, just today I saw that it was crashing with the following segmentation violation.

....
time="2025-05-12T12:05:07Z" level=debug msg="OVH: changes UPDATEOLD dns:\"u1bto2yj6soaxravho0svly1.xxxxxxxxxxxxxxxxxxxxx\" / targets:[redacted] / type:A"
time="2025-05-12T12:05:07Z" level=debug msg="OVH: changes UPDATEOLD dns:\"u1bto2yj6soaxravho0svly1.xxxxxxxxxxxxxxxxxxxxx\" / targets:[redacted] / type:AAAA"
time="2025-05-12T12:05:07Z" level=debug msg="OVH: changes UPDATEOLD dns:\"yyyyyyyyyyyyyyyyyyyyyyyy\" / targets:[redacted] / type:AAAA"
time="2025-05-12T12:05:07Z" level=debug msg="OVH: changes UPDATEOLD dns:\"yyyyyyyyyyyyyyyyyyyyyyyy\" / targets:[redacted] / type:A"
time="2025-05-12T12:05:07Z" level=debug msg="OVH: changes UPDATEOLD dns:\"xxxxxxxx-a-u1bto2yj6soaxravho0svly1.xxxxxxxxxxxxxxxxxxxxx\" / targets:\"eWLouCLoc8A55px2aZB6pF+P4QScADOs3zzElDwkJpFXfecQztVM3ujTRzTD5+gU7s4UXj59qjJMj0DS7IbhZRoOEVMHv5944m6NNkppB4FYpc2f3j4R31O1R91J6jfKIent4yoQECbqTMYNAg8Sm7cOlbWeLzIFAzRmHY2HcP1Py+EVQNh3DzfvJQFifQ==\" / type:TXT"
time="2025-05-12T12:05:07Z" level=debug msg="OVH: changes UPDATEOLD dns:\"xxxxxxxx-aaaa-u1bto2yj6soaxravho0svly1.xxxxxxxxxxxxxxxxxxxxx\" / targets:\"OKBfBOP0kwvaZ+IXT3xoeGTpcrfZ1k7JdE2+nwONK1Po7ZJGXvM5UitFU/mypeN6DkbbrfpYFIgAiwULQKOPj4nSJKi8qHqdaVMzYGKFCPDpWE3NAtMq+7kGO8l+9WtnKMJcILezhdv6HZ7x0MQruvgIORVJIEMYlMwxs1uo3lHvZ/DiHfwm0zbVJHlLkg==\" / type:TXT"
time="2025-05-12T12:05:07Z" level=debug msg="OVH: changes UPDATEOLD dns:\"xxxxxxxx-aaaa-yyyyyyyyyyyyyyyyyyyyyyyy\" / targets:\"PoyU3C6M/CtDPRT+1DeKNp0KVtWIMkBwlWPznXZcQ/ANSlOfA21LQ2Zpjils9BdMMDS0W4AsXthRKWR21A9hjpRzM/0fFb2IHsEguJd3JftAGUYMmQdzENezd7jyQqm4BglM1iP2dS9Mo9jgPgNMxLE/4Y8zUp1HALmNUAyqOy7XyUteIeuLusQeg00LuQ==\" / type:TXT"
time="2025-05-12T12:05:07Z" level=debug msg="OVH: changes UPDATEOLD dns:\"xxxxxxxx-a-yyyyyyyyyyyyyyyyyyyyyyyy\" / targets:\"oL0YYMJV+Fp0sjcsYwABXzbAqDicPArQRSxBGmtRBrvD3uwtOzTkX//IKpFLwEVu2sL6CGp40nLydYED0ozpwMMsrD17EBhJsi3qJNdKuSdYsUltBkCfAb2PGC0KUV4F406Y5YXRdtlYb8MYQvZDCyfqsf6fG3+WhDiLzgNHniLOkWcYpBM2REu574xCLw==\" / type:TXT"
time="2025-05-12T12:05:07Z" level=debug msg="OVH: changes UPDATENEW dns:\"u1BTO2YJ6soaxrAvHo0svLy1.xxxxxxxxxxxxxxxxxxxxx\" / targets:[redacted] / type:A"
time="2025-05-12T12:05:07Z" level=debug msg="OVH: changes UPDATENEW dns:\"u1BTO2YJ6soaxrAvHo0svLy1.xxxxxxxxxxxxxxxxxxxxx\" / targets:[redacted] / type:AAAA"
time="2025-05-12T12:05:07Z" level=debug msg="OVH: changes UPDATENEW dns:\"yyyyyyyyyyyyyyyyyyyyyyyy\" / targets:[redacted] / type:AAAA"
time="2025-05-12T12:05:07Z" level=debug msg="OVH: changes UPDATENEW dns:\"yyyyyyyyyyyyyyyyyyyyyyyy\" / targets:[redacted] / type:A"
time="2025-05-12T12:05:07Z" level=debug msg="OVH: changes UPDATENEW dns:\"xxxxxxxx-a-u1BTO2YJ6soaxrAvHo0svLy1.xxxxxxxxxxxxxxxxxxxxx\" / targets:\"zT/eXU0uCOhmQ6Iwz/CIA0dVggvHdcE1zLjuu4p/lBgFFxA4CbDB5lq2ztzKZUeXxHGyDR8q6vTcMQWK2FwPF8gffQqrCDCFnTj5Z1FHzgE9Ra8RPd9siq28FBt07zIC4pGQW0+c/IyLJTQY+hdGHnOJj2ozm1jDNgkHOrzTUxFBKp7tnWnUKOWIPaZ5+Q==\" / type:TXT"
time="2025-05-12T12:05:07Z" level=debug msg="OVH: changes UPDATENEW dns:\"xxxxxxxx-aaaa-u1BTO2YJ6soaxrAvHo0svLy1.xxxxxxxxxxxxxxxxxxxxx\" / targets:\"QICrQtqEjnOgsElmoeScDGXQBR/c/iUh8pP08eyLHRbSLZ5ubd+cyw/0YgdR3uiBfB/S826oh5uIZdUruO8I7fIOHtyibfO4V03P6JtS8aZlJ9cEz3fZcFt8lR8q5c+eqG/4OHQqsMRVCm6jRQZUIR3iR9ZUseXfDuTg+MLz+srRJZT57aeZ/9aMV8TrtA==\" / type:TXT"
time="2025-05-12T12:05:07Z" level=debug msg="OVH: changes UPDATENEW dns:\"xxxxxxxx-aaaa-yyyyyyyyyyyyyyyyyyyyyyyy\" / targets:\"n0PxkUifztEXak9hKunQfCs+9MDrO7eRBkh4MMBW9fbYjgFzFCRG1z01/blB8td9dWxqAecV3VCpQkzPDIiImKb8wOzzQjsN6ceYKhhmgDDB7/7tOt5x81otloYCtEwAdG88qouqk4X23otb2SAD4ctaEdx3gtkCWdpE2wF0u4X6l4l8md7ShXUkzTrPgA==\" / type:TXT"
time="2025-05-12T12:05:07Z" level=debug msg="OVH: changes UPDATENEW dns:\"xxxxxxxx-a-yyyyyyyyyyyyyyyyyyyyyyyy\" / targets:\"4os1HKnXpc6X7y6E43f/LLr7IO8XZjOUD8Baac9cAG2UAjQVh2wQUpqOfh9ufiT0d5DRjoFqLEcyvZr5DIfPcnCB1DfRqoTYdsne0wD1uRXjWFflyrp2B4DD8DuEze4oCB7Ib0vVnVM8aFomI9tAaX4Lf0n2Is6ZW7WtnvFlAjPFWipLRrTikK3QEAcx6g==\" / type:TXT"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x293bc68]

goroutine 290 [running]:
sigs.k8s.io/external-dns/provider/ovh.OVHProvider.newOvhChangeUpdate({{}, {0x3f79620, 0x4000bff8c0}, {0x3f2ecc0, 0x40010208c0}, {{0x4000408850, 0x1, 0x1}, {0x0, 0x0, ...}, ...}, ...}, ...)
    sigs.k8s.io/external-dns/provider/ovh/ovh.go:590 +0x688
sigs.k8s.io/external-dns/provider/ovh.OVHProvider.computeSingleZoneChanges({{}, {0x3f79620, 0x4000bff8c0}, {0x3f2ecc0, 0x40010208c0}, {{0x4000408850, 0x1, 0x1}, {0x0, 0x0, ...}, ...}, ...}, ...)
    sigs.k8s.io/external-dns/provider/ovh/ovh.go:207 +0x234
sigs.k8s.io/external-dns/provider/ovh.(*OVHProvider).handleSingleZoneUpdate(0x40010342c0, {0x3f791a8, 0x4000652870}, {0x4000bbde80, 0x10}, {0x400028e008?, 0x0?, 0x0?}, 0x0?)
    sigs.k8s.io/external-dns/provider/ovh/ovh.go:214 +0x98
sigs.k8s.io/external-dns/provider/ovh.(*OVHProvider).ApplyChanges.func2()
    sigs.k8s.io/external-dns/provider/ovh/ovh.go:266 +0x44
golang.org/x/sync/errgroup.(*Group).Go.func1()
    golang.org/x/[email protected]/errgroup/errgroup.go:79 +0x54
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1
    golang.org/x/[email protected]/errgroup/errgroup.go:76 +0x94
stream closed EOF for external-dns/external-dns-54f8cd75d7-7q5bz (external-dns)

What you expected to happen:

Not to crash.

How to reproduce it (as minimally and precisely as possible):

See below as to what it is and hence how to reproduce.

Anything else we need to know?:

Did a quick read on what it could be, and I think it is due to capitalization:

UPDATEOLD

u1bto2yj6soaxravho0svly1.xxxxxxxxxxxxxxxxxxxxx
u1bto2yj6soaxravho0svly1.xxxxxxxxxxxxxxxxxxxxx
yyyyyyyyyyyyyyyyyyyyyyyy
yyyyyyyyyyyyyyyyyyyyyyyy
xxxxxxxx-a-u1bto2yj6soaxravho0svly1.xxxxxxxxxxxxxxxxxxxxx
xxxxxxxx-aaaa-u1bto2yj6soaxravho0svly1.xxxxxxxxxxxxxxxxxxxxx
xxxxxxxx-aaaa-yyyyyyyyyyyyyyyyyyyyyyyy
xxxxxxxx-a-yyyyyyyyyyyyyyyyyyyyyyyy

UPDATENEW

u1BTO2YJ6soaxrAvHo0svLy1.xxxxxxxxxxxxxxxxxxxxx
u1BTO2YJ6soaxrAvHo0svLy1.xxxxxxxxxxxxxxxxxxxxx
yyyyyyyyyyyyyyyyyyyyyyyy
yyyyyyyyyyyyyyyyyyyyyyyy
xxxxxxxx-a-u1BTO2YJ6soaxrAvHo0svLy1.xxxxxxxxxxxxxxxxxxxxx
xxxxxxxx-aaaa-u1BTO2YJ6soaxrAvHo0svLy1.xxxxxxxxxxxxxxxxxxxxx
xxxxxxxx-aaaa-yyyyyyyyyyyyyyyyyyyyyyyy
xxxxxxxx-a-yyyyyyyyyyyyyyyyyyyyyyyy

This causes the unchecked lookup on line 586 to return null. This is not checked and as such, line 590 throws.

for id := range oldEndpointByTypeAndName {
oldRecords := slices.Clone(oldRecordsInZone[id])
endpointsNew := newEndpointByTypeAndName[id]
var toInsertTarget []string
for _, target := range endpointsNew.Targets {

Weirdly enough from a quick glance on https://datatracker.ietf.org/doc/html/rfc4343 it seems that case should be kept by DNS providers, but in the case of OVH, this is NOT done.

To conclude:

  • To avoid these kind of issues, maybe it is good to lowercase all DNS zones/domains/labels throughout external DNS?
  • An extra check in the OVH provider (maybe others) to avoid assuming records exist?

Environment:

  • External-DNS version (use external-dns --version): external-dns:v20250508-v0.16.1-138-g8d8f8136
  • DNS provider: OVH
  • Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions