Fogger can not reach URL

Bug #1034207 reported by Alex on 2012-08-08
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Fogger
High
Owais Lone

Bug Description

Create new fog app fails with the Example stating URL could not be reached.

This is what -vv option dumps upon clicking the create button:

DEBUG:fogger_lib: get() 'No such app: 5e8a5709f662f8d401f7a00e6137f9ca'
DEBUG:fogger: verify_url() 'Fetching url'
DEBUG:fogger: verify_url() 'starting'
DEBUG:fogger: verify_url() 'Error downloading url http://www.reddit.com'

Same results for other URLs - all of which can be opened in web browser. A proxy has not been set.

David Decker (daveshine) wrote :

Same here with me: facebook.com and evernote.com did not work yet... Installed Fogger via Software Center on 2012-08-07...

Owais Lone (loneowais) on 2012-08-08
Changed in fogger:
status: New → Triaged
Giovanni Mellini (merlos) wrote :

same problem for me. I have the same problem while launching fogger.
From terminal I can ping www.reddit.com while fogger tells me that it's impossible to fetch the url

giovanni@trumpet-fish:~$ ping www.reddit.com
PING a659.b.akamai.net (92.122.50.177) 56(84) bytes of data.
64 bytes from a92-122-50-177.deploy.akamaitechnologies.com (92.122.50.177): icmp_req=1 ttl=56 time=63.0 ms
64 bytes from a92-122-50-177.deploy.akamaitechnologies.com (92.122.50.177): icmp_req=2 ttl=56 time=64.0 ms
^C
--- a659.b.akamai.net ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 63.056/63.574/64.092/0.518 ms
giovanni@trumpet-fish:~$
giovanni@trumpet-fish:~$ /usr/bin/python /opt/extras.ubuntu.com/fogger/bin/fogger -vv
DEBUG:fogger: set_up_logging() 'logging enabled'
/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning: g_object_set_property: construct property "type" for object `Window' can't be set after construction
  Gtk.Window.__init__(self, type=type, **kwds)
DEBUG:fogger_lib: connect_signals() 'connect builder by design 'image_eb', 'button-press-event', 'on_icon_clicked''
DEBUG:fogger_lib: connect_signals() 'connect builder by design 'name_entry', 'changed', 'on_name_changed''
DEBUG:fogger_lib: connect_signals() 'connect builder by design 'name_entry', 'changed', 'validate_form''
DEBUG:fogger_lib: connect_signals() 'connect builder by design 'url_entry', 'changed', 'validate_form''
DEBUG:fogger_lib: connect_signals() 'connect builder by design 'create_button', 'clicked', 'on_create''
DEBUG:fogger_lib: do_connect() 'connect builder by name 'mnu_contents','activate', 'on_mnu_contents_activate''
DEBUG:fogger_lib: do_connect() 'connect builder by name 'mnu_about','activate', 'on_mnu_about_activate''
DEBUG:fogger_lib: do_connect() 'connect builder by name 'mnu_close','activate', 'on_mnu_close_activate''
DEBUG:fogger_lib: do_connect() 'connect builder by name 'fogger_window','destroy', 'on_destroy''
DEBUG:fogger_lib: do_connect() 'connect builder by name 'fogger_window','drag_data_received', 'on_drag_data_received''
DEBUG:fogger_lib: log_unconnected_functions() 'Not connected to builder 'on_cancel''
DEBUG:fogger_lib: log_unconnected_functions() 'Not connected to builder 'on_preferences_dialog_destroyed''
DEBUG:fogger_lib: log_unconnected_functions() 'Not connected to builder 'on_mnu_preferences_activate''
DEBUG:fogger_lib: log_unconnected_functions() 'Not connected to builder 'on_url_changed''
/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py:391: Warning: g_object_set_property: construct property "type" for object `FoggerWindow' can't be set after construction
  Gtk.Window.__init__(self, type=type, **kwds)
DEBUG:fogger_lib: get() 'No such app: 5e8a5709f662f8d401f7a00e6137f9ca'
DEBUG:fogger: verify_url() 'Fetching url'
DEBUG:fogger: verify_url() 'starting'
DEBUG:fogger: verify_url() 'Error downloading url http://www.reddit.com'
^C^C^CTraceback (most recent call last):
  File "/opt/extras.ubuntu.com/fogger/fogger_lib/Window.py", line 125, in on_destroy
    def on_destroy(self, widget, data=None):
KeyboardInterrupt

Owais Lone (loneowais) on 2012-08-08
Changed in fogger:
importance: Undecided → High
Alex (aaaaalex) wrote :

Just for the heck of it i tried again with a newly created user: Success.

It must be some configuration setting on user level causing this. After 'cleaning out' my configuration, i.e. hidden files i got it working. Sorry if this does not really help other than pointing in the right direction hopefully.

Giovanni Mellini (merlos) wrote :

Ok I did some invastigation and I found the cause of the prioblem.
The problem is in the file /opt/extras.ubuntu.com/fogger/fogger/FoggerWindow.py function verify_url()
Seems that the parameter proxies=proxies sent to the requests.get function is not well interpreted from the function itself.

On my system I have a proxy setup (just for my job) but when I go to my house I unset (via GUI) the proxy.
While trying fogger I unset the proxy but seems that the function get the wrong info from system

After modifying file /opt/extras.ubuntu.com/fogger/fogger/FoggerWindow.py function verify_url() removing proxy settings as follows, I got fogger working

line 193: response = requests.get(url, proxies=proxies)
modified line 193: response = requests.get(url)

Hope this help

Giovanni Mellini (merlos) wrote :

The problem is in the helper function get_network_proxies() (fogger_lib/helpers.py) that returns incorrect values for proxies.

The function read
 settings = Gio.Settings.new('org.gnome.system.proxy.https')
and
 settings = Gio.Settings.new('org.gnome.system.proxy.http')
that are local users settings, so create a new user without setting a proxy should work.

I'm looking at the code, hope I can fix this but I'm not a python programmer :)

Owais Lone (loneowais) wrote :

How do you unset the proxy? Using which application?

Owais Lone (loneowais) wrote :

Can you please paste the output of these 4 commands

    gsettings get org.gnome.system.proxy.https host
    gsettings get org.gnome.system.proxy.https port
    gsettings get org.gnome.system.proxy.http host
    gsettings get org.gnome.system.proxy.http port

Giovanni Mellini (merlos) wrote :

I ha ve a working patch. Just wait I come back to home band I'll post
Giovanni

Owais Lone (loneowais) wrote :

Thanks! Please post the output of the command above too.

Giovanni Mellini (merlos) wrote :

No problem I did these commands too :)

Owais Lone (loneowais) wrote :

Thanks Giovanni!

Giovanni Mellini (merlos) wrote :

The attached patch for get_network_proxies() function in fogger_lib/helpers.py fix the problem that we experience while we have the Proxy Settings set to 'none' but we have the http and https url and port set-up, but not active

Before return http and https host/port values we have to check the value of org.gnome.system.proxy mode
In fact mode can be
- 'none' ==> proxies must be empty
- 'manual' ==> proxies contains host/port values, like current implementation
- 'auto' ==> we should read the autoconfig-url value. IMPORTANT: now the function returns an empty proxies array, this should be fixed (I have no test network to try this)

From terminal do this command

giovanni@trumpet-fish:/opt/extras.ubuntu.com/fogger/fogger_lib$ gsettings list-recursively org.gnome.system.proxy
org.gnome.system.proxy autoconfig-url ''
org.gnome.system.proxy ignore-hosts ['localhost', '127.0.0.0/8']
org.gnome.system.proxy mode 'none'
org.gnome.system.proxy use-same-proxy false
org.gnome.system.proxy.ftp host 'ocs-sa-ubu01'
org.gnome.system.proxy.ftp port 5865
org.gnome.system.proxy.http authentication-password ''
org.gnome.system.proxy.http authentication-user ''
org.gnome.system.proxy.http enabled false
org.gnome.system.proxy.http host 'ubu01'
org.gnome.system.proxy.http port 5865
org.gnome.system.proxy.http use-authentication false
org.gnome.system.proxy.https host 'ubu01'
org.gnome.system.proxy.https port 5865
org.gnome.system.proxy.socks host 'ubu01'
org.gnome.system.proxy.socks port 5865
giovanni@trumpet-fish:/opt/extras.ubuntu.com/fogger/fogger_lib$

Giovanni Mellini (merlos) wrote :

@Owais to switch proxy I use the Natwork Proxy interface under Network tab in System Settings

Owais Lone (loneowais) wrote :

Thanks for figuring it out Giovanni,

I'll fix this soon and also add support for autoconfiguration proxy url. Till then anyone can use a workaround to just delete the proxy host address or port from control center

Changed in fogger:
assignee: nobody → Owais Lone (loneowais)
Giovanni Mellini (merlos) wrote :

Ok thank you :)

Paul Calabro (pcalabro) wrote :

Thanks Giovanni! That did the trick! :-D

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

Other bug subscribers