Manage Object issue with withLatestValues=true

Hi Team,
I’m using the below API

/inventory/managedObjects/${device_id}?withLatestValues=true

to get the latest measurement value in managedObject, but some time get the 500 Server error whenever measurement missing in c8y_LatestMeasurements object

"c8y_LatestMeasurements": {
        "sol_TankMeasurement": {
            "DaysUntilDelivery(Total Flow Rate)": {
                "time": "2025-01-22T14:10:00.000Z",
                "value": 0.0,
                "unit": "days"
            },
            "ISoN50-100 (V8)": {
                "time": "2025-02-04T10:05:00.000Z",
                "value": 40.0,
                "unit": ""
            },
            "Soyad_Reserve_Tank_PV": {
                "time": "2025-02-04T10:05:00.000Z",
                "value": 126.206,
                "unit": "in"
            },
            "TankLiquidVolume": {
                "time": "2025-02-04T10:05:00.000Z",
                "value": 51.8,
                "unit": "Imperial Tons"
            },
            "TankDrawDownFlowRate": {
                "time": "2025-02-04T10:05:00.000Z",
                "value": 0.0,
                "unit": "Imperial Tons/day"
            },
            "DaysSupplyOfInventory(Total Flow Rate)": {
                "time": "2025-01-22T14:10:00.000Z",
                "value": 0.0,
                "unit": "days"
            },
            "TankLiquidVolumeInMass": {
                "time": "2025-02-04T10:05:00.000Z",
                "value": 116024.47,
                "unit": "lbs"
            },
            "DaysUntilDelivery(Drawdown)": {
                "time": "2025-02-04T10:04:00.000Z",
                "value": 0.0,
                "unit": "days"
            },
            "LiquidTankLevel": {
                "time": "2025-02-04T10:05:00.000Z",
                "value": 126.21,
                "unit": "inches"
            },
            "DaysSupplyOfInventory(Drawdown)": {
                "time": "2025-02-04T10:04:00.000Z",
                "value": 862.49,
                "unit": "days"
            },
            "TotalFlowRate": {
                "time": "2025-01-22T14:03:00.000Z",
                "value": 1337.96,
                "unit": "gallons/day"
            },
            "Soyad_Main_Tank_PV": {
                "time": "2025-02-04T10:05:00.000Z",
                "value": 24.203,
                "unit": "in"
            },
            "Always On (C8)": {
                "time": "2025-01-15T10:05:00.000Z",
                "value": 1.0,
                "unit": ""
            }
        }
    }

Any suggestion, How we can fix it ?.

Hi,

I cannot follow exactly when you get the “500” error. Is it when the last measurement you received does not have a value for a specific series?

Anyway, to me this looks like an issue for which you should create a ticket with Cumulocity support:

https://cumulocity.com/support

1 Like