AttributeError: 'NoneType' object has no attribute 'self_link' while Getting Launchpad credentials

Bug #513600 reported by Mathieu Trudel-Lapierre
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Ground Control
Fix Released
High
Martin Owens

Bug Description

During the "Getting Launchpad credentials" step in initial configuration, with lp-groundcontrol started from the command-line, the application crashes with the following traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/GroundControl/gtkviews.py", line 311, in thread_through
    self.process_calls()
  File "/usr/lib/python2.6/dist-packages/GroundControl/gtkviews.py", line 355, in process_calls
    ret = getattr(self, name)(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/GroundControl/configuration.py", line 213, in update_details
    mugshot_file = self.launchpad.me.image()
  File "/usr/lib/python2.6/dist-packages/GroundControl/launchpad.py", line 133, in me
    self._me = LaunchpadPerson(self.launchpad, obj=self.launchpad.me)
  File "/usr/lib/python2.6/dist-packages/GroundControl/launchpad.py", line 159, in __init__
    if obj == None:
  File "/usr/lib/pymodules/python2.6/lazr/restfulclient/resource.py", line 603, in __eq__
    self.self_link == other.self_link and
AttributeError: 'NoneType' object has no attribute 'self_link'

Revision history for this message
Luke Jennings (ubuntujenkins) wrote :

This also affects me, I have attached my log and I am running ubuntu 10.04 (Lucid) .

Revision history for this message
Dan Trevino (dantrevino) wrote :

I'd post a log, but mine is the same as in the original report. Running Lucid and python 2.6.

Revision history for this message
Martin Owens (doctormo) wrote :

I think I have a fix, but I need one of the people who have the error to try it out. You have to open up the launchpad.py file as root, go to line 159 and replace:

sudo gedit /usr/lib/python2.6/dist-packages/GroundControl/launchpad.py

if obj == None:

with

if type(obj) == NoneType:

And test this problem again, hopefully it's because your all using a newer version of the rest interface that implements some context magic that we don't need. But it does look like the lazr rest client code needs fixing as you should be able to test if something is None without having to make it a rest object first.

If the fix works, I'll commit and update this bug.

Changed in groundcontrol:
importance: Undecided → High
assignee: nobody → Martin Owens (doctormo)
status: New → In Progress
Revision history for this message
Luke Jennings (ubuntujenkins) wrote :

I have changed the line of code and restarted. The terminal output is now

/usr/lib/python2.6/dist-packages/GroundControl/gtkviews.py:86: GtkWarning: gtk_widget_grab_default: assertion `gtk_widget_get_can_default (widget)' failed
  self.w_tree.add_from_file(self.gapp_xml)

I have attached the latest log as well

Revision history for this message
Martin Owens (doctormo) wrote :

Great, looks like it worked. If you wait a little for launchpad to finish doing it's thing, it should complete.

Changed in groundcontrol:
status: In Progress → Fix Committed
Revision history for this message
Luke Jennings (ubuntujenkins) wrote :

I should have said that i still can't login i.e.see my picture etc. Is that also in the fix?

Revision history for this message
Martin Owens (doctormo) wrote :

This bug is fixed, I don't know why you can't log in, there are no errors. That warning you showed me is just a gtk warning, nothing about launchpadlib.

Keep trying.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Hmm. It does work for me as well, but with type(obj) == None, not type(obj) == NoneType.

Revision history for this message
Martin Owens (doctormo) wrote :

Yes, that's my fault, I fixed it in my code but then pasted the wrong thing in. Sorry UnbuntuJenkins, I had you paste in the wrong thing.

Martin Owens (doctormo)
Changed in groundcontrol:
status: Fix Committed → Fix Released
Revision history for this message
Anant Gupta (anantzoid) wrote :

GroundControl folder is in python2.7 in my machine. And the line 159 in launchpad.py is empty.

Revision history for this message
Anant Gupta (anantzoid) wrote :

I found the correct file in usr/lib/pymodules/python2.7/GroundControl/launchpad.py
The line 159 was empty but found
 if Type(obj) == Type(None):
and edited it to
if Type(obj) == None :/NoneType :
No results.

No foleder named GroundControl exists in usr/lib/python2.6/dist-packages and usr/lib/python2.6/dist-packages

Revision history for this message
Martin Owens (doctormo) wrote :

Those files should have been installed with the package, what version of GroundControl are you using?

Revision history for this message
Anant Gupta (anantzoid) wrote :

Maybe the latest only. I used the following commands to download it:
sudo add-apt-repository ppa:doctormo/groundcontrol
sudo apt-get install groundcontrol

And now after messing arounf with it a little bit, Ground control wouldn't star at all. If I try starting it with terminal:
lp-groundcontrol, it says
the program lp-groundcontrol is not currently installed

and from the GUI is says
Failed to execute chiled process "GroundControl"(No such file or directory)

Revision history for this message
Martin Owens (doctormo) wrote :

OK you're using 1.6, don't worry about investigating 1.6, I've been working for a few months on version 2.0 and it's a complete rewrite.

If you'd like to download it and play with it, get it using:

bzr branch lp:groundcontrol
cd groundcontrol
./daemon.py

You should see an indicator in the corner. I'm still working on the designs for groundcontrol.py and you're welcome to look through it although it's not finished yet, it's supporting GitHub, Launchpad and others.

Revision history for this message
Anant Gupta (anantzoid) wrote :

I get the following on typing the commands:

03-07 20:27 root DEBUG Importing Module: GroundControl.services.stubs
03-07 20:27 root DEBUG Importing Module: GroundControl.services.github
03-07 20:27 root DEBUG Importing Module: GroundControl.services.savannah
Traceback (most recent call last):
  File "./daemon.py", line 34, in <module>
    from GroundControl import __appname__, __version__, daemon
  File "lib/GroundControl/daemon.py", line 35, in <module>
    SRVMOD = load_modules(GroundControl.services)
  File "lib/GroundControl/base.py", line 248, in load_modules
    fromlist=fromlist, level=0)
  File "lib/GroundControl/services/savannah.py", line 23, in <module>
    import lxml.html
ImportError: No module named lxml.html
Note: I think I just need the lxml.html file

Revision history for this message
Martin Owens (doctormo) wrote :

You should make a new bug report to make sure thing

Revision history for this message
Martin Owens (doctormo) wrote :

You should make a new bug report to make sure things don't get confusing.

You need to install python-lxml

sudo apt-get install python-lxml

Revision history for this message
Anant Gupta (anantzoid) wrote :

This worked! Thanks!

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.