Bug 1777858 - fails to provide HTTP error diags
Summary: fails to provide HTTP error diags
Alias: None
Product: Fedora
Classification: Fedora
Component: system-config-printer
Version: rawhide
Hardware: All
OS: All
Target Milestone: ---
Assignee: Zdenek Dohnal
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2019-11-28 14:00 UTC by Michael Shigorin
Modified: 2019-11-28 15:37 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-11-28 15:07:47 UTC
Type: Bug

Attachments (Terms of Use)

Description Michael Shigorin 2019-11-28 14:00:39 UTC
Description of problem:

Silently ignores "Next" button clicks when /usr/share/system-config-printer/newprinter.py gets e.g. HTTP 404 during

  ppdurlobj = urllib.request.urlopen(file_to_download)

Version-Release number of selected component (if applicable):

system-config-printer 1.5.11 (hasn't changed in 1.5.12/git master)

How reproducible:

Always for a given printer, driver and openprinting.org state.

Steps to Reproduce:

1. start system-config-printer
2. try configuring a networked Samsung M332x printer (e.g. over DNS-SD)
3. go with proposed defaults all the way until exact "Generic PCL6/PCL XL Printer Foomatic/pxlcolor [en] (recommended)" is pre-selected, click "Next"

Actual results:

$ system-config-printer --debug
Next clicked on page 3
Will fetch ppd? 1
ppd file to download [http://www.openprinting.org/foomatic-db/db/source/PPD/Samsung/PS/Samsung_M332x_382x_402x_Series.ppd]
Traceback (most recent call last):
  File "/usr/share/system-config-printer/newprinter.py", line 945, in on_btnNPForward_clicked
  File "/usr/share/system-config-printer/newprinter.py", line 1128, in nextNPTab
    self.ppd = self.getNPPPD()
  File "/usr/share/system-config-printer/newprinter.py", line 4167, in getNPPPD
    ppdurlobj = urllib.request.urlopen(file_to_download)
  File "/usr/lib64/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib64/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python3.7/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib64/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/lib64/python3.7/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

Expected results:

Printer configured _or_ meaningful diagnostics presented.

Additional info:

This particular result was obtained on e2k-alt-linux but I think it's neither distro- or arch-specific.

Comment 1 Zdenek Dohnal 2019-11-28 15:07:47 UTC
Hi Michael,

thank you for reporting the issue!

Unfortunately, I'm not able to reproduce on current Fedora rawhide.

I created fake print queue with the driver you mentioned and did not get traceback you shared.

Although getting traceback is other thing, you should get the right error message. I fixed the traceback in upstream now.

If you are able to reproduce it on Fedora, please feel free to reopen.


If your printer is IPP everywhere enabled, you try to add it through localhost:631 when cups is running and set it as IPP everywhere model.

Comment 2 Michael Shigorin 2019-11-28 15:11:33 UTC
Zdenek, would you please have a look at the actual code and consider a GUI warning like "HTTP error" at least? :-)

Comment 3 Zdenek Dohnal 2019-11-28 15:32:42 UTC
That's how I fixed in upstream - looked at the actual code and give the warning :-) If you are able to reproduce it in Fedora, then I'll backport it to Fedora.

If someone is not able to hit it in Fedora, there is no rush for backporting it.

Comment 4 Michael Shigorin 2019-11-28 15:37:20 UTC
Ah, see feed693225cc0c26464bfc0adef21da72581e811, SIGTHX ;-)

Note You need to log in before you can comment on or make changes to this bug.