AttributeError: module 'logger' has no attribute 'log_title'

Bug #1916396 reported by D L
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cubic
Fix Released
Low
Cubic PPA

Bug Description

Exploring possible use of Cubic to install fresh images of Ubuntu 20.04 .. with custom set of applications pre-installed in Cubic.

Launching Cubic in Ubuntu 20.04 from terminal I see ..

$ cubic
    Using GtkSource version................ 4
    Using GtkSource version................ 4
    Using Vte version...................... 2.91
Traceback (most recent call last):
  File "/usr/share/cubic/cubic.py", line 51, in <module>
    logger.log_title('Cubic - Custom Ubuntu ISO Creator')
AttributeError: module 'logger' has no attribute 'log_title'

And my Python version is ...

$ python --version
Python 3.8.3

Is there some dependency I am missing?

Tags: iso-testing
D L (dl-ubuntu)
description: updated
Revision history for this message
Cubic PPA (cubic-wizard) wrote :

What is the output of:

    $ dpkg -l cubic

What is the output of:

    $ cat /etc/apt/sources.list.d/cubic-wizard*

Changed in cubic:
status: New → Incomplete
Revision history for this message
D L (dl-ubuntu) wrote :

$ dpkg -l cubic
gives
cubic          2021.01-42-release~202101290347~ubuntu20.04.1 all

$ cat /etc/apt/sources.list.d/cubic-wizard*
gives
deb http://ppa.launchpad.net/cubic-wizard/release/ubuntu focal main
# deb-src http://ppa.launchpad.net/cubic-wizard/release/ubuntu focal main

...

I can always revert to using Cubic on an earlier version of Ubuntu 18.04 but before I can run on my Ubuntu 20.04 I suspect that I will have to get my Python3/Anaconda3 installations in a less confused state.
From what I have read so far in searching there might be a conflicting logger.py somewhere in PYTHONPATH .. but that is a guess.

I note that my earlier working Cubic installation was cubic-development.
I think that I will have to just create a fresh Ubuntu image and reinstall applications manually (which is why I was about to use Cubic to have a head start).

Revision history for this message
Cubic PPA (cubic-wizard) wrote :

The cubic version is correct, and you do have the correct repository.
It does look like there is something conflicting in you path.

It's odd, because Cubic imports its logger as follows:

    from utilities import logger

So you may actually have another "utilities" package in your path that has also has a logger module.

What is the output of the flowing?

    $ python -c "import sys; print('\n'.join(sys.path))"

    $ python3 -c "import sys; print('\n'.join(sys.path))"

Revision history for this message
D L (dl-ubuntu) wrote :

Here is the dump requested (I have changed /home/username/ to $HOME)

$HOME
python -c "import sys; print('\n'.join(sys.path))"

$HOME
/usr/lib/python3.8/dist-packages
$HOME/anaconda3/lib/python38.zip
$HOME/anaconda3/lib/python3.8
$HOME/anaconda3/lib/python3.8/lib-dynload
$HOME/.local/lib/python3.8/site-packages
$HOME/anaconda3/lib/python3.8/site-packages
$HOME/anaconda3/lib/python3.8/site-packages/py4j-0.10.9.1-py3.8.egg

$ python3 -c "import sys; print('\n'.join(sys.path))"

$HOME
/usr/lib/python3.8/dist-packages
$HOME/anaconda3/lib/python38.zip
$HOME/anaconda3/lib/python3.8
$HOME/anaconda3/lib/python3.8/lib-dynload
$HOME/.local/lib/python3.8/site-packages
$HOME/anaconda3/lib/python3.8/site-packages
$HOME/anaconda3/lib/python3.8/site-packages/py4j-0.10.9.1-py3.8.egg

This is not a bug, I'm sure, but probably arises from some conflict with another utilities/logger.py somewhere .. and/or anaconda3 .. (but the problem is finding it).

I tried running ..

sudo locate logger.py | grep utilities
but only found ...
/usr/share/cubic/utilities/logger.py

I think that the plan now must be to accept this, move on, reinstall Ubuntu from afresh with scripts, and reinstall Cubic later in the fresh installation.

Thanks.

Revision history for this message
Cubic PPA (cubic-wizard) wrote :

The conflicting logger module won't necessarily be in a file called "logger.py", which is why you didn't find it.

Based on your output, it is reasonable to assume the conflicting modules is in anaconda3.

Try explicitly setting and prioritizing the python path when running Cubic...

PYTHONPATH="/usr/share/cubic/" cubic

If this works, please let me know?

Revision history for this message
D L (dl-ubuntu) wrote :

Good idea .. but sadly still see the same error.

I used this command ..

$ export PYTHONPATH=$PYTHONPATH:"/usr/share/cubic/" cubic

and I run cubic ..

$ cubic
    Using GtkSource version................ 4
    Using GtkSource version................ 4
    Using Vte version...................... 2.91
Traceback (most recent call last):
  File "/usr/share/cubic/cubic.py", line 56, in <module>
    logger.log_title('Cubic - Custom Ubuntu ISO Creator')
AttributeError: module 'logger' has no attribute 'log_title'

==============================================

When/if I find a fix I will return here and report.

Revision history for this message
Cubic PPA (cubic-wizard) wrote :

Try it *exactly* this way:

    $ PYTHONPATH="/usr/share/cubic/" cubic

The command you used gives the Cubic python modules a lower priority than the other modules in your path. (This is effectively no change from your original situation).

Don't worry, this will not overwrite your PYTHONPATH variable. You don't need to reference or specify the system's original PYTHONPATH, because it will be automatically appended when you the above command.

Revision history for this message
D L (dl-ubuntu) wrote :

Still no joy using exactly that command in gnome terminal, after cd /usr/share/cubic folder ...

PYTHONPATH="/usr/share/cubic/" cubic
    Using GtkSource version................ 4
    Using GtkSource version................ 4
    Using Vte version...................... 2.91
Traceback (most recent call last):
  File "/usr/share/cubic/cubic.py", line 56, in <module>
    logger.log_title('Cubic - Custom Ubuntu ISO Creator')
AttributeError: module 'logger' has no attribute 'log_title'

Revision history for this message
Cubic PPA (cubic-wizard) wrote :

That's a shame.

I'll try to simulate your situation on my end, and I'll let you know what I come up with.

Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/1916396

tags: added: iso-testing
Cubic PPA (cubic-wizard)
Changed in cubic:
importance: Undecided → Low
assignee: nobody → Cubic PPA (cubic-wizard)
status: Incomplete → In Progress
Revision history for this message
Cubic PPA (cubic-wizard) wrote :

Refactored the application to use a unique package structure in order to avoid name collisions.

Changed in cubic:
status: In Progress → Fix Committed
Cubic PPA (cubic-wizard)
Changed in cubic:
status: Fix Committed → Fix Released
Revision history for this message
Cubic PPA (cubic-wizard) wrote :

@dl-ubuntu,

I could not recreate your situation, but Cubic now uses a unique package structure in order to avoid name collisions with other applications.

Would you please post back here and let me know if Cubic version 2021.03-44 solves your problem?

Revision history for this message
D L (dl-ubuntu) wrote :

Thank you for pursuing this.
On Ubuntu 20.04 I used Stacer GUI to delete current Cubic.
I then ran .. sudo apt update.
I opened Synaptic Package Manager and installed Cubic 2021.03.44
Cubic now opens through Applications .. and also by command line.
No errors seen.
I have not yet progressed to creating a custom ISO but just posted here to give feedback
on errors now not being seen at launch.
Issue resolved for me.
Thank you.

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.