flash { guid } always fails: resolver no longer returns guid but the schema marks it non-nullable

Aperta Adatta ai principianti
#2,139 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
graphql, typescript
Ambito
api, backend

Direzione di ricerca

Inizia da flash.resolver.ts, dove FlashResolver.flash() non restituisce più guid, e confrontalo con Flash.guid non nullable dichiarato in flash.model.ts. Verifica come vars { flashGuid } ottiene emhttp.var.flashGuid. È completato quando flash { guid } restituisce il GUID di avvio, oppure quando il campo diventa nullable per i server che non ne hanno uno, e la query non azzera più l'intera risposta. Decidi prima tra le due correzioni, perché la issue lascia la scelta aperta.

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

Descrizione

Environment

Unraid OS Version: 7.3.4 (API 4.37.9+bedd403a)

Are you using a reverse proxy? No. Tested directly against the server's built-in /graphql endpoint, authenticated with an x-api-key (ADMIN role).

Hardware / setup that may matter: Supermicro X12STH-F, Xeon E-2356G. Boots from a USB flash drive with a Pro licence registered to it (not internal boot, not TPM licensing). vars { flashGuid } returns the correct GUID on this server, so the value is available to the API.

Pre-submission Checklist

  • I have verified that my Unraid OS is up to date
  • I have tested this issue by accessing my server directly (not through a reverse proxy)
  • This is not an Unraid Connect related issue (if it is, please submit via the support form instead)

Issue Description

Any flash query that asks for guid fails, because the resolver never returns it and the schema says it can never be null.

Flash.guid is declared as String! in flash.model.ts, but FlashResolver.flash() returns only id, vendor and product. guid: emhttp.var.flashGuid was removed from the resolver in #1361 (commit 586653cc, 2025-04-29) and the field was never removed from the model. It is still like this on main.

Steps to Reproduce

  1. query { flash { id vendor product } } succeeds.
  2. query { flash { guid } } fails.

Expected Behavior

guid returns the boot device GUID (the same value as vars { flashGuid }), or the field is nullable or removed if it is meant to go away for internal boot / TPM servers.

Actual Behavior

{"errors":[{"message":"Cannot return null for non-nullable field Flash.guid.","path":["flash","guid"]}],"data":null}

Because flash itself is non-nullable on Query, the error also wipes out every other field in the same request: { online flash { guid } } returns "data": null.

Additional Context

Possible fixes: put back guid: emhttp.var.flashGuid in flash.resolver.ts, or make the field nullable: true if internal boot servers have no flash GUID (see #1880). The workaround for now is vars { flashGuid }.

Lingua principale
TypeScript
Stelle
123
Fork
25
Merge medio
2g 16h
PR unite (30g)
9

Preparare l'ambiente

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 unraid/api

Tutte le issue di unraid/api

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.