resizeVolume with automigrate throws NullPointerException when the migration returns no volume

Aperta Adatta ai principianti
#14,751 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
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
backend, cloud

Direzione di ricerca

Inizia dal percorso resizeVolume, dove volume viene impostato da _volsDao.findById solo quando migrateVolume restituisce un risultato non nullo, poi leggi i blocchi try e catch che chiamano volume.getUuid(). Lo stesso schema compare in changeOfferingForVolume. È completato quando un risultato di migrazione nullo restituisce l'errore di migrazione originale con il riferimento originale al volume e il pool effettivamente tentato, senza NullPointerException. Il payload non indica alcun file di test, quindi cerca i test esistenti di ridimensionamento o migrazione dei volumi da estendere.

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

Descrizione

problem

resizeVolume with automigrate=true throws a NullPointerException when the volume has to move to another pool and migrateVolume returns no volume.

step code
migration result volume = (result != null) ? _volsDao.findById(result.getId()) : null;
error built in the try volume.getUuid() on a null volume
error built in the catch volume.getUuid() again, so the NPE escapes

migrateVolume returns null on the VM work-job path when the job result is not a volume id.

changeOfferingForVolume has the same block. It does not NPE, but its message prints volume: null and names suitableStoragePools.get(0) instead of the pool that was tried.

versions

4.22 (the same code is on main).

The steps to reproduce the bug
  1. Resize a volume attached to a VM so that its pool lacks space, with automigrate=true.
  2. Have the migrate job finish without returning a volume id.
  3. The API returns a NullPointerException instead of a migration error.
What to do about it?

Keep the original volume reference for the message, report the pool that was actually tried, and keep the migration failure as the cause.

Lingua principale
Java
Stelle
3.1k
Fork
1.4k
Merge medio
6g 18h
PR unite (30g)
11

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 apache/cloudstack

Tutte le issue di apache/cloudstack

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.