Machine interfaces allow '_' character, results on a interface based domain breaking bind (as it doesn't allow it for the host part).

Bug #1807725 reported by Wojtek Rakoniewski
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Tiago Pasqualini da Silva
3.0
Won't Fix
Medium
Unassigned
3.1
Fix Released
Medium
Unassigned
3.2
Fix Released
Medium
Jack Lloyd-Walters
3.3
Fix Released
Medium
Alexsander de Souza

Bug Description

MAAS with build in bind stops resolving domains when interface name contains _ character.

How to reproduce:
Please change network interface name for any machine using _ character inside.
Then please try to resolve that host name of machine with that interface using MAAS build in dns server.

Error occurs because _ character is not allowed in domains but MAAS creates dns record using interface name. Bind is unable do load file with bad characters. All records from that zone file can't be resolved.

Part of logs:
dns_rdata_fromtext: /etc/bind/maas/zone.0.48.10.in-addr.arpa:15: near 'ph_admin.idepos40-ka.infra.': bad name (check-names)
zone 0.48.10.in-addr.arpa/IN: loading from master file /etc/bind/maas/zone.0.48.10.in-addr.arpa failed: bad name (check-names)

Zone file content (find word ph_admin - here is a problem):
; Zone file modified: 2018-12-10 14:55:54.606848.
$TTL 30
@ IN SOA maas. nobody.example.com. (
              0000001553 ; serial
              600 ; Refresh
              1800 ; Retry
              604800 ; Expire
              30 ; NXTTL
              )

@ 30 IN NS maas.
31 30 IN PTR imaas31-ka.maas.
30 30 IN PTR imaas32-op.maas.
41 30 IN PTR ens18.idepceph41-ka.infra.
40 30 IN PTR ph_admin.idepos40-ka.infra.
32 30 IN PTR ens18.imaas32-op.maas.

Proposal of repair:
Please add option to global setting so admin can choose between two options:
1. "_" is Allowed in interface name but it will be replaced by another character in domain name
2. "_" character is not allowed in interface name and field validation fails if it will be used

Checked on: 2.5.0~rc2 (7433-gea48d302e-0ubuntu1~18.04.1)

--
Regards,
Wojtek

Related branches

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi Wojtek,

Do you happen to have any reference about NIC naming? It seems wrong to me that linux would allow you to add NICs with the '_'.

That said, I don't agree with having a global option to change the behavior of this, provided that just leads to confusion and not the best experience. My inclination would be to simply prevent users from creating interface names that include the '_' character.

Changed in maas:
status: New → Incomplete
summary: - Bind stopped resolving when using _ character is in interface name
+ [2.5] Machine interfaces allow '_' character, results on a interface
+ based domain breaking bind (as it doesn't allow it for the host part).
Changed in maas:
importance: Undecided → Medium
milestone: none → 2.5.1
Revision history for this message
Wojtek Rakoniewski (enter2608) wrote : Re: [2.5] Machine interfaces allow '_' character, results on a interface based domain breaking bind (as it doesn't allow it for the host part).

Hi Andres,
I'm often changing interface name in linux to vlan name (not number) or similar. It is not limitation of linux. In linux you can use _ in interface name without problem, it works also with maas. When you configure interface with underscore character, maas properly configure interface names in netplan and interfaces will work properly in linux.
Problem is limitation of domain names. According to https://tools.ietf.org/html/rfc1035 only letters, digits and - character is only allowed.
I assume that in linux for interface name it is possible to use the same characters as for file names.

According to my situation I simply change naming convention and I'm not using _ characters in interface names any more, but it is new project so it is not problem to me.
For me global option to change naming behavior is not necessary. From other side maybe someone uses underscore in interface names because linux allow and it will be problem when you release new version of maas with underscore limitation.
In my opinion if you do not want to add global option better will be replace underscore character to another or remove it when generating domain names.

--
Regards,
Wojtek

Changed in maas:
milestone: 2.5.1 → 2.5.2
Changed in maas:
milestone: 2.5.2 → 2.5.3
Changed in maas:
milestone: 2.5.3 → 2.6.0beta2
Changed in maas:
milestone: 2.6.0beta2 → 2.6.0rc1
Changed in maas:
assignee: nobody → Newell Jensen (newell-jensen)
Changed in maas:
milestone: 2.6.0rc1 → 2.6.0rc2
Changed in maas:
milestone: 2.6.0rc2 → 2.7.0alpha1
Changed in maas:
assignee: Newell Jensen (newell-jensen) → nobody
milestone: 2.7.0alpha1 → none
status: Incomplete → Triaged
Revision history for this message
Nikolay Pliashechnikov (npliashechnikov) wrote :

I have also encountered this bug.
Maas kept adding docker_gwbridge interface to the zone config.

Adding "check-names master ignore;" to named.conf.options helped to circumvent the issue.

Revision history for this message
James McTavish (james-somewherestrange) wrote :

I've also got this with 2.7.0 with a snap install.

Is there an easy way to add the "check-names master ignore;", or is this fixed in the 2.8 beta?

tags: added: dns-modeling
Changed in maas:
assignee: nobody → Tiago Pasqualini da Silva (tiago.pasqualini)
tags: added: sts
summary: - [2.5] Machine interfaces allow '_' character, results on a interface
- based domain breaking bind (as it doesn't allow it for the host part).
+ Machine interfaces allow '_' character, results on a interface based
+ domain breaking bind (as it doesn't allow it for the host part).
Changed in maas:
status: Triaged → In Progress
milestone: none → 3.4.0
Revision history for this message
Micke Löfstrand (mikaelld) wrote :

So, we ran into this today. Is there any kind of plan to fix this, other than ignoring faulty records in zone files generated by MAAS?

Revision history for this message
Micke Löfstrand (mikaelld) wrote :

If I could get a pointer on where to start looking I might be able to hack together a merge request with a fix, but I haven't looked much at the MAAS code base as of yet.

Revision history for this message
Micke Löfstrand (mikaelld) wrote :

Just realised @Tiago already did the work back in December. Thanks! Let's hope it gets merged soon!

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

MAAS bug-council,

This is desired on MAAS 3.0.

If the MR to 3.4 is approved, can we send backport MRs to 3.3 and 3.2 (currently maintained by MAAS Eng) ? We'd follow with 3.1 and 3.0 releases later (maintained by SEG, at the moment).

Thanks!

tags: added: bug-council
tags: removed: bug-council
tags: added: dns-modelling
removed: dns-modeling
tags: added: dns-modeling
removed: dns-modelling
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

The user will upgrade to MAAS 3.1, thus marking 3.0 as Won't Fix.

Revision history for this message
Tiago Pasqualini da Silva (tiago.pasqualini) wrote :

MAAS bug-council,

My patch seems ready and without any outstanding reviews. Do you need anything else from me on this?

Thank you!

tags: added: bug-council
Changed in maas:
status: In Progress → Fix Committed
Revision history for this message
Jerzy Husakowski (jhusakowski) wrote :

The issue is on track to be released, thank you for your contribution!

tags: removed: bug-council
Alberto Donato (ack)
Changed in maas:
milestone: 3.4.0 → 3.4.0-beta3
Alberto Donato (ack)
Changed in maas:
status: Fix Committed → Fix Released
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Hello Tiago, or anyone else affected,

Accepted maas 3.1.2 into ppa:maas/3.1-next and snap:3.1/edge
(code version 3.1.2-10926-g.5ad7060e5).

Please test this update and provide your feedback on this bug:

If it fixes the bug for you, please add a comment mentioning the version you tested and what testing has been performed, and change the tag from verification-needed-maas-3.1 to verification-done-maas-3.1.

If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-maas-3.1.

Thank you in advance for helping!

The update will be released after the bug(s) have been verified and quality assurance testing is successful.

tags: added: verification-needed-maas-3.1
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Verification done on maas 3.1.

Installed from ppa:maas/3.1-next, enlisted and commissioned a system ("free-parrot") with _two_ network interfaces in the subnet (as the 1st/PXE network interface does not get a PTR record with its name), and clicked 'Actions -> Edit Physical' and set their names to 'nic_one' (1st/PXE) and 'nic_two_test' (2nd/non-PXE), and clicked 'Deploy', which immediately updates the bind zone config.

The PTR record for network interface 'nic_two_test' (with underscores) is 'nic-two-test' (without underscores).

# maas admin machines read | jq '.[0] | .fqdn, ( .interface_set[] | .name, .links[].ip_address )' -r
free-parrot.maas
nic_one
10.0.0.7
nic_two_test
10.0.0.8

# grep free-parrot /etc/bind/maas/zone.0.0.10.in-addr.arpa
7 30 IN PTR free-parrot.maas.
8 30 IN PTR nic-two-test.free-parrot.maas.

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

# apt-cache policy maas
maas:
  Installed: 1:3.1.2-10926-g.5ad7060e5-0ubuntu1~20.04.1
  Candidate: 1:3.1.2-10926-g.5ad7060e5-0ubuntu1~20.04.1
  Version table:
 *** 1:3.1.2-10926-g.5ad7060e5-0ubuntu1~20.04.1 500
        500 http://ppa.launchpad.net/maas/3.1-next/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status

tags: added: verification-done-maas-3.1
removed: verification-needed-maas-3.1
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

MAAS 3.1.2 has been released:
- deb: ppa:maas/3.1 (1:3.1.2-10926-g.5ad7060e5-0ubuntu1~20.04.1 )
- snap: 3.1/stable (3.1.2-10926-g.5ad7060e5)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.