switch to wget results in no motd-news in clouds

Bug #1889117 reported by Andreas Hasenack
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
base-files (Ubuntu)
Fix Released
Undecided
Andreas Hasenack

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

Related branches

Changed in base-files (Ubuntu):
assignee: nobody → Andreas Hasenack (ahasenack)
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

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 <email address hidden> Mon, 27 Jul 2020 16:44:07 -0300

Changed in base-files (Ubuntu):
status: In Progress → Fix Released
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.