update-notifier-common

Bug #1005837 reported by Andrei Emeltchenko on 2012-05-29
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
update-notifier (Ubuntu)
Undecided
Unassigned

Bug Description

Does not understand proxy.

Setting up update-notifier-common (0.119ubuntu8.2) ...
flashplugin-installer: downloading http://archive.canonical.com/pool/partner/a/adobe-flashplugin/adobe-flashplugin_11.2.202.235.orig.tar.gz
Traceback (most recent call last):
  File "/usr/lib/update-notifier/package-data-downloader", line 234, in process_download_requests
    dest_file = urllib.urlretrieve(files[i])[0]
  File "/usr/lib/python2.7/urllib.py", line 93, in urlretrieve
    return _urlopener.retrieve(url, filename, reporthook, data)
  File "/usr/lib/python2.7/urllib.py", line 239, in retrieve
    fp = self.open(url, data)
  File "/usr/lib/python2.7/urllib.py", line 207, in open
    return getattr(self, name)(url)
  File "/usr/lib/python2.7/urllib.py", line 344, in open_http
    h.endheaders(data)
  File "/usr/lib/python2.7/httplib.py", line 954, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 814, in _send_output
    self.send(msg)

wget works fine.

Launchpad Janitor (janitor) wrote :

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

Changed in update-notifier (Ubuntu):
status: New → Confirmed

I get this error because downloads need to use a HTTP proxy. The system is configured to use the proxy (i.e. http_proxy environment variable is set) but this environment setting is not used when installing packages through the update-manager.

If I manually run

sudo -i /usr/lib/update-notifier/package-data-downloader

after I get this error everything works fine. The main difference is the -i flag to sudo which enables the normal system environment (containing the http_proxy variable) for the package-data-downloader.

http_proxy is set in /etc/environment:

http_proxy="http://proxy.example.com:3128/"

In addition, I got some proxy configuration in /etc/apt/apt.conf:

Acquire::http::proxy "http://proxy.example.com:3128/";
Acquire::ftp::proxy "ftp://proxy.example.com:3128/";
Acquire::https::proxy "https://proxy.example.com:3128/";
Acquire::socks::proxy "socks://proxy.example.com:3128/";

The fix was taken from https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/983559
Also https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/979477 seems to be related, however, there is a big mixup between honoring APT settings, system settings, allowing http_proxy to be passed via sudo, so I'm unsure if there is a duplicate bug situation or not.

This bug is still present in Ubuntu 12.10.

ii update-notifier-common 0.126 all Files shared between update-notifier and other packages

I get a daily error message that additional data files for flashplugin-installer cannot be downloaded.

Reason for this bug is that the cronjob doesn't honour any system settings for proxy server.

This can be fixed by changing /etc/cron.daily/update-notifier-common to:

#!/bin/sh

set -e

[ -x /usr/lib/update-notifier/package-data-downloader ] || exit 0

. /etc/environment
export http_proxy https_proxy

# Try to rerun any package data downloads that failed at package install time.
/usr/lib/update-notifier/package-data-downloader

latimerio (fomember) wrote :

I administer >100 hosts with 12.04LTS and 14.04LTS and the problem with update-notifier-common not respecting proxy settings is very annoying.
I have set the proxy in /etc/apt/apt.d/95proxies in /etc/environment and with gsettings as recommended in http://askubuntu.com/questions/150210/how-do-i-set-systemwide-proxy-servers-in-xubuntu-lubuntu-or-ubuntu-studio but still anacron reports the error.
I think the real bug is #1209146 as anacron does not run with the correct environment settings.

Josep Pujadas-Jubany (jpujades) wrote :

/usr/lib/update-notifier/package-data-downloader from update-notifier uses python urllib

It seems to be problems when using proxies. In addition, urllib doesn't supports https protocol.

https://docs.python.org/2/library/urllib.html#urllib-restrictions

Using a http proxy, adobe-flashplugin updates will work but not allways:

urllib.urlretrieve("http://archive.canonical.com/pool/partner/a/adobe-flashplugin/adobe-flashplugin_11.2.202.425.orig.tar.gz", "adobe-flashplugin.tar.gz")

Using a https proxy, pepflashpluguin updates will never work:

urllib.urlretrieve("https://dl-ssl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_39.0.2171.95-1_i386.deb", "google-chrome.deb")

So, scripts must be something like:

export http_proxy=http://192.168.0.1:3128
export https_proxy=https://192.168.0.1:3128
apt-get install -y flashplugin-installer
apt-get install -y pepflashplugin-installer
echo "" >> /etc/chromium-browser/default
echo ". /usr/lib/pepflashplugin-installer/pepflashplayer.sh" >> /etc/chromium-browser/default
echo "" >> /etc/chromium-browser/default
unset http_proxy
unset https_proxy
apt-get --reinstall install -y flashplugin-installer
apt-get --reinstall install -y pepflashplugin-installer

Of course, if yo do this, your corporative firewall/proxy must allow direct connections to archive.canonical.com (http) and dl-ssl.google.com (https).

In my opinion, update-notifier (and other applications using urllib) should avoid python urllib

There are many bugs related (in fact, they are duplicated):

https://bugs.launchpad.net/ubuntu/+source/anacron/+bug/1209146
https://bugs.launchpad.net/ubuntu/+source/flashplugin-nonfree/+bug/1098233
https://bugs.launchpad.net/ubuntu/+source/flashplugin-nonfree/+bug/1037662
https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/1005837
https://bugs.launchpad.net/zc.buildout/+bug/484735

This bug is still present in Ubuntu 14.04 ...

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

Other bug subscribers