ippeveprinter: collection-valued job attributes are never exported to the command (IPP_MEDIA_COL always empty)
Maintainers usually reply within 1 day
@michaelrsweet is already working on this.
Since Sep 29, 2026.
Assessment
This issue has not been assessed yet.
Description
Summary
ippeveprinter does not export collection-valued Job Template attributes to the command environment. IPP_MEDIA_COL is created but always empty.
This matters because modern clients — including CUPS itself and macOS — send the selected media as media-col, not as the media keyword. The result is that a -c command can never discover which media the user chose: IPP_MEDIA is empty because media was not sent, and IPP_MEDIA_COL is empty because collections are dropped.
For a label printer this is the difference between working and not. The whole point of a -c command is to act on the selected media, and there is no way to obtain it.
Expected
ippeveprinter(1) states, without qualification:
ippeveprinter adds environment variables starting with "IPP_" for all IPP Job attributes in the print request. For example, when executing a command for an IPP Job containing the "media" Job Template attribute, the "IPP_MEDIA" environment variable will be set to the value of that attribute.
"all IPP Job attributes" should include collections, or the manual should say they are excluded.
Reproducer
Tested against CUPS 2.4.19 (Homebrew, macOS 15.6 arm64). Also reproduces on Apple CUPS 2.3.4.
media.conf:
ATTR keyword media-supported om_tape9_9x100mm,om_tape24_24x100mm
ATTR keyword media-default om_tape24_24x100mm
ATTR keyword urf-supported V1.4,CP1,RS360,W8,DM1
ATTR resolution printer-resolution-supported 360dpi
ATTR resolution pwg-raster-document-resolution-supported 360dpi
ATTR keyword pwg-raster-document-type-supported black_1,sgray_8
ATTR keyword pwg-raster-document-sheet-back normal
ATTR integer media-top-margin-supported 0
ATTR integer media-bottom-margin-supported 0
ATTR integer media-left-margin-supported 0
ATTR integer media-right-margin-supported 0
ATTR collection media-col-database {
MEMBER collection media-size {
MEMBER integer x-dimension 900
MEMBER integer y-dimension 10000
}
MEMBER keyword media-size-name om_tape9_9x100mm
MEMBER integer media-top-margin 0
MEMBER integer media-bottom-margin 0
MEMBER integer media-left-margin 0
MEMBER integer media-right-margin 0
},{
MEMBER collection media-size {
MEMBER integer x-dimension 2400
MEMBER integer y-dimension 10000
}
MEMBER keyword media-size-name om_tape24_24x100mm
MEMBER integer media-top-margin 0
MEMBER integer media-bottom-margin 0
MEMBER integer media-left-margin 0
MEMBER integer media-right-margin 0
}
show-env.sh:
#!/bin/sh
env | grep '^IPP_MEDIA' > /tmp/ippeve-env.txt
Run:
ippeveprinter -p 8631 -a media.conf -c ./show-env.sh "MediaTest" &
lpadmin -p MediaTest -E -v ipp://localhost:8631/ipp/print -m everywhere
lp -d MediaTest -o media=om_tape9_9x100mm somefile.txt
cat /tmp/ippeve-env.txt
Actual
IPP_MEDIA=
IPP_MEDIA_COL=
IPP_MEDIA_DEFAULT=om_tape24_24x100mm
media-col was sent by the client and accepted by the server (no Unsupported media-col in the log), yet neither variable carries it. Only the printer default comes through, which is not the user's selection.
Serialising a collection into a single env var needs a format decision. Two options that would both solve it:
- Flatten members into separate variables, e.g.
IPP_MEDIA_COL_MEDIA_SIZE_X_DIMENSION=900. - Resolve
media-colback to its matchingmedia-col-databaseentry and setIPP_MEDIAto that entry'smedia-size-name.
Option 2 is smaller and would make existing IPP_MEDIA-reading commands work unchanged.
Secondary: -a silently conflicts with -M / -m
Separate and much smaller. Combining -a with -M or -m makes ippeveprinter exit with a bare usage dump naming no option:
ippeveprinter -p 8631 -a media.conf -M Brother "X" # usage dump, exits
ippeveprinter -p 8631 -a media.conf -m Model "X" # usage dump, exits
ippeveprinter -p 8631 -a media.conf "X" # starts fine
The manual documents all three options with no hint they are mutually exclusive. If the conflict is intended, an error naming the conflicting options would save a lot of guessing. Reproduces on both versions tested.
- Dominant language
- C
- Stars
- 1.8k
- Forks
- 349
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 14
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenPrinting/cups
-
Potential integer overflow when using atoi() In cgi-bin/var.cPossibly taken @lynayur claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
OpenPrinting/cups#1748 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OpenPrinting/cups#1721 ·
Maintainers usually reply within 1 day
-
investigating platform issue printer specific issue
Difficulty 3/5 1-2 days Newbie friendliness 65/100
OpenPrinting/cups#1727 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
OpenPrinting/cups#1726 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
OpenPrinting/cups#1707 · 5 comments ·
Maintainers usually reply within 1 day
All issues in OpenPrinting/cups
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
area:gates bug good first issue
Difficulty 1/5 Under an hour Newbie friendliness 85/100
InauguralSystems/EigenScript#1782 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
intel/intel-device-plugins-for-kubernetes#2384 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
zephyrproject-rtos/zephyr#122261 ·
Maintainers usually reply within 3 days