-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetPrinterAttributesAsync() throws "0 length attribute name found not in a 1setOf" from Lexmark printers #3
Comments
@xqrzd Sorry, I missed notification. |
I searched for public printers.
I didn't get an exception. |
Providing the IPP response of Get-Printer-Attributes is a good idea. JIPP includes some printers: https://github.com/HPInc/jipp/tree/master/jipp-core/src/test/resources/printer I've started a project to collect and share printer-attributes as raw ipp-response: Raw IPP response can be used by mocks for tests e.g. like this https://github.com/gmuth/ipp-client-kotlin/blob/master/src/test/kotlin/de/gmuth/ipp/client/CupsClientTests.kt. |
@danielklecha I experienced the same issue with a HP Color LaserJet MFP M476dn. Thanks @gmuth for providing an easy way to share these responses for debugging! I added a PR with a response from the printer I'm experiencing this with to your repo: gmuth/document-format-supported#2 Also attached here: HP Color LaserJet MFP M476dn.zip Note that the actual problematic response SharpIppNext tries to parse seems to be protocol version 1.1, while @gmuth's tool dumps a 2.0 response. |
Debug output when the exception is thrown:
Interestingly, this happens around |
I created a dump of the raw response by my printer that produces this behaviour. HP Color LaserJet MFP M476dn IPP 1.1 GetPrinterAttributes anonymized.zip I manually anonymized the data inside in a similar way to what @gmuth's tool would do, but I didn't change the lengths of any attributes, so this file is as close as it gets to the original. This dump is an IPP 1.1 response, as SharpIppNext would get. I actually created a small SharpIppNext-based tool that dumps these responses (it doesn't automatically apply any changes/anonymization to the dumps). Maybe that could be helpful to e.g. add some more real printer responses to the unit tests. |
It seems to have regressed from this commit, 37b0660
Reverting to the prior implementation of GetNormalizedName() fixes the issue,
When the exception is thrown in GetNormalizedName(), tag is
Keyword
, name is an empty string, and prevAttribute istwo-sided-long-edge
. If it's helpful I can attach the binary response from the printer.The text was updated successfully, but these errors were encountered: