Activity log for bug #1874527

Date Who What changed Old value New value Message
2020-04-23 19:47:30 SC bug added bug
2020-04-23 19:55:01 SC description Cloud Provider: AWS. Cloud-init v. 19.3-2.amzn2. Config says system_info: distro: amazon Per https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html the VPC DHCP Options set can have a domain-name value with multiple domain names separated by spaces. However, if using this approach, cloud-init sets an incorrect hostname. It appears to concatenate the unqualified host name to the Options Set host names without spaces, and truncating to a certain number of characters. This is with "set-hostname" and "update-hostname" modules enabled, but no other relevant cloud-init config. For example, if your unqualified hostname is ip-10-30-10-155 and your DHCP Options Set domain-name is "foo.bar.example.com baz.bat.example.com" you might get an incorrect hostname such as "ip-10-30-10-155.foo.bar.example.combaz.bat.ex" This problem appears to be due to misinterpretation of the output of the EC2 metadata service for "local-hostname", which responds with output similar to above, but with spaces retained, for example: "ip-10-30-10-155.foo.bar.example.com baz.bat.example.com" The cloud-init log output also mentions this problem, for example you might have logs which look like: Mar 18 00:31:33 cloud-init[3825]: cc_set_hostname.py[DEBUG]: Setting the hostname to ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal (ip-10-30-10-155) Mar 18 00:31:33 cloud-init[3825]: util.py[DEBUG]: Running command ['hostnamectl', 'set-hostname', 'ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.egailab s.expedia.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal'] with allowed return codes [0] (shell=False, capture=True) Mar 18 00:31:33 cloud-init[3825]: __init__.py[DEBUG]: Non-persistently setting the system hostname to ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.egai labs.expedia.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal Mar 18 00:31:33 cloud-init[3825]: util.py[DEBUG]: Running command ['hostname', 'ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-we st-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal'] with allowed return codes [0] (shell=False, capture=True) Mar 18 00:31:33 cloud-init[3825]: util.py[WARNING]: Failed to non-persistently adjust the system hostname to ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.te st.egailabs.expedia.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal Mar 18 00:31:33 cloud-init[3825]: util.py[DEBUG]: Failed to non-persistently adjust the system hostname to ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/cloudinit/distros/__init__.py", line 230, in _apply_hostname util.subp(['hostname', hostname]) File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 2105, in subp cmd=args) ProcessExecutionError: Unexpected error while running command. Command: ['hostname', 'ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal'] Exit code: 1 Reason: - Stdout: Stderr: hostname: the specified hostname is invalid Cloud Provider: AWS. Cloud-init v. 19.3-2.amzn2. Config says system_info: distro: amazon Per https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html the VPC DHCP Options set can have a domain-name value with multiple domain names separated by spaces. However, if using this approach, cloud-init sets an incorrect hostname. It appears to concatenate the unqualified host name to the Options Set host names without spaces, and truncating to a certain number of characters. This is with "set-hostname" and "update-hostname" modules enabled, but no other relevant cloud-init config. For example, if your unqualified hostname is ip-10-30-10-155 and your DHCP Options Set domain-name is "foo.bar.example.com baz.bat.example.com" you might get an incorrect hostname such as "ip-10-30-10-155.foo.bar.example.combaz.bat.ex" This problem appears to be due to misinterpretation of the output of the EC2 metadata service for "local-hostname", which responds with output similar to above, but with spaces retained and no truncating, for example: "ip-10-30-10-155.foo.bar.example.com baz.bat.example.com" The cloud-init log output also mentions this problem, for example you might have logs which look like: Mar 18 00:31:33 cloud-init[3825]: cc_set_hostname.py[DEBUG]: Setting the hostname to ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal (ip-10-30-10-155) Mar 18 00:31:33 cloud-init[3825]: util.py[DEBUG]: Running command ['hostnamectl', 'set-hostname', 'ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.egailab s.expedia.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal'] with allowed return codes [0] (shell=False, capture=True) Mar 18 00:31:33 cloud-init[3825]: __init__.py[DEBUG]: Non-persistently setting the system hostname to ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.egai labs.expedia.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal Mar 18 00:31:33 cloud-init[3825]: util.py[DEBUG]: Running command ['hostname', 'ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-we st-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal'] with allowed return codes [0] (shell=False, capture=True) Mar 18 00:31:33 cloud-init[3825]: util.py[WARNING]: Failed to non-persistently adjust the system hostname to ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.te st.egailabs.expedia.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal Mar 18 00:31:33 cloud-init[3825]: util.py[DEBUG]: Failed to non-persistently adjust the system hostname to ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal Traceback (most recent call last):   File "/usr/lib/python2.7/site-packages/cloudinit/distros/__init__.py", line 230, in _apply_hostname     util.subp(['hostname', hostname])   File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 2105, in subp     cmd=args) ProcessExecutionError: Unexpected error while running command. Command: ['hostname', 'ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal'] Exit code: 1 Reason: - Stdout: Stderr: hostname: the specified hostname is invalid
2020-04-24 00:11:08 SC description Cloud Provider: AWS. Cloud-init v. 19.3-2.amzn2. Config says system_info: distro: amazon Per https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html the VPC DHCP Options set can have a domain-name value with multiple domain names separated by spaces. However, if using this approach, cloud-init sets an incorrect hostname. It appears to concatenate the unqualified host name to the Options Set host names without spaces, and truncating to a certain number of characters. This is with "set-hostname" and "update-hostname" modules enabled, but no other relevant cloud-init config. For example, if your unqualified hostname is ip-10-30-10-155 and your DHCP Options Set domain-name is "foo.bar.example.com baz.bat.example.com" you might get an incorrect hostname such as "ip-10-30-10-155.foo.bar.example.combaz.bat.ex" This problem appears to be due to misinterpretation of the output of the EC2 metadata service for "local-hostname", which responds with output similar to above, but with spaces retained and no truncating, for example: "ip-10-30-10-155.foo.bar.example.com baz.bat.example.com" The cloud-init log output also mentions this problem, for example you might have logs which look like: Mar 18 00:31:33 cloud-init[3825]: cc_set_hostname.py[DEBUG]: Setting the hostname to ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal (ip-10-30-10-155) Mar 18 00:31:33 cloud-init[3825]: util.py[DEBUG]: Running command ['hostnamectl', 'set-hostname', 'ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.egailab s.expedia.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal'] with allowed return codes [0] (shell=False, capture=True) Mar 18 00:31:33 cloud-init[3825]: __init__.py[DEBUG]: Non-persistently setting the system hostname to ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.egai labs.expedia.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal Mar 18 00:31:33 cloud-init[3825]: util.py[DEBUG]: Running command ['hostname', 'ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-we st-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal'] with allowed return codes [0] (shell=False, capture=True) Mar 18 00:31:33 cloud-init[3825]: util.py[WARNING]: Failed to non-persistently adjust the system hostname to ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.te st.egailabs.expedia.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal Mar 18 00:31:33 cloud-init[3825]: util.py[DEBUG]: Failed to non-persistently adjust the system hostname to ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal Traceback (most recent call last):   File "/usr/lib/python2.7/site-packages/cloudinit/distros/__init__.py", line 230, in _apply_hostname     util.subp(['hostname', hostname])   File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 2105, in subp     cmd=args) ProcessExecutionError: Unexpected error while running command. Command: ['hostname', 'ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal'] Exit code: 1 Reason: - Stdout: Stderr: hostname: the specified hostname is invalid Cloud Provider: AWS. Cloud-init v. 19.3-2.amzn2. Config says system_info: distro: amazon Per https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html the VPC DHCP Options set can have a domain-name value with multiple domain names separated by spaces. However, if using this approach, cloud-init sets an incorrect hostname. It appears to concatenate the unqualified host name to the Options Set host names without spaces, and truncating to a certain number of characters. This is with "set-hostname" and "update-hostname" modules enabled, but no other relevant cloud-init config. For example, if your unqualified hostname is ip-10-30-10-155 and your DHCP Options Set domain-name is "foo.bar.example.com baz.bat.example.com" you might get an incorrect hostname such as "ip-10-30-10-155.foo.bar.example.combaz.bat.ex" This problem appears to be due to misinterpretation of the output of the EC2 metadata service for "local-hostname", which responds with output similar to above, but with spaces retained and no truncating, for example: "ip-10-30-10-155.foo.bar.example.com baz.bat.example.com" The cloud-init log output also mentions this problem, for example you might have logs which look like: Mar 18 00:31:33 cloud-init[3825]: cc_set_hostname.py[DEBUG]: Setting the hostname to ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal (ip-10-30-10-155) Mar 18 00:31:33 cloud-init[3825]: util.py[DEBUG]: Running command ['hostnamectl', 'set-hostname', 'ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal'] with allowed return codes [0] (shell=False, capture=True) Mar 18 00:31:33 cloud-init[3825]: __init__.py[DEBUG]: Non-persistently setting the system hostname to ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal Mar 18 00:31:33 cloud-init[3825]: util.py[DEBUG]: Running command ['hostname', 'ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-we st-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal'] with allowed return codes [0] (shell=False, capture=True) Mar 18 00:31:33 cloud-init[3825]: util.py[WARNING]: Failed to non-persistently adjust the system hostname to ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.te st.abcdefg.example.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal Mar 18 00:31:33 cloud-init[3825]: util.py[DEBUG]: Failed to non-persistently adjust the system hostname to ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal Traceback (most recent call last):   File "/usr/lib/python2.7/site-packages/cloudinit/distros/__init__.py", line 230, in _apply_hostname     util.subp(['hostname', hostname])   File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 2105, in subp     cmd=args) ProcessExecutionError: Unexpected error while running command. Command: ['hostname', 'ip-10-30-10-155.us-west-2.i.test.abcdefg.example.com i.test.abcdefg.example.com us-west-2.test.abcdefg.example.com test.abcdefg.example.com us-west-2.compute.internal'] Exit code: 1 Reason: - Stdout: Stderr: hostname: the specified hostname is invalid
2020-04-24 14:07:20 Paride Legovini cloud-init: status New Triaged
2020-04-24 14:07:23 Paride Legovini cloud-init: importance Undecided Low
2023-05-12 05:38:32 James Falcon bug watch added https://github.com/canonical/cloud-init/issues/3659
2023-05-12 05:38:33 James Falcon cloud-init: status Triaged Expired