ippsample icon indicating copy to clipboard operation
ippsample copied to clipboard

Get-Output-Device-Attributes is not returning printer-state & printer-state-reasons value.

Open sahusara opened this issue 1 month ago • 3 comments

Describe the bug The Get-Output-Device-Attributes IPP operation fails to return printer-state and printer-state-reasons attributes even when they are present on the output device, causing clients to receive incomplete printer status information.

To Reproduce Steps to reproduce the behavior:

  1. Launch the IPP server instance
  2. Register the printer through the Update-Output-Device-Attributes operation
  3. Use ipptool to retrieve the Output-Device capabilities
  4. Verify that the response does not include printer-state or printer-state-reasons

{ NAME "Get Output Device Attributes" VERSION 2.0 OPERATION Get-Output-Device-Attributes GROUP operation-attributes-tag ATTR charset attributes-charset utf-8 ATTR naturalLanguage attributes-natural-language en ATTR uri printer-uri $uri ATTR uri output-device-uuid urn:uuid:ae4d22d1-79b7-4e0e-b697-986e0d91b053 ATTR keyword requested-attributes printer-state,printer-state-reasons # printer-description # all,printer-state,printer-state-reasons

STATUS successful-ok

}

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Version of the software Provide the version of ippsample you are testing (f4344173fa97acaf010288c5a3103eac3979e8aa)

System Information:

  • OS: [Linux]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here. Added printer-state,printer-state-reasons to below code in ipp_update_output_device_attributes() and it worked. Not sure if it is the right place to add.

"if (strncmp(attrname, "copies", 6) && strncmp(attrname, "document-format", 15) && strncmp(attrname, "finishings", 10) && strncmp(attrname, "media", 5) && strncmp(attrname, "print-", 6) && strncmp(attrname, "sides", 5) && strncmp(attrname, "printer-alert", 13) && strncmp(attrname, "printer-input", 13) && strncmp(attrname, "printer-output", 14) && strncmp(attrname, "printer-resolution", 18) && strncmp(attrname, "printer-state", 13) && strncmp(attrname, "pwg-raster", 10) && strncmp(attrname, "urf-", 4))"

system.conf

System Configuration File

MakeAndModel "HP" "HP Color LaserJet Pro MFP" Listen *:8631 SpoolDir /work/git/ippsample/installhere/automation/output DataDir /work/git/ippsample/installhere/automation/output KeepFiles No LogLevel Debug

conf/print/infra.conf

Infra Configuration File

AuthProxyGroup @system MaxOutputDevices 2 WebForms No MAKE "HP" MODEL "HP Color LaserJet Pro MFP" DeviceURI "ipp://10.224.1.1:8631/ipp/print/infra"

Please attach applicable configuration, log, or print files as well. Github may require you to rename your text files with a ".txt" extension.

sahusara avatar Dec 04 '25 11:12 sahusara

So how are you running a proxy to ippserver? Are you including the "printer-state" and "printer-state-reasons" attributes when you send an Update-Output-Device-Attributes request to the infra printer?

michaelrsweet avatar Dec 08 '25 21:12 michaelrsweet

FWIW, I added default printer-state/-reasons values (stopped/5 and 'printer-stopped') in case the proxy doesn't include values:

[master bf2907a] Add initial printer device state (Issue #304)

michaelrsweet avatar Dec 08 '25 21:12 michaelrsweet

@michaelrsweet Yes printer proxy sends printer-state and printer-state-reason in Update-Output-Device-Attributes. Here is the Wireshark trace. Ippserver is also not returning 'printer-is-accepting-jobs' please have a look at it.

printer-proxy-to-ippserver.zip

After sending couple of job IppServer is hung and does not respond to neither proxy nor to the client. Here are logs.

ippserver-not-responding.zip

When I enabled below log it started failing from the first case itself.

CUPS_DEBUG_LEVEL=9 CUPS_DEBUG_FILTER='^(http|_http|ipp|_ipp|cupsDNSSD|cupsDo|cupsGet|cupsSend)' CUPS_DEBUG_LOG = '-'

Without enabling the log, it fails after 3-4 print job. Used both PWG raster and PDF to send the jobs. Please let me know if additional log is needed for this issue.

sahusara avatar Dec 09 '25 03:12 sahusara