Error: "cannot unmarshal object into Go struct field VirtualMachine.children.vm.section of type string" when creating Encryption Management instance
search cancel

Error: "cannot unmarshal object into Go struct field VirtualMachine.children.vm.section of type string" when creating Encryption Management instance

book

Article ID: 395257

calendar_today

Updated On: 05-12-2025

Products

VMware Cloud Director

Issue/Introduction

  • Unable to create Encryption Management Instance via Cloud Cloud Director Solution Add-On management due to an error of the form:

         Error:  Cannot unmarshal object into Go struct field VirtualMachine.children.vm.section of type string

  • Attempting to create Encryption Management Instance in Cloud Director to provide Bring Your Own Key (BYOK) functionality.
  • The "Executing global 'post-create' action" phase of the Instance Create task fails with an error of the form:

    operation completed with error 1

    vcd-ext/cmd/instance/agent.(*waitOperationToCompleteActivity).Run
        vcd-ext/cmd/instance/agent/activity.go:493
    ...
    cause: Failed to execute trigger byok/cmd/hook
    exit status 1
    vcd-ext/action.(*Program).Execute
        vcd-ext/action/program.go:137
    ...
    cause: json: cannot unmarshal object into Go struct field VirtualMachine.children.vm.section of type string
        at gitlab.eng.vmware.com/core-build/vcd-addon-byok/byok/client/vcd.(*EntityRequest[...]).Get(/opt/src/client/vcd/client_entity.go:165)
        at gitlab.eng.vmware.com/core-build/vcd-addon-byok/byok/client/vcd.GetVirtualApplication(/opt/src/client/vcd/vapp.go:60)
        at gitlab.eng.vmware.com/core-build/vcd-addon-byok/byok/cmd/hook/common.GetVcdVmIdFromVapp(/opt/src/cmd/hook/common/util.go:27)
        at gitlab.eng.vmware.com/core-build/vcd-addon-byok/byok/cmd/hook/common.CreateExtraConfig(/opt/src/cmd/hook/common/util.go:14)
        at main.configureAppServer(/opt/src/cmd/hook/main.go:295)
        at main.runPostCreate(/opt/src/cmd/hook/main.go:110)
        at main.runOperation(/opt/src/cmd/hook/main.go:47)
        at main.main(/opt/src/cmd/hook/main.go:36)
        at runtime.main(/usr/local/go/src/runtime/proc.go:271)
        at runtime.goexit(/usr/local/go/src/runtime/asm_amd64.s:1695)

  • Attempting to delete an Encryption Management Instance using the command "vcdemctl addon instance clean" fails with a similar error:

    vcdemctl addon instance clean --host <vcd_address> --port 443 --username <vcd_system_administrator> --password --insecure --name <instance_name>

    INFO    Removing add-on data types
    INFO    Removing add-on data types
    INFO    Removing add-on instance resources
    INFO    Removing add-on VM name=VMware.Encryption-Management-1.2.0-24058789-Encryption-Management-xxx-appliance ref=urn:vcloud:vapp:########-####-####-####-############
    ERROR   json: cannot unmarshal object into Go struct field VirtualMachine.children.vm.section of type string
            at gitlab.eng.vmware.com/core-build/vcd-addon-byok/byok/client/vcd.(*EntityRequest[...]).Get(/opt/src/byok/client/vcd/client_entity.go:165)

    time="<timestamp>" level=debug msg="Removing all managed virtual center connections created by the solution" origin=####
    time="<timestamp>" level=debug msg="Removing all named credentials created by the solution" origin=####
    INFO    Removing add-on data
    cloud director endpoint https://<vcd_address>:443/cloudapi/1.0.0/entities/types/vmware/byok_encryption_policy/1.1.0?page=1&pageSize=128&sortAsc=name failed: {"minorErrorCode":"ACCESS_TO_RESOURCE_IS_FORBIDDEN","message":"[ ########-####-####-####-############ ] This operation is denied.","stackTrace":"com.vmware.vcloud.api.presentation.entity.security.OperationDeniedException: This operation is denied.
        at main.(*AddonInstanceCleaner).pruneAddonData(/opt/src/byok/cmd/byokctl/addon_instance_clean.go:121)
        ...
        at runtime.goexit(/usr/local/go/src/runtime/asm_amd64.s:1695): 403 Forbidden(403)

  • Similar issue where Encryption Management does not load in VMware Cloud Director after the VMware Cloud Director upgraded to 10.6.1.

 

Environment

  • VMware Cloud Director 10.6.1
  • VMware Cloud Director Encryption Management 1.2
  • VMware Cloud Director Encryption Management 1.1

Resolution

Cloud Director Engineering are aware of this issue and actively evaluating for a fix in a future release of Cloud Director.

To be updated with any changes to this article, Subscribe to this article.

There is no work around for this issue.

Additional Information