weather applet fails with stacktrace with 22.04

Bug #1970742 reported by Mike Brown
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
weather-util (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Since lubuntu 22.04 upgrade, 'weather' fails as follows:

mwbrown@tds:~$ weather ncl
Traceback (most recent call last):
  File "/usr/lib/python3.10/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.10/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.10/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.10/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3.10/http/client.py", line 1454, in connect
    self.sock = self._context.wrap_socket(self.sock,
  File "/usr/lib/python3.10/ssl.py", line 512, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/lib/python3.10/ssl.py", line 1070, in _create
    self.do_handshake()
  File "/usr/lib/python3.10/ssl.py", line 1341, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/weather-util/weather.py", line 221, in get_uri
    data = urlopen(uri).read().decode("utf-8")
  File "/usr/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/usr/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib/python3.10/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:997)>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/weather", line 70, in <module>
    partial = weather.get_metar(
  File "/usr/share/weather-util/weather.py", line 266, in get_metar
    metar = get_uri(
  File "/usr/share/weather-util/weather.py", line 230, in get_uri
    sys.exc_type,
AttributeError: module 'sys' has no attribute 'exc_type'

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: ubuntu-release-upgrader-core 1:22.04.10
ProcVersionSignature: Ubuntu 5.15.0-27.28-generic 5.15.30
Uname: Linux 5.15.0-27-generic x86_64
ApportVersion: 2.20.11-0ubuntu82
Architecture: amd64
CasperMD5CheckResult: unknown
CrashDB: ubuntu
CrashReports: 640:1000:134:24011:2022-04-28 10:03:05.411130077 +0100:2022-04-28 10:03:05.411130077 +0100:/var/crash/_usr_bin_weather.1000.crash
CurrentDesktop: LXQt
Date: Thu Apr 28 12:44:21 2022
InstallationDate: Installed on 2021-08-18 (253 days ago)
InstallationMedia: Lubuntu 21.04 "Hirsute Hippo" - Release amd64 (20210420)
PackageArchitecture: all
SourcePackage: ubuntu-release-upgrader
Symptom: dist-upgrade
UpgradeStatus: Upgraded to jammy on 2022-04-28 (0 days ago)
VarLogDistupgradeTermlog:

Revision history for this message
Mike Brown (s7505118) wrote :
Nick Rosbrook (enr0n)
affects: ubuntu-release-upgrader (Ubuntu) → weather-util (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in weather-util (Ubuntu):
status: New → Confirmed
Revision history for this message
Christian Pate (trekkie1701c) wrote :

The problem seems to be an issue with the upstream website that this pulls data from (https://tgftp.nws.noaa.gov/data/) which seems to have some odd SSL errors; although it will load fine in a browser and says that it's using TLS 1.2, both this utility and cURL seem to fail due 'unsafe legacy renegotiations' being disabled.

It is possible to override this behavior locally and 'fix' it with a custom openssl.conf (see: https://stackoverflow.com/questions/71603314/ssl-error-unsafe-legacy-renegotiation-disabled) which does allow this utility to work as intended, although with the risk of man-in-the-middle attacks.

Revision history for this message
Jeremy Stanley (fungi) wrote :

Testing both with the version of weather-util curl on Jammy, I do not currently see SSL errors reported. Seems like this was a transient problem with the USA NOAA/NWS web servers which has since been corrected.

Changed in weather-util (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Jeremy Stanley (fungi) wrote :

Marked as "invalid" since it wasn't a bug in the software, and no changes were required to "fix" it (so "fix released" made less sense).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.