Fuzzball Volume Provisioner Scan Fails With Invalid UUID Error
Introduction
When importing existing volumes into Fuzzball with fuzzball volume provisioner scan, the scan can fail immediately with a Postgres invalid input syntax for type uuid error. This article explains why the error happens and how to resolve it. It applies to Fuzzball 4.0.x and 4.1.0.
Problem
Running a provisioner scan to import pre-existing volumes fails on the first entry and no volumes are imported:
fuzzball volume provisioner scan <provisioner-name>
rpc error: code = Unknown desc = importing volume "<volume-name>": ERROR: invalid input syntax for type uuid: "" SQLSTATE 22P02
The scan aborts on the first entry it processes, so none of the intended volumes are imported.
Symptoms
fuzzball volume provisioner scanreturnsinvalid input syntax for type uuid: ""withSQLSTATE 22P02.- The scan aborts on the first volume it processes, so the specific volume named in the error varies by environment.
fuzzball volume listshows none of the expected volumes after the scan.
Resolution
The error means the CLI session has no active group (account) selected, so there is no account UUID to attach the imported volumes to. Select a group, then re-run the scan.
First, check your current context and confirm whether a group is active:
fuzzball context list
List the groups available to you:
fuzzball group list
Set the group you want the imported volumes to belong to:
fuzzball group use <group>
Re-run the provisioner scan:
fuzzball volume provisioner scan <provisioner-name>
The scan now completes and the volumes import successfully. Confirm with:
fuzzball volume list
Root Cause
Volumes in Fuzzball belong to an account (group), and the account is stored in a NOT NULL UUID column in the backing Postgres database. When no group is selected in the CLI session, the scan attempts to write an empty string ("") into that UUID column. Postgres rejects the empty string as an invalid UUID and returns SQLSTATE 22P02, which surfaces as the rpc error above. Selecting a group gives the scan a valid account UUID to associate the volumes with, and the import proceeds.