I’m trying to restore a Director basket snapshot, taken on one system (my production server), into another system (my test server).
All else being equal on both systems (same versions and config of icinga2, icingadb, icingaweb2 and director [except for obvious differences like PKI]), the restore fails with the error:
Basket does not support '0' (BasketSnapshot.php:117)
Well… as it turns out, not doing one huge backup of all director objects in one basket can help with further diagnosis.
I’ve done an export by object category (datalists, dependencies, hosts, hostgroups etc.) and found the culprit to be in the “basket definitions” (which can also be included in snapshots and therefore backups and restores).
I’ll investigate further; let’s see where this leads…
I got the same problem when I tried to import a just exported Basket snapshot containing a Basket definition.
I managed to do that earlier this year and had a working copy in git.
The difference was in the Basket definition in the snapshot. The working version has the objects in the Basket as proper JSON structure: