Activity log for bug #2027521

Date Who What changed Old value New value Message
2023-07-11 23:04:37 Chad Smith bug added bug
2023-07-11 23:04:54 Chad Smith description Low-priority, but something that hit me during development of cc_landscape module in cloud-init. Bad landscape/client.conf values for log_level do not result in helpful errors or logs when using landscape-config --silent. $ cat > ls2.yaml <<EOF #cloud-config packages: [landscape-client] EOF $ lxc launch ubuntu-daily:mantic ls-m -c cloud-init.user-data="$(cat ls2.yaml)" $ lxc exec ls-m -- cloud-init status --wait --long $ lxc exec ls-m -- landscape-config --silent --account-name=your-account --computer-title=mytestvm --data-path=/var/lib/landscape/client --log-level="'info'" --ping-url=http://landscape.canonical.com/ping --url=https://landscape.canonical.com/message-system Created symlink /etc/systemd/system/multi-user.target.wants/landscape-client.service → /lib/systemd/system/landscape-client.service. Please wait... Traceback (most recent call last): Failure: twisted.internet.error.ConnectError: An error occurred while connecting: 2: No such file or directory. No longs in /var/log/landscape appear to be emitted as a result of the landscape-config CLI command. So debugging is unhelpful. To confirm the failure issue one can try to invoke the broker directly which gives a helpful traceback as to what my problem was: $ sudo -u landscape /usr/bin/python3 /usr/bin/landscape-broker Traceback (most recent call last): File "/usr/bin/landscape-broker", line 8, in <module> run(sys.argv)can File "/usr/lib/python3/dist-packages/landscape/client/broker/service.py", line 94, in run run_landscape_service(BrokerConfiguration, BrokerService, args) File "/usr/lib/python3/dist-packages/landscape/client/service.py", line 73, in run_landscape_service init_logging(configuration, service_class.service_name) File "/usr/lib/python3/dist-packages/landscape/client/deployment.py", line 17, in init_logging logging.init_app_logging(configuration.log_dir, configuration.log_level, File "/usr/lib/python3/dist-packages/landscape/lib/logging.py", line 32, in init_app_logging _init_logging( File "/usr/lib/python3/dist-packages/landscape/lib/logging.py", line 45, in _init_logging logger.setLevel(level) File "/usr/lib/python3.11/logging/__init__.py", line 1464, in setLevel self.level = _checkLevel(level) ^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/logging/__init__.py", line 207, in _checkLevel raise ValueError("Unknown level: %r" % level) ValueError: Unknown level: "Level 'INFO'" inv This can be reproduced outside of calling landscape-config, by introducing the invalid value of log_level: 'info' in /etc/landscape/client.conf. I Low-priority, but something that hit me during development of cc_landscape module in cloud-init. Bad landscape/client.conf values for log_level do not result in helpful errors or logs when using landscape-config --silent. $ cat > ls2.yaml <<EOF #cloud-config packages: [landscape-client] EOF $ lxc launch ubuntu-daily:mantic ls-m -c cloud-init.user-data="$(cat ls2.yaml)" $ lxc exec ls-m -- cloud-init status --wait --long $ lxc exec ls-m -- landscape-config --silent --account-name=your-account --computer-title=mytestvm --data-path=/var/lib/landscape/client --log-level="'info'" --ping-url=http://landscape.canonical.com/ping --url=https://landscape.canonical.com/message-system Created symlink /etc/systemd/system/multi-user.target.wants/landscape-client.service → /lib/systemd/system/landscape-client.service. Please wait... Traceback (most recent call last): Failure: twisted.internet.error.ConnectError: An error occurred while connecting: 2: No such file or directory. No longs in /var/log/landscape appear to be emitted as a result of the landscape-config CLI command. So debugging is unhelpful. To confirm the failure issue one can try to invoke the broker directly which gives a helpful traceback as to what my problem was: $ sudo -u landscape /usr/bin/python3 /usr/bin/landscape-broker Traceback (most recent call last):   File "/usr/bin/landscape-broker", line 8, in <module>     run(sys.argv)can   File "/usr/lib/python3/dist-packages/landscape/client/broker/service.py", line 94, in run     run_landscape_service(BrokerConfiguration, BrokerService, args)   File "/usr/lib/python3/dist-packages/landscape/client/service.py", line 73, in run_landscape_service     init_logging(configuration, service_class.service_name)   File "/usr/lib/python3/dist-packages/landscape/client/deployment.py", line 17, in init_logging     logging.init_app_logging(configuration.log_dir, configuration.log_level,   File "/usr/lib/python3/dist-packages/landscape/lib/logging.py", line 32, in init_app_logging     _init_logging(   File "/usr/lib/python3/dist-packages/landscape/lib/logging.py", line 45, in _init_logging     logger.setLevel(level)   File "/usr/lib/python3.11/logging/__init__.py", line 1464, in setLevel     self.level = _checkLevel(level)                  ^^^^^^^^^^^^^^^^^^   File "/usr/lib/python3.11/logging/__init__.py", line 207, in _checkLevel     raise ValueError("Unknown level: %r" % level) ValueError: Unknown level: "Level 'INFO'" inv This can be reproduced outside of calling landscape-config, by introducing the invalid value of log_level: 'info' in /etc/landscape/client.conf.
2023-07-11 23:20:57 Chad Smith summary landscape-config: --silent fails with unhelpful socket error when log_level config value in invalid landscape-config: --silent fails with unhelpful twisted error file not found when log_level config value is invalid
2023-07-12 00:00:51 Mitch Burton landscape-client: assignee Mitch Burton (mitchburton)
2023-07-12 00:04:32 Mitch Burton landscape-client: status New Confirmed
2023-07-12 00:04:36 Mitch Burton landscape-client: importance Undecided Medium
2023-07-12 00:06:04 Mitch Burton landscape-client: status Confirmed Triaged
2023-07-13 21:05:37 Mitch Burton landscape-client: status Triaged In Progress
2023-07-18 17:07:12 Mitch Burton landscape-client: status In Progress Fix Committed
2023-08-16 22:29:20 Launchpad Janitor merge proposal linked https://code.launchpad.net/~silverdrake11/ubuntu/+source/landscape-client/+git/landscape-client/+merge/449306
2023-08-17 22:14:34 Launchpad Janitor merge proposal unlinked https://code.launchpad.net/~silverdrake11/ubuntu/+source/landscape-client/+git/landscape-client/+merge/449306