Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

attributes-natural-language "en-US" is rejected by PAPPL >= 1.4.12 printers (RFC 8011 requires lowercase)

Chiusa Adatta ai principianti
#140 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Una pull request collegata è già stata integrata.

  • #141 di @ChrisEdgington — integrata

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
84/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
networking

Direzione di ricerca

La richiesta viene costruita in ippGetPrinterAttributes() in ipp.go, intorno alle righe 118-119, dove attributes-natural-language è impostato su "en-US". Leggi il requisito di minuscole della RFC 8011 citato nell'issue, poi verifica come le altre richieste IPP in quel file impostano i valori di lingua. È fatto quando l'attributo viene inviato in minuscolo e una stampante PAPPL 1.4.12 restituisce successful-ok, cosa che chi ha segnalato ha confermato con ipptool print-job.test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

ippGetPrinterAttributes() in ipp.go sends attributes-natural-language = "en-US". RFC 8011 §5.1.9 requires lowercase natural-language values in IPP ("IPP requires all lowercase values in IPP attributes", example 'en-us'). Since PAPPL 1.4.12, PAPPL-based printers validate this and reject the request with client-error-bad-request. ipp-usb then treats the device as having no IPP service and fails init with "Device doesn't implement print or scan service". No bridge port is ever opened.

This affects every printer whose firmware is built on PAPPL ≥ 1.4.12. We hit it on a Rollo X1040 label printer after the printer updated its own firmware.

Code

https://github.com/OpenPrinting/ipp-usb/blob/4a2ca771b06e09eac5b822afb1842a006b4bcf11/ipp.go#L118-L119

msg.Operation.Add(goipp.MakeAttribute("attributes-natural-language",
    goipp.TagLanguage, goipp.String("en-US")))

Printer side

PAPPL commit 77d77816 ("Update poll error handling for consistency") added request-level validation:

else if (language && !ippValidateAttribute(language))
  papplClientRespondIPP(client, IPP_STATUS_ERROR_BAD_REQUEST,
      "Bad \"attributes-natural-language\" value '%s'.", ...);

The check is in _papplClientProcessIPP(), so it applies to every operation. ippValidateAttribute() in CUPS 2.4.x validates naturalLanguage values against a lowercase-only pattern.

Observed

Printer: Rollo X1040 (USB 09c5:1040).
Host: Debian 13 (Trixie) arm64, ipp-usb 0.9.23-1+b4. Current master has the same code.

The printer updated its own firmware between these two sessions. Same printer, same host, same ipp-usb, same en-US request.

Firmware 1.6.40 / PAPPL 1.4.8 accepts it (/var/log/ipp-usb/09c5-1040-<serial>-Rollo-X1040-Label-Printer.log):

16-09-2026 10:15:52: >     ATTR "attributes-natural-language" naturalLanguage: en-US
16-09-2026 10:15:52: <   Server: Rollo_AirPrint/1.6.40 PAPPL/1.4.8 CUPS IPP/2.0
16-09-2026 10:15:52: <     STATUS successful-ok

Firmware 1.6.66 / PAPPL 1.4.12 rejects it:

07-10-2026 13:02:49: >     ATTR "attributes-natural-language" naturalLanguage: en-US
07-10-2026 13:02:50: <   Server: Rollo_AirPrint/1.6.66 PAPPL/1.4.12 CUPS IPP/2.0
07-10-2026 13:02:50: <     STATUS client-error-bad-request
07-10-2026 13:02:50: <     ATTR "status-message" textWithoutLanguage: Bad "attributes-natural-language" value 'en-US'.
07-10-2026 13:02:50: ! IPP: IPP: client-error-bad-request
07-10-2026 13:02:50: ! ESCL: eSCL: HTTP status: 404 Not Found
07-10-2026 13:02:50: - Bus 001 Device 004: resetting X1040 Label Printer

and main.log:

07-10-2026 13:02:50: ! PNP Bus 001 Device 004: Device doesn't implement print or scan service

Tested fix

I built 0.9.23 with only "en-US" changed to "en-us" and ran it against the same printer on firmware 1.6.66:

09-10-2026 10:21:01: >     ATTR "attributes-natural-language" naturalLanguage: en-us
09-10-2026 10:21:02: <   Server: Rollo_AirPrint/1.6.66 PAPPL/1.4.12 CUPS IPP/2.0
09-10-2026 10:21:02: <     STATUS successful-ok

Init completed, the device was published via DNS-SD, and a PDF sent with ipptool (print-job.test) through the bridge printed (job-state = completed, job-completed-successfully).

Proposed fix

Change "en-US" to "en-us" in ippGetPrinterAttributes. I'll open a PR with this change.

Assisted-by: Claude:claude-opus-5-5 Claude Code

Lingua principale
Go
Stelle
211
Fork
35
Merge medio
5h 47m
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenPrinting/ipp-usb

Tutte le issue di OpenPrinting/ipp-usb

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.