[SRU] gourmand doesn't start

Bug #2064861 reported by lucone
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
extruct (Ubuntu)
Confirmed
Undecided
Unassigned
Noble
Fix Committed
Undecided
Unassigned
gourmand (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

[ Impact ]

gourmand is completely unusable and will fail immediately on execution with the error:

$ gourmand
args = Namespace(db_url='', threads=False, gourmanddir='', thread_debug_interval=5.0, thread_debug=False, debug_file='', time=False, debug=None)
Traceback (most recent call last):
  File "/usr/bin/gourmand", line 33, in <module>
    sys.exit(load_entry_point('gourmand==1.0.0', 'gui_scripts', 'gourmand')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/gourmand", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/gourmand/main.py", line 9, in <module>
    from gourmand import (__version__, batchEditor, convert, plugin, plugin_gui,
  File "/usr/lib/python3/dist-packages/gourmand/reccard.py", line 33, in <module>
    from gourmand.recindex import RecIndex
  File "/usr/lib/python3/dist-packages/gourmand/recindex.py", line 17, in <module>
    from .importers.clipboard_importer import import_from_drag_and_drop
  File "/usr/lib/python3/dist-packages/gourmand/importers/clipboard_importer.py", line 8, in <module>
    from gourmand.importers.importManager import ImportManager
  File "/usr/lib/python3/dist-packages/gourmand/importers/importManager.py", line 10, in <module>
    from gourmand.importers.web_importer import import_urls, supported_sites
  File "/usr/lib/python3/dist-packages/gourmand/importers/web_importer.py", line 6, in <module>
    from recipe_scrapers import SCRAPERS, scrape_me
  File "/usr/lib/python3/dist-packages/recipe_scrapers/__init__.py", line 6, in <module>
    from ._abstract import AbstractScraper
  File "/usr/lib/python3/dist-packages/recipe_scrapers/_abstract.py", line 13, in <module>
    from ._schemaorg import SchemaOrg
  File "/usr/lib/python3/dist-packages/recipe_scrapers/_schemaorg.py", line 8, in <module>
    import extruct
  File "/usr/lib/python3/dist-packages/extruct/__init__.py", line 1, in <module>
    from ._extruct import SYNTAXES, extract
  File "/usr/lib/python3/dist-packages/extruct/_extruct.py", line 9, in <module>
    from extruct.dublincore import DublinCoreExtractor
  File "/usr/lib/python3/dist-packages/extruct/dublincore.py", line 6, in <module>
    from extruct.utils import parse_html
  File "/usr/lib/python3/dist-packages/extruct/utils.py", line 5, in <module>
    from extruct.xmldom import XmlDomHTMLParser
  File "/usr/lib/python3/dist-packages/extruct/xmldom.py", line 9, in <module>
    from lxml.etree import (
ImportError: cannot import name '_ElementStringResult' from 'lxml.etree' (/usr/lib/python3/dist-packages/lxml/etree.cpython-312-x86_64-linux-gnu.so). Did you mean: '_ElementUnicodeResult'?

Even though "gourmand" is affected but its caused by "python3-lxml" updating to 5.2.1-1 as FFE via #2060811. And that in turn affected python3-extruct which actually caused all the error.

[ Test Plan ]

1. install gourmand
2. Execute gourmand

If the package is not fixed it will result in the above error.
With the fixed package it will display the recipe manager with two example recipes in it.

[ Where problems could occur ]

This upstream patch is defining its own "_ElementStringResult" for compatibility. Looking at old lxml code, the definition is same as what they had at https://github.com/lxml/lxml/blob/lxml-4.9.4/src/lxml/extensions.pxi#L741 so there should not be a regression for this. But again, lxml has removed the definition and there might be some other change in lxml which is part of this removal and so there is always a chance of regression.
But again, the package is completely unusable now, there can not be a greather regression than what we currently have.

[ Other Info ]

1. The "_ElementStringResult" was a private classes of lxml and should not have been used by python3-extruct. Ref: https://bugs.launchpad.net/bugs/2059793
2. I did a apt-cache rdepends to find out other packages that might be affected by the issue of python3-extruct. But looks like "gourmand" is the only package which depends on python3-extruct.

[ Original Bug Description ]

In kubuntu 24.04 after installing gourmand it doesn't start.

If I launch it from cli I have the following output :

gourmand
args = Namespace(db_url='', threads=False, gourmanddir='', thread_debug_interval=5.0, thread_debug=False, debug_file='', time=False, debug=None)
Traceback (most recent call last):
  File "/usr/bin/gourmand", line 33, in <module>
    sys.exit(load_entry_point('gourmand==1.0.0', 'gui_scripts', 'gourmand')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/gourmand", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/gourmand/main.py", line 9, in <module>
    from gourmand import (__version__, batchEditor, convert, plugin, plugin_gui,
  File "/usr/lib/python3/dist-packages/gourmand/reccard.py", line 33, in <module>
    from gourmand.recindex import RecIndex
  File "/usr/lib/python3/dist-packages/gourmand/recindex.py", line 17, in <module>
    from .importers.clipboard_importer import import_from_drag_and_drop
  File "/usr/lib/python3/dist-packages/gourmand/importers/clipboard_importer.py", line 8, in <module>
    from gourmand.importers.importManager import ImportManager
  File "/usr/lib/python3/dist-packages/gourmand/importers/importManager.py", line 10, in <module>
    from gourmand.importers.web_importer import import_urls, supported_sites
  File "/usr/lib/python3/dist-packages/gourmand/importers/web_importer.py", line 6, in <module>
    from recipe_scrapers import SCRAPERS, scrape_me
  File "/usr/lib/python3/dist-packages/recipe_scrapers/__init__.py", line 6, in <module>
    from ._abstract import AbstractScraper
  File "/usr/lib/python3/dist-packages/recipe_scrapers/_abstract.py", line 13, in <module>
    from ._schemaorg import SchemaOrg
  File "/usr/lib/python3/dist-packages/recipe_scrapers/_schemaorg.py", line 8, in <module>
    import extruct
  File "/usr/lib/python3/dist-packages/extruct/__init__.py", line 1, in <module>
    from ._extruct import SYNTAXES, extract
  File "/usr/lib/python3/dist-packages/extruct/_extruct.py", line 9, in <module>
    from extruct.dublincore import DublinCoreExtractor
  File "/usr/lib/python3/dist-packages/extruct/dublincore.py", line 6, in <module>
    from extruct.utils import parse_html
  File "/usr/lib/python3/dist-packages/extruct/utils.py", line 5, in <module>
    from extruct.xmldom import XmlDomHTMLParser
  File "/usr/lib/python3/dist-packages/extruct/xmldom.py", line 9, in <module>
    from lxml.etree import (
ImportError: cannot import name '_ElementStringResult' from 'lxml.etree' (/usr/lib/python3/dist-packages/lxml/etree.cpython-312-x86_64-linux-gnu.so). Did you mean: '_ElementUnicodeResult'?
---
ProblemType: Bug
ApportVersion: 2.28.1-0ubuntu3
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: KDE
DistroRelease: Ubuntu 24.04
Package: gourmand 1.1.0+really1.1.0~rc3-3
PackageArchitecture: all
ProcVersionSignature: Ubuntu 6.8.0-31.31-generic 6.8.1
Tags: noble third-party-packages
Uname: Linux 6.8.0-31-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin lxd plugdev sambashare sudo
_MarkForUpload: True

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in gourmand (Ubuntu):
status: New → Confirmed
Revision history for this message
lotuspsychje (lotuspsychje) wrote :

Thank you for filing this bug and make Ubuntu better!

In order to collect your system logs into this bug

please type; apport-collect 2064861 from a terminal

so the developers can start debug your bug better

Revision history for this message
lotuspsychje (lotuspsychje) wrote :

Ubuntu-desktop 24.04 on gnome @ 6/5/2024

Installed gourmand and i can reproduce the crash with the following error:

gourmand crashed with importerror in /usr/lib/python3/dist-packages/extruct/xmldom.py ...

Revision history for this message
lucone (lucacerpy) wrote : Dependencies.txt

apport information

tags: added: apport-collected noble third-party-packages
description: updated
Revision history for this message
lucone (lucacerpy) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
lucone (lucacerpy) wrote : ProcEnviron.txt

apport information

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote : Re: gourmand doesn't start

I can reproduce the issue on Noble. Also tested and confirmed that Oracular and Mantic are not affected.

Changed in gourmand (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Sudip Mukherjee (sudipmuk)
affects: gourmand (Ubuntu) → extruct (Ubuntu)
Changed in extruct (Ubuntu):
assignee: Sudip Mukherjee (sudipmuk) → nobody
summary: - gourmand doesn't start
+ [SRU] gourmand doesn't start
Changed in extruct (Ubuntu):
assignee: nobody → Sudip Mukherjee (sudipmuk)
description: updated
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

Debdiff for Noble attached.

Also built it in a PPA and the build can be seen at https://launchpad.net/~sudipmuk/+archive/ubuntu/test-ppa/+build/28467394

Changed in extruct (Ubuntu):
status: In Progress → Confirmed
assignee: Sudip Mukherjee (sudipmuk) → nobody
Changed in gourmand (Ubuntu):
status: New → Confirmed
Revision history for this message
Simon Quigley (tsimonq2) wrote :

LGTM, it is in the Noble queue now.

Thank you!

no longer affects: gourmand (Ubuntu Noble)
Changed in extruct (Ubuntu Noble):
status: New → Triaged
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello lucone, or anyone else affected,

Accepted extruct into noble-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/extruct/0.16.0-3ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-noble to verification-done-noble. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-noble. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in extruct (Ubuntu Noble):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-noble
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.