[Bug 1889117] Re: switch to wget results in no motd-news in clouds

Launchpad Bug Tracker 1889117 at bugs.launchpad.net
Mon Jul 27 19:43:53 UTC 2020


** Merge proposal linked:
   https://code.launchpad.net/~ahasenack/ubuntu/+source/base-files/+git/base-files/+merge/388153

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to base-files in Ubuntu.
https://bugs.launchpad.net/bugs/1889117

Title:
  switch to wget results in no motd-news in clouds

Status in base-files package in Ubuntu:
  In Progress

Bug description:
  cloud-specific motd news relies on the user-agent string cloud_id
  /<cloud-name> being included in the user-agent. The server, when
  receiving this string, will try to return the cloud-specific index
  file, which is `index.txt.<cloud-name>`. If that file doesn't exist,
  then the 404 error document is returned, which happens to be set to
  the default `index.txt` normal motd-news file.

  curl happily returns that without flagging this as an error situation
  (a 404: it needs an extra command-line argument for that). wget,
  however, fails without printing the error document:

  $ wget -U cloud_id/aws https://motd.ubuntu.com -O-
  --2020-07-27 15:45:47--  https://motd.ubuntu.com/
  Resolving motd.ubuntu.com (motd.ubuntu.com)... 54.171.230.55, 34.249.145.219, 2a05:d018:91c:3200:c887:2f22:290f:a7c, ...
  Connecting to motd.ubuntu.com (motd.ubuntu.com)|54.171.230.55|:443... connected.
  HTTP request sent, awaiting response... 404 Not Found
  2020-07-27 15:45:48 ERROR 404: Not Found.

  Not only that, it will also fail in its exit status:
  $ echo $?
  8

  Whereas curl didn't:
  $ curl -A cloud_id/aws https://motd.ubuntu.com
   * "If you've been waiting for the perfect Kubernetes dev solution for
     macOS, the wait is over. Learn how to install Microk8s on macOS."

     https://www.techrepublic.com/article/how-to-install-microk8s-on-macos/
  $ echo $?
  0
  $ 

  
  We need to pass --content-on-error, ignore the error status 8 (or all?) and make it quiet (-q):

  $ wget -U cloud_id/aws https://motd.ubuntu.com -O- --content-on-error -q ; echo $?
   * "If you've been waiting for the perfect Kubernetes dev solution for
     macOS, the wait is over. Learn how to install Microk8s on macOS."

     https://www.techrepublic.com/article/how-to-install-microk8s-on-macos/
  8

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/base-files/+bug/1889117/+subscriptions



More information about the foundations-bugs mailing list