Log warning instead of error when GCP disk description does not contain JSON
#3,672 opened on Apr 9, 2021
Repository metrics
- Stars
- (10,111 stars)
- PR merge metrics
- (PR metrics pending)
Description
What steps did you take and what happened: If you manually create a disk in GCP, or in my case restore a disk taken from a snapshot (Velero or otherwise) The future backups will error with "invalid character". This is because the "Description" field must be written JSON.

The output of the following commands will help us better understand what's going on: (Pasting long output into a GitHub gist or other pastebin is fine.)
velero backup logs backup-2021-04-09-11-02-39 |grep -i -A2 -B2 error
time="2021-04-09T11:02:59Z" level=info msg="Getting volume information" backup=velero/backup-2021-04-09-11-02-39 logSource="pkg/backup/item_backupper.go:483" name=pv-omk-bi-data-restored namespace= persistentVolume=pv-omk-bi-data-restored resource=persistentvolumes volumeID=omk-bi-data-restored
time="2021-04-09T11:02:59Z" level=info msg="Snapshotting persistent volume" backup=velero/backup-2021-04-09-11-02-39 logSource="pkg/backup/item_backupper.go:489" name=pv-omk-bi-data-restored namespace= persistentVolume=pv-omk-bi-data-restored resource=persistentvolumes volumeID=omk-bi-data-restored
time="2021-04-09T11:02:59Z" level=error msg="unable to decode disk's description as JSON, so only applying Velero-assigned tags to snapshot" backup=velero/backup-2021-04-09-11-02-39 cmd=/plugins/velero-plugin-for-gcp error="invalid character 'A' looking for beginning of value" logSource="/go/src/github.com/vmware-tanzu/velero-plugin-for-gcp/velero-plugin-for-gcp/volume_snapshotter.go:282" pluginName=velero-plugin-for-gcp
time="2021-04-09T11:03:00Z" level=info msg="Backed up 481 items out of an estimated total of 6137 (estimate will change throughout the backup)" backup=velero/backup-2021-04-09-11-02-39 logSource="pkg/backup/backup.go:394" name=omk-blockchain-interface-6554746488-h4h5m namespace=mediledger-dev progress= resource=pods
Invalid character "A". A is from the first word "Apparently" in the screenshot.
Velero still takes the backup, however if called from a script, it will exit with an error, thus causing automation to alert that a backup failed. So it's kinda 2 bugs, 1 there's no indication that the description must be JSON, 2 velero-cli exits with an error, causes scripts to fail.
Environment:
$ velero version
Client:
Version: v1.5.4
Git commit: -
Server:
Version: v1.5.3
Vote on this issue!
This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.
- :+1: for "I would like to see this bug fixed as soon as possible"
- :-1: for "There are more important bugs to focus on right now"