This bug was fixed in the package base-files - 11ubuntu10

---------------
base-files (11ubuntu10) groovy; urgency=medium

  * motd/50-motd-news: use the actual wget version variable in the
    user-agent string
  * motd/50-motd-news: handle wget's behavior with a 404 document
    (LP: #1889117)

 -- Andreas Hasenack <andr...@canonical.com>  Mon, 27 Jul 2020 16:44:07
-0300

** Changed in: base-files (Ubuntu)
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, 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:
  Fix Released

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

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to