flashplugin-installer do not honore proxy settings

Bug #1098233 reported by marcobra (Marco Braida)
66
This bug affects 14 people
Affects Status Importance Assigned to Milestone
Adobe Flash Plugin Tools
New
Undecided
Unassigned
update notifier
New
Undecided
Unassigned
flashplugin-nonfree (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Description: Ubuntu 12.10
Release: 12.10
Codename: quantal

flashplugin-installer:
  Installato: 11.2.202.258ubuntu0.12.10.1
  Candidato: 11.2.202.261ubuntu0.12.10.1
  Tabella versione:
     11.2.202.261ubuntu0.12.10.1 0
        500 http://archive.ubuntu.com/ubuntu/ quantal-updates/multiverse i386 Packages
        500 http://archive.ubuntu.com/ubuntu/ quantal-security/multiverse i386 Packages
 *** 11.2.202.258ubuntu0.12.10.1 0
        100 /var/lib/dpkg/status
     11.2.202.243ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ quantal/multiverse i386 Packages

flashplugin-installer do not honore proxy settings so cannot download the proxy so my update are frozen on

Elaborazione dei trigger per update-notifier-common...
flashplugin-installer: downloading http://archive.canonical.com/pool/partner/a/adobe-flashplugin/adobe-flashplugin_11.2.202.261.orig.tar.gz

already reported:
https://bugs.launchpad.net/ubuntu/+source/flashplugin-nonfree/+bug/1037662

Very old issue still not solved... :-(

#---------------- Workaround for user with same issue ----------------

As a workaround... while the apt-get update process is frozen on the row below

Elaborazione dei trigger per update-notifier-common...
flashplugin-installer: downloading http://archive.canonical.com/pool/partner/a/adobe-flashplugin/adobe-flashplugin_11.2.202.261.orig.tar.gz

Opening another terminal...
wget http://archive.canonical.com/pool/partner/a/adobe-flashplugin/adobe-flashplugin_11.2.202.261.orig.tar.gz
sudo /usr/lib/flashplugin-installer/install_plugin $(pwd)/adobe-flashplugin_11.2.202.261.orig.tar.gz
rm adobe-flashplugin_11.2.202.261.orig.tar.gz

then to release the frozen update process, type:

sudo killall dpkg

or reboot the pc, then type:

sudo dpkg --configure -a

to check and put in a good state the apt env...

# --------------------------------------------------------------

Thanks

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: flashplugin-installer 11.2.202.258ubuntu0.12.10.1
Uname: Linux 3.7.1-030701-generic i686
ApportVersion: 2.6.1-0ubuntu9
Architecture: i386
Date: Thu Jan 10 15:39:05 2013
MarkForUpload: True
SourcePackage: flashplugin-nonfree
UpgradeStatus: Upgraded to quantal on 2012-07-02 (192 days ago)

Revision history for this message
marcobra (Marco Braida) (marcobra) wrote :
description: updated
description: updated
description: updated
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in flashplugin-nonfree (Ubuntu):
status: New → Confirmed
Revision history for this message
marcobra (Marco Braida) (marcobra) wrote :

This bug also create same big lock upgrading from ubuntu 12.10 to ubuntu 13.04

description: updated
Revision history for this message
jotape99 (jotape99) wrote :

Also affects 13.04

Revision history for this message
Waseem Elliot (waseem-x) wrote :

Aso affects 12.04

Revision history for this message
Jan Groenewald (jan-aims) wrote :
Download full text (3.6 KiB)

I think the problem is un update-notifier

This bit of code checks the environment
0 jan@muizenberg:/var/autofs/misc/home/jan$grep -C3 nv /usr/lib/update-notifier/package-data-downloader
 Failed downloads are reported to the user via the
 update-notifier interface."""

 # Get our proxy settings from the environment
 proxies = {}
 try:
  for proto in ('http','https','ftp'):
   try:
    proxies[proto] = os.environ[proto+"_proxy"]
   except KeyError:
    pass

0 jan@muizenberg:/var/autofs/misc/home/jan$dpkg -S /usr/lib/update-notifier/package-data-downloader
update-notifier-common: /usr/lib/update-notifier/package-data-downloader

Both these /etc/environment and /etc/apt/apt.conf are ignored:

0 jan@muizenberg:/var/autofs/misc/home/jan$cat /etc/environment PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
http_proxy="http://proxy.aims.ac.za:3128/"
https_proxy="https://proxy.aims.ac.za:3128/"
ftp_proxy="ftp://proxy.aims.ac.za:3128/"
0 jan@muizenberg:/var/autofs/misc/home/jan$cat /etc/apt/apt.conf
Acquire::http::proxy "http://proxy.aims.ac.za:3128/";
Acquire::https::proxy "https://proxy.aims.ac.za:3128/";
Acquire::ftp::proxy "ftp://proxy.aims.ac.za:3128/";
0 jan@muizenberg:/var/autofs/misc/home/jan$

However when I run

env | grep prox

from either root's crontab -e or from /etc/crontab as root, I do see the appropriate proxies set. I thought this was where os.environ would get the value, but it does not. You can stick a print statement in /usr/lib/update-notifier/package-data-downloader to see that omission.

Some history
https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/1005837
https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/983559
https://bugs.launchpad.net/ubuntu/+source/sudo/+bug/982684
https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/979477

Some of those workarounds seem way too long. For us it works to go from the command line (not from cron) , where your http_proxy is set:

apt-get --reinstall install flashplugin-installer

In real life, many of my users flash stops working each time there is an update to flashplugin-installer, because they are not familiar with the command line. In addition, their entire apt system stays broken with this error popping up every subsequent time they install/update anything else graphically.

So, while it is marked as WONTFIX here:
https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/983559
seems to be due to this:
https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/983559/comments/4

That still leaves many users in a bad position. Despite the comment 4 linked above explaining why apt.conf should not be read. However, it goes on to say:

"So you can specify a system proxy by setting the http_proxy variable in /etc/environment. Depending on how you're gaining root privileges for apt, you may still run into problems due to bug #982684, which will hopefully be fixed soon."

That other bug #982684 is fixed released April 2013, but I don't really see how it affects the cronjob /etc/cron.daily/update-notifier, though I'm not sure the cronjob uses sudo or pkexec.

In any case, on Ubuntu 12.04.2, the proxy still isn't rea...

Read more...

Revision history for this message
Jan Groenewald (jan-aims) wrote :

Actually, this piece of code seems to work fine
 # Get our proxy settings from the environment
 proxies = {}
 try:
  for proto in ('http','https','ftp'):
   try:
    proxies[proto] = os.environ[proto+"_proxy"]
   except KeyError:
    pass
  print proxies # my code

  if proxies:
   urllib._urlopener = urllib.FancyURLopener(proxies)
 except Exception:

and then the urllib.urlretrieve should work, and it does when run manually, but somehow not from the cron job. I can't see why.

Revision history for this message
Jan Groenewald (jan-aims) wrote :

Ok, when I put

print proxies

the line before "if proxies:" and I run /etc/cron.daily/update-notifier manually, the proxies are printed out correctly. When I leave it to run via cron/run-parts, I get this however:

/etc/cron.daily/update-notifier-common:
{}

Is this due to run-parts or the cron environment?

Revision history for this message
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

Revision history for this message
Josep Pujadas-Jubany (jpujades) wrote :
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.