Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Bad device URI "://" on network printers. Printing stopped working between 2.4.19 and 2.4.20

Closed Beginner friendly
#1,751 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c
Domain
backend

Research direction

The bug is in create_local_printer in scheduler/ipp.c, where the device URI was split out of ptr into device_uri_ptr. Check the two places the report names (the httpSeparateURI call and the cupsdSetDeviceURI call) and see which still read ptr instead of device_uri_ptr. Done means a network printer's device URI parses without the :// error and a job can be queued, which you can confirm by reproducing the printer-creation path or running the scheduler's printer tests.

Written by the indexing model from the issue text.

Description

Describe the bug
Printing on a discovered network printer does not spawn jobs anymore and only throws errors in logs, no feedback in any UI (on my system).
This bug was probably introduced in 2.4.20, because a downgrade to 2.4.19 seems to fix my issue.

To Reproduce

  • Print a page using firefox, select "print with system dialog".
  • Observe that the network printer is listed, but "fetching information..." does not stop.
  • Printing does not spawn a job, the web UI of cups does not show any queued, failed or completed jobs.

Some logs:

# lpoptions -p <printername> -l
lpoptions: Unable to get PPD file for <printername>: No such file or directory
# tail /var/log/cups/error_log
E [24/Sep/2026:16:38:46 +0200] [Job 23] Files have gone away.
  W [08/Oct/2026:13:26:10 +0200] No limit for Set-Printer-Attributes defined in policy default - using CUPS-Add-Modify-Printers's policy.
  W [08/Oct/2026:13:26:10 +0200] No limit for Set-Printer-Attributes defined in policy authenticated - using CUPS-Add-Modify-Printers's policy.
  E [08/Oct/2026:13:26:10 +0200] [Job 24] Unable to queue job for destination "<printername>".
  E [08/Oct/2026:13:26:10 +0200] [Job 25] Unable to queue job for destination "<printername>".
  E [08/Oct/2026:13:26:10 +0200] [Job 26] Unable to queue job for destination "<printername>".
  E [09/Oct/2026:15:37:20 +0200] <printername>: Bad device URI "://".
  E [09/Oct/2026:15:37:20 +0200] [Client 1125] Returning IPP server-error-device-error for CUPS-Create-Local-Printer (ipps://localhost/printers/<printername>) from localhost.

System Information:

  • Arch Linux x86_64 7.2.9-arch1-1
  • Firefox
  • CUPS version 2.4.20

Guessed Cause:
https://github.com/OpenPrinting/cups/commit/3c86e2f5fc797030aea65f3d6104b1a3d84f4f88

-  const char	*ptr;			/* Pointer into attribute value */
+  const char	*ptr,			/* Pointer into attribute value */
+		*device_uri_ptr;	/* Pointer into device URI value */

In this commit, the variable ptr in function create_local_printer was split into two: ptr and device_uri_ptr.
But two references were forgotten to be updated to device_uri_ptr, such referencing the wrong string:

-    httpSeparateURI(HTTP_URI_CODING_ALL, ptr,
+    httpSeparateURI(HTTP_URI_CODING_ALL, device_uri_ptr,
                  scheme, sizeof(scheme), userpass, sizeof(userpass), host,
                  sizeof(host), &port, resource, sizeof(resource));

https://github.com/OpenPrinting/cups/blob/ef80eeaea51430a055948240eea3f28ef5354edf/scheduler/ipp.c#L5802-L5806

   else
-    cupsdSetDeviceURI(printer, ptr);
+    cupsdSetDeviceURI(printer, device_uri_ptr);

https://github.com/OpenPrinting/cups/blob/ef80eeaea51430a055948240eea3f28ef5354edf/scheduler/ipp.c#L5832-L5837

Dominant language
C
Stars
1.8k
Forks
349
Avg merge
3d 12h
Merged PRs (30d)
12

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenPrinting/cups

All issues in OpenPrinting/cups

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.