Skip to content

make_vcsp_2022.py: vCenter expect an integer/long for the etag #127

@Vinrobot

Description

@Vinrobot

Hi,
I was testing things with Content Libraries and make_vcsp_2022.py when I got an error from vCenter when trying to synchronize.

Task Name: Sync Library Item
Status: A general runtime error occurred. An error occurred: For input string: "9d38a60e5008c8567ff2ea84273a0bf5"
The error I found in /storage/log/vmware/content-library/cls.log
2023-06-03T02:47:37.302+02:00 | ERROR    | 1f01e3a9-9965-4f01-b8ce-f602bff85a34-7d-51-c5 | cls-simple-activity-2     | SimpleActivityWorker           | Exception will not be handled by activity VcspGetFileActivity (handle=24efd964-e765-3fca-9df2-bdd442c2339c, entityId=29b95c02-c870-4029-9f9b-6841a8e1c00e): For input string: "9d38a60e5008c8567ff2ea84273a0bf5"
java.lang.NumberFormatException: For input string: "9d38a60e5008c8567ff2ea84273a0bf5"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_362]
        at java.lang.Long.parseLong(Long.java:589) ~[?:1.8.0_362]
        at java.lang.Long.valueOf(Long.java:803) ~[?:1.8.0_362]
        at com.vmware.cl.vcsp.sync.VcspSyncStrategy.isContentOutdated(VcspSyncStrategy.java:44) ~[cls-main-1.0.0.jar:?]
        at com.vmware.cl.vcsp.activities.VcspGetFileActivity.phaseBegin(VcspGetFileActivity.java:117) ~[cls-main-1.0.0.jar:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_362]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_362]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_362]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_362]
        at com.vmware.vcloud.activity.toolkit.simple.executor.SimpleActivityWorker.executePhase(SimpleActivityWorker.java:358) [activity-framework-toolkit-1.0.0.jar:?]
        at com.vmware.vcloud.activity.toolkit.simple.executor.SimpleActivityWorker.executeActivity(SimpleActivityWorker.java:240) [activity-framework-toolkit-1.0.0.jar:?]
        at com.vmware.vcloud.activity.toolkit.simple.executor.SimpleActivityWorker.run(SimpleActivityWorker.java:105) [activity-framework-toolkit-1.0.0.jar:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_362]
        at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125) [guava-30.1-jre.jar:?]
        at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69) [guava-30.1-jre.jar:?]
        at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) [guava-30.1-jre.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_362]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_362]
        at java.lang.Thread.run(Thread.java:750) [?:1.8.0_362]

I searched the reason and found that "9d38a60e5008c8567ff2ea84273a0bf5" is the etag property in the items.json, which is a MD5 formatted in HEX and not a Long.

I also found a document for the Content Subscription Endpoint Specification version 1 but nothing for the version 2.
Anyway, in the first version of the spec, the etag is supposed to be "An integer representing the version of the file." and it seems like it's still the case with the version 2.
And the items.json generated by vCenter is also using a stringified integer/long for that field.

Finally, vCenter accepts (or maybe doesn't use) the etag under certain circumstance but, except when adding a new Content Library, I couldn't (didn't try to) understand them.

For information:
My vCenter version: 8.0.1 (Build 21560480)
The content library: https://download3.vmware.com/software/vmw-tools/lib.json (Nested ESXi)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions