[SRU] pronterface does not start in jammy

Bug #1975947 reported by Dennis Real
46
This bug affects 7 people
Affects Status Importance Assigned to Milestone
printrun (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
High
Unassigned

Bug Description

[ Impact ]

pronterface is completely unusable in Jammy. If the user tries to execute it then that fails with the error:

Traceback (most recent call last):
  File "/usr/bin/pronterface", line 62, in <module>
    app = PronterApp(False)
  File "/usr/lib/python3/dist-packages/printrun/pronterface.py", line 2439, in __init__
    self.mainwindow = PronterWindow(self)
  File "/usr/lib/python3/dist-packages/printrun/pronterface.py", line 207, in __init__
    self.reload_ui()
  File "/usr/lib/python3/dist-packages/printrun/pronterface.py", line 281, in reload_ui
    self.createGui(self.settings.uimode == _("Compact"),
  File "/usr/lib/python3/dist-packages/printrun/gui/__init__.py", line 259, in createGui
    viz_pane = VizPane(self, vizpanel)
  File "/usr/lib/python3/dist-packages/printrun/gui/viz.py", line 115, in __init__
    root.gwindow = gviz.GvizWindow(build_dimensions = root.build_dimensions_list,
  File "/usr/lib/python3/dist-packages/printrun/gviz.py", line 77, in __init__
    self.p = Gviz(panel, size = size, build_dimensions = build_dimensions, grid = grid, extrusion_width = extrusion_width, bgcolor = bgcolor, realparent = self)
  File "/usr/lib/python3/dist-packages/printrun/gviz.py", line 197, in __init__
    self.mainpen = wx.Pen(wx.Colour(0, 0, 0), penwidth)
TypeError: Pen(): arguments did not match any overloaded call:
  overload 1: too many arguments
  overload 2: argument 2 has unexpected type 'float'
  overload 3: argument 1 has unexpected type 'Colour'

[ Test Plan ]

 * Execute pronterface and verify the gui is working.

Ideally someone with a 3D printer should test and confirm that it is working.

[ Where problems could occur ]

 * This is an upstream patch which has been also added in Debian almost 20 months ago.
  The upstream patch is only typecasting and changing the datatype of the arguments from float to integer as Pen, DrawLine and others take integers as arguments from Python 3.10+
  imho, since the values are typecasted from float to int so it might loose some precision. But again since this is an upstream fix, I will assume that the chances of regression are less.

[ Other Info ]

 * The problem has been fixed by upstream in v2.0.0 but Debian has added the patch in its v2.0.0~rc8-2 package so as a result Lunar is not affected and only Jammy is affected.

[ Original Bug Description ]

pronterface does not start:

$ pronterface
WARNING:root:RPC server bound on non-default port 7979
Traceback (most recent call last):
  File "/usr/bin/pronterface", line 62, in <module>
    app = PronterApp(False)
  File "/usr/lib/python3/dist-packages/printrun/pronterface.py", line 2439, in __init__
    self.mainwindow = PronterWindow(self)
  File "/usr/lib/python3/dist-packages/printrun/pronterface.py", line 207, in __init__
    self.reload_ui()
  File "/usr/lib/python3/dist-packages/printrun/pronterface.py", line 281, in reload_ui
    self.createGui(self.settings.uimode == _("Compact"),
  File "/usr/lib/python3/dist-packages/printrun/gui/__init__.py", line 259, in createGui
    viz_pane = VizPane(self, vizpanel)
  File "/usr/lib/python3/dist-packages/printrun/gui/viz.py", line 115, in __init__
    root.gwindow = gviz.GvizWindow(build_dimensions = root.build_dimensions_list,
  File "/usr/lib/python3/dist-packages/printrun/gviz.py", line 77, in __init__
    self.p = Gviz(panel, size = size, build_dimensions = build_dimensions, grid = grid, extrusion_width = extrusion_width, bgcolor = bgcolor, realparent = self)
  File "/usr/lib/python3/dist-packages/printrun/gviz.py", line 197, in __init__
    self.mainpen = wx.Pen(wx.Colour(0, 0, 0), penwidth)
TypeError: Pen(): arguments did not match any overloaded call:
  overload 1: too many arguments
  overload 2: argument 2 has unexpected type 'float'
  overload 3: argument 1 has unexpected type 'Colour'

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: pronterface 2.0.0~rc7-1build1
ProcVersionSignature: Ubuntu 5.15.0-33.34-generic 5.15.30
Uname: Linux 5.15.0-33-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.1
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: XFCE
Date: Fri May 27 15:24:36 2022
InstallationDate: Installed on 2016-04-30 (2218 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
PackageArchitecture: all
SourcePackage: printrun
UpgradeStatus: Upgraded to jammy on 2022-04-28 (29 days ago)
modified.conffile..etc.default.apport:
 # set this to 0 to disable apport, or to 1 to enable it
 # you can temporarily override this with
 # sudo service apport start force_start=1
 enabled=0
mtime.conffile..etc.default.apport: 2017-06-27T22:18:31.198313

Revision history for this message
Dennis Real (x-ubunmuone-z) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in printrun (Ubuntu):
status: New → Confirmed
Revision history for this message
Donna Whisnant (dewhisna) wrote :

I'm having the same issue on a clean install of Xubuntu Jammy 22.04:

$ pronterface
WARNING:root:Could not setup DBus for sleep inhibition: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ScreenSaver was not provided by any .service files
Traceback (most recent call last):
  File "/usr/bin/pronterface", line 62, in <module>
    app = PronterApp(False)
  File "/usr/lib/python3/dist-packages/printrun/pronterface.py", line 2439, in __init__
    self.mainwindow = PronterWindow(self)
  File "/usr/lib/python3/dist-packages/printrun/pronterface.py", line 207, in __init__
    self.reload_ui()
  File "/usr/lib/python3/dist-packages/printrun/pronterface.py", line 281, in reload_ui
    self.createGui(self.settings.uimode == _("Compact"),
  File "/usr/lib/python3/dist-packages/printrun/gui/__init__.py", line 259, in createGui
    viz_pane = VizPane(self, vizpanel)
  File "/usr/lib/python3/dist-packages/printrun/gui/viz.py", line 115, in __init__
    root.gwindow = gviz.GvizWindow(build_dimensions = root.build_dimensions_list,
  File "/usr/lib/python3/dist-packages/printrun/gviz.py", line 77, in __init__
    self.p = Gviz(panel, size = size, build_dimensions = build_dimensions, grid = grid, extrusion_width = extrusion_width, bgcolor = bgcolor, realparent = self)
  File "/usr/lib/python3/dist-packages/printrun/gviz.py", line 197, in __init__
    self.mainpen = wx.Pen(wx.Colour(0, 0, 0), penwidth)
TypeError: Pen(): arguments did not match any overloaded call:
  overload 1: too many arguments
  overload 2: argument 2 has unexpected type 'float'
  overload 3: argument 1 has unexpected type 'Colour'

ProblemType: Crash
CrashCounter: 1
CurrentDesktop: XFCE
Date: Tue Jun 21 21:08:01 2022
ExecutablePath: /usr/bin/pronterface
ExecutableTimestamp: 1642104988
InterpreterPath: /usr/bin/python3.10
ProcCmdline: /usr/bin/python3 /usr/bin/pronterface
ProcEnviron:
 LANGUAGE=en_US
 PATH=(custom, user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash

Revision history for this message
Segisfredo Galve Horcas (segisfredo) wrote :

The same problem,

$ pronterface
WARNING:root:RPC server bound on non-default port 7980
Traceback (most recent call last):
  File "/usr/bin/pronterface", line 62, in <module>
    app = PronterApp(False)
  File "/usr/lib/python3/dist-packages/printrun/pronterface.py", line 2439, in __init__
    self.mainwindow = PronterWindow(self)
  File "/usr/lib/python3/dist-packages/printrun/pronterface.py", line 207, in __init__
    self.reload_ui()
  File "/usr/lib/python3/dist-packages/printrun/pronterface.py", line 281, in reload_ui
    self.createGui(self.settings.uimode == _("Compact"),
  File "/usr/lib/python3/dist-packages/printrun/gui/__init__.py", line 259, in createGui
    viz_pane = VizPane(self, vizpanel)
  File "/usr/lib/python3/dist-packages/printrun/gui/viz.py", line 115, in __init__
    root.gwindow = gviz.GvizWindow(build_dimensions = root.build_dimensions_list,
  File "/usr/lib/python3/dist-packages/printrun/gviz.py", line 77, in __init__
    self.p = Gviz(panel, size = size, build_dimensions = build_dimensions, grid = grid, extrusion_width = extrusion_width, bgcolor = bgcolor, realparent = self)
  File "/usr/lib/python3/dist-packages/printrun/gviz.py", line 197, in __init__
    self.mainpen = wx.Pen(wx.Colour(0, 0, 0), penwidth)
TypeError: Pen(): arguments did not match any overloaded call:
  overload 1: too many arguments
  overload 2: argument 2 has unexpected type 'float'
  overload 3: argument 1 has unexpected type 'Colour'

Revision history for this message
Segisfredo Galve Horcas (segisfredo) wrote :

It happend on upgraded ubuntu 22.04 from 20.04. On Ubunti 20.04 Pronterface worked very fine.

Revision history for this message
Guilbert Jean-Marc (jmguilbert) wrote :

Hello
do we have any news about this very annoying problem? Or a temporary solution?
Thanks a lot

Revision history for this message
Dennis Real (x-ubunmuone-z) wrote (last edit ):

Temporary workaround: Check out original software and run it directly from this directory:

Get software (git has to be installed)

$> git clone https://github.com/kliment/Printrun

Change into new fetched directory:

$> cd Printrun

Run pronterface:

$> ./pronterface.py

Revision history for this message
Guilbert Jean-Marc (jmguilbert) wrote :

Big thank you and little hello for you Dennis.
I managed to reuse Pronterface with Ubuntu 22.04 after some difficulty adding "wxpython" solved with:
https://www.pixelstech.net/article/1599647177-Problem-and-Solution-for-Installing-wxPython-on-Ubuntu-20-04

On the other hand, I don't know how to integrate slic3r yet. But I will search.

Have a good evening.
Jean-Marc.

Revision history for this message
Demetrius Lolos (dlolos1) wrote :

I have the same issue on Linux Mint 21.

Revision history for this message
Aaron (aaron-boim) wrote :

me too:
$ pronterface ...
 File "/usr/lib/python3/dist-packages/printrun/gviz.py", line 197, in __init__
    self.mainpen = wx.Pen(wx.Colour(0, 0, 0), penwidth)
TypeError: Pen(): arguments did not match any overloaded call:
  overload 1: too many arguments
  overload 2: argument 2 has unexpected type 'float'
  overload 3: argument 1 has unexpected type 'Colour'

Revision history for this message
Arnold Werbner (arnie.3d) wrote :

Same pronterface will not start up

System:
  Kernel: 5.15.0-72-generic x86_64 bits: 64 compiler: gcc v: 11.3.0 Desktop: Cinnamon 5.6.8
    tk: GTK 3.24.33 wm: muffin dm: LightDM Distro: Linux Mint 21.1 Vera base: Ubuntu 22.04 jammy
Machine:
  Type: Laptop System: TOSHIBA product: SATELLITE L775-18Q v: PSK3WE-05X00UDU
    serial: <superuser required> Chassis: type: 9 serial: <superuser required>
  Mobo: Intel model: Oneonta Falls serial: <superuser required> BIOS: American Megatrends
    v: 1.70 date: 08/22/2011

CPU:
  Info: dual core model: Intel Core i5-2450M bits: 64 type: MT MCP arch: Sandy Bridge rev: 7
    cache: L1: 128 KiB L2: 512 KiB L3: 3 MiB
  Speed (MHz): avg: 1988 high: 2331 min/max: 800/3100 cores: 1: 2331 2: 2243 3: 1941 4: 1438
    bogomips: 19956
  Flags: avx ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3
Graphics:
  Device-1: NVIDIA GF108M [GeForce GT 525M] vendor: Toshiba driver: nouveau v: kernel pcie:
    speed: 2.5 GT/s lanes: 16 ports: active: LVDS-1 empty: HDMI-A-1,VGA-1 bus-ID: 01:00.0
    chip-ID: 10de:0dec
  Display: x11 server: X.Org v: 1.21.1.4 driver: X: loaded: modesetting unloaded: fbdev,vesa
    gpu: nouveau display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1600x900 s-dpi: 96
  Monitor-1: LVDS-1 model: LG res: 1600x900 dpi: 106 diag: 438mm (17.3")
  OpenGL: renderer: NVC1 v: 4.3 Mesa 22.2.5 direct render: Yes

I hope there is a solution ..i already tried the workaround works but can not trust if it works properly

Revision history for this message
Rock Storm (rockstorm) wrote :

Dear Ubuntu team,

This is an annoying issue that should be fixed to allow a proper user experience on LTS release such as Jammy. The problem happens because of Python 3.10+. To solve this bug, please consider:

 a) backporting the current stable (Lunar Lobster) printrun version 2.0.0~rc8-2build1 (which includes the fix for working with Python 3.10+)

 b) cherry-picking the patch to solve the issue [1]

PS/Disclaimer: I am the maintainer of printrun in Debian

[1]: https://salsa.debian.org/3dprinting-team/printrun/-/blob/608965bebd407b94ef99b648cc22f95f4211b1d5/debian/patches/0003-Fix-a-TypeError-on-Python-3.10.patch

Regards,
Rock

Revision history for this message
Paul Loewenstein (paullionstone) wrote :

This bug is exposed by changing from python 3.9 to 3.10. I reported this bug (in a Fedora release) to printrun two years ago, and it was fixed almost immediately.

The link to the printrun-reported bug is below.

https://github.com/kliment/Printrun/issues/1225

This comment brings a similar comment in duplicate https://bugs.launchpad.net/bugs/2045487 to this original bug report.

Revision history for this message
Paul Loewenstein (paullionstone) wrote :

The current printrun release of Pronterface does not work properly with wxpython 4.0.x; it requires at least 4.1.x. Generating custom buttons does not work because it uses GetLuminance, which was only introduced in 4.1.0.

Updating wxpython could affect other apps.

Revision history for this message
Paul Loewenstein (paullionstone) wrote :

Trying to get the current release of Pronterface to work.

This issue I found using wxpython 4.0.7 (as supplied by Ubuntu) is that the pronterface button-handling code uses the wx.Colour GetLuminance attribute, which is supplied only in wxpython 4.1.0 and later.

I tried user-installing later versions of wxpython, but 4.1.0 wouldn't compile, and 4.1.1, 4.2.0 and 4.2.1 all resulted in pronterface displaying a black rectangle in place of the build surface.

So for the moment I have modified pronterface.py (in the package, not the top level).

if b.GetBackgroundColour().GetLuminance() < 0.5:
    b.SetForegroundColour("#ffffff")

is changed to:

try:
    if b.GetBackgroundColour().GetLuminance() < 0.5:
        b.SetForegroundColour("#ffffff")
except AttributeError:
    cxx = b.GetBackgroundColour().GetRGB ()
    lxx = 0.299 * (cxx & 255) + 0.587 * ((cxx >> 8) & 255) + 0.114 * (cxx >> 16)
    if lxx < 127.5:
        b.SetForegroundColour("#ffffff")

For the moment, this is the only way I can get Pronterface to work. This is not a distributable fix; we need to work out why later versions of wxpython don't work properly.

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

I can reproduce the issue in Jammy and have also confirmed that it works on Lunar. So, only Jammy is affected.

Changed in printrun (Ubuntu):
status: Confirmed → Fix Released
Changed in printrun (Ubuntu Jammy):
status: New → In Progress
assignee: nobody → Sudip Mukherjee (sudipmuk)
summary: - pronterface does not start in jammy
+ [SRU] pronterface does not start in jammy
description: updated
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

debdiff for Jammy attached.

Changed in printrun (Ubuntu Jammy):
assignee: Sudip Mukherjee (sudipmuk) → nobody
status: In Progress → Confirmed
Simon Quigley (tsimonq2)
Changed in printrun (Ubuntu Jammy):
status: Confirmed → Fix Committed
status: Fix Committed → In Progress
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Dennis, or anyone else affected,

Accepted printrun into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/printrun/2.0.0~rc7-1ubuntu0.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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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 printrun (Ubuntu Jammy):
importance: Undecided → High
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Paul Loewenstein (paullionstone) wrote :

This fix works fine so far for me. Thank you.

apt list pronterface gave:
pronterface/jammy-proposed,jammy-proposed,now 2.0.0~rc7-1ubuntu0.1 all [installed,automatic]

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

I can confirm that the pronterface package in jammy-proposed has fixed the bug for me.

Test done:
1. Install pronterface on a jammy installation.
2. execute pronterface.
   - It fails to run.
3. Add jammy-proposed to apt sources
4. Update pronterface from jammy-proposed.
5. execute pronterface again.
   - pronterface gui is displayed.

Test result: the errors with pronterface has been fixed and it can be executed again

Package tested:

$ dpkg -l | grep pronterface
ii pronterface 2.0.0~rc7-1ubuntu0.1 all Graphical 3D printer host

tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Paul Loewenstein (paullionstone) wrote :

Just to fill in on what testing I have done (see 2024-01-08 comment above).

Started pronterface.
Connected to printer.
Loaded file to print.
Set bed temperature.
Set extruder temperature.
Confirmed that custom button displayed and worked.
Printed the file.

FYI no checksum or line number errors displayed while printing file (unlike when using a version of printrun that I hacked to (sort of) work).

Disconnected from printer.

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

This bug was fixed in the package printrun - 2.0.0~rc7-1ubuntu0.1

---------------
printrun (2.0.0~rc7-1ubuntu0.1) jammy; urgency=medium

  * Apply upstream patch to fix TypeError on Python 3.10+. (LP: #1975947)

 -- Sudip Mukherjee <email address hidden> Sun, 17 Dec 2023 22:55:15 +0000

Changed in printrun (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Robie Basak (racb) wrote : Update Released

The verification of the Stable Release Update for printrun has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.