Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RbVmomi deserialization fails on managed object type ContentLibrary #28

Closed
mahcsig opened this issue Dec 29, 2022 · 7 comments · Fixed by #29
Closed

RbVmomi deserialization fails on managed object type ContentLibrary #28

mahcsig opened this issue Dec 29, 2022 · 7 comments · Fixed by #29
Assignees
Labels
bug Something isn't working

Comments

@mahcsig
Copy link

mahcsig commented Dec 29, 2022

Describe the bug
This is actually the same bug from vmware-archive#205, but it is now locked over there.

I ran into the same issue, but was looking to wait for the Content Library Sync to finish for some post-processing.

I know that it is not the correct way to fix this, so I didn't add a pull request, but for anyone looking to get around the issue until a proper fix is available, I was able to hack a ContentLibrary object in so I could view the task list and wait for the sync task. You can find it on this commit: mahcsig@46a708d

It doesn't actually work as a ManagedObject (it throws errors when trying to access attributes like name), but it works enough to allow the task to load.

Sorry this isn't in the proper format, but the above mentioned ticket is, and is still applicable.

@mahcsig mahcsig added the bug Something isn't working label Dec 29, 2022
@agrare
Copy link
Member

agrare commented Jan 5, 2023

Thanks for the reminder @mahcsig I was hoping the rbvmomi maintainers would fix this but now that is us :)

I want to take a look at the xml that is returned for that object, I'm thinking of creating a new "base class" for these that isn't ManagedObject since that comes with certain assumptions.

@agrare
Copy link
Member

agrare commented Jan 5, 2023

Here is the XML for a task with a ContentLibrary object:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<RetrievePropertiesResponse xmlns="urn:vim25"><returnval><obj type="Task">task-202176</obj><propSet><name>info</name><val xsi:type="TaskInfo"><key>task-202176</key><task type="Task">task-202176</task><descriptionId>com.vmware.content.Library.Update</descriptionId><entity type="ContentLibrary">clib-6424</entity><entityName>Tanzu_Content_Library</entityName><state>success</state><cancelled>false</cancelled><cancelable>true</cancelable><reason xsi:type="TaskReasonUser"><userName>Administrator</userName></reason><queueTime>2023-01-05T15:39:25.674049Z</queueTime><startTime>2023-01-05T15:39:25.845494Z</startTime><completeTime>2023-01-05T15:39:26.113964Z</completeTime><eventChainId>17541175</eventChainId><activationId>dd3b93d7-23f3-45f8-82a3-35e76402e516</activationId></val></propSet></returnval></RetrievePropertiesResponse>
</soapenv:Body>
</soapenv:Envelope>

@Fryguy
Copy link
Member

Fryguy commented Jan 5, 2023

For readability:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <RetrievePropertiesResponse xmlns="urn:vim25">
      <returnval>
        <obj type="Task">task-202176</obj>
        <propSet>
          <name>info</name>
          <val xsi:type="TaskInfo">
            <key>task-202176</key>
            <task type="Task">task-202176</task>
            <descriptionId>com.vmware.content.Library.Update</descriptionId>
            <entity type="ContentLibrary">clib-6424</entity>
            <entityName>Tanzu_Content_Library</entityName>
            <state>success</state>
            <cancelled>false</cancelled>
            <cancelable>true</cancelable>
            <reason xsi:type="TaskReasonUser">
              <userName>Administrator</userName>
            </reason>
            <queueTime>2023-01-05T15:39:25.674049Z</queueTime>
            <startTime>2023-01-05T15:39:25.845494Z</startTime>
            <completeTime>2023-01-05T15:39:26.113964Z</completeTime>
            <eventChainId>17541175</eventChainId>
            <activationId>dd3b93d7-23f3-45f8-82a3-35e76402e516</activationId>
          </val>
        </propSet>
      </returnval>
    </RetrievePropertiesResponse>
  </soapenv:Body>
</soapenv:Envelope>

@Fryguy Fryguy closed this as completed in #29 Jan 5, 2023
@agrare
Copy link
Member

agrare commented Jan 5, 2023

Fix for this bug released in v3.6.0

@mahcsig
Copy link
Author

mahcsig commented Jan 5, 2023

Thanks for knocking this out so quick @agrare and @Fryguy !

@mahcsig
Copy link
Author

mahcsig commented Feb 16, 2023

@agrare @Fryguy Not sure if you want another ticket of if this one will work, but I just ran into the ContentLibraryItem object throwing the same error after an object gets deleted from the library

/var/people/appuser/.rvm/gems/ruby-3.1.3/gems/rbvmomi2-3.6.0/lib/rbvmomi/type_loader.rb:104:in `make_type': unknown VMODL type ContentLibraryItem (RuntimeError)

Thanks!

@agrare
Copy link
Member

agrare commented Feb 16, 2023

Hey @mahcsig ! That looks like a new data type coming in that is causing the same problem. Since this issue is closed and tied to a release tag could you open a new issue for this so I can link a new PR to it? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants