Skip to content

Cesivi Server - Error Catalog

HomeDocumentationReference → Error Catalog

This document catalogs common errors encountered when using Cesivi Server and provides root cause explanations, workarounds, and references to detailed documentation.


CSOM Errors (70.3% Pass Rate Baseline)

CSOM errors are divided into architectural constraints (unfixable) and implementation gaps (fixable). This section documents the architectural constraints that affect mock server compatibility.

PropertyNotInitializedException

Pattern: Property or field 'FieldName' has not been initialized

Cause: CSOM Load() with lambda expressions doesn't properly initialize all properties in the response.

Root Cause Analysis: - CSOM client library uses a proprietary binary JSON serialization format (undocumented by Microsoft) - When using ctx.Load(list, l => l.Title, l => l.Description), the client library specifies which properties to retrieve - The mock server (and real SharePoint) returns only those properties - However, the CSOM client library has internal expectations about property ordering and initialization state - Properties returned via lambda expressions are not marked as "initialized" in the CSOM client's internal state dictionary - Subsequent access attempts throw PropertyNotInitializedException before the property is even used

Why This Can't Be Fixed: 1. ❌ Requires Microsoft CSOM client library source code (closed-source) 2. ❌ Requires understanding undocumented protocol specification 3. ❌ Would require modifications to Microsoft's CSOM client library (not possible from server side) 4. ✅ Can be worked around by changing client code

Workaround:

// ❌ DON'T: Lambda expressions cause PropertyNotInitializedException
using (var ctx = new ClientContext("http://mocksharepoint.local"))
{
    var web = ctx.Web;
    ctx.Load(web, w => w.Title, w => w.Description);
    ctx.ExecuteQuery();
    Console.WriteLine(web.Title);  // Throws PropertyNotInitializedException
}

// ✅ DO: Load entire objects without lambda expressions
using (var ctx = new ClientContext("http://mocksharepoint.local"))
{
    var web = ctx.Web;
    ctx.Load(web);  // No lambda
    ctx.ExecuteQuery();
    Console.WriteLine(web.Title);  // Works correctly
}

// ✅ DO: Load collections without lambda expressions
using (var ctx = new ClientContext("http://mocksharepoint.local"))
{
    var lists = ctx.Web.Lists;
    ctx.Load(lists);  // No lambda
    ctx.ExecuteQuery();
    foreach (var list in lists)
    {
        Console.WriteLine(list.Title);  // Works correctly
    }
}

Affected Tests: - CSOM test failures: ~73% (54/74 failures from S2.641 analysis) - PnP test failures: ~73% (136/187 failures from S2.656 analysis)

Statistics: - Baseline: 175/249 CSOM tests (70.3%) pass - Failure Rate: 74/249 (29.7%) fail due to CSOM limitations - Fix Status: ❌ NOT VIABLE - architectural constraint

Documentation: - See: KNOWN_LIMITATIONS.md for additional context - See: ARCHITECTURE.md for architectural overview


Serialization Format Errors

Pattern: The type of data at position X is different than expected

Cause: Undocumented CSOM binary JSON format requirements not met by mock server response.

Root Cause Analysis:

CSOM uses a dual-layer serialization format: 1. HTTP Layer: Standard JSON-RPC for request/response 2. CSOM Protocol Layer: Custom TypeId-based serialization with specific property ordering

The mock server implements JSON-RPC correctly, but the CSOM protocol layer has: - Proprietary TypeId format requirements - Specific property ordering constraints - Special handling for collections (_Child_Items_) - Special handling for object identities (_ObjectIdentity_, _ObjectType_)

Example error during GetListByTitle:

Error: The type of data at position 391 is different than expected.
  Expected: ListItemCollectionPosition
  Got: String or null

This error indicates that at byte position 391 in the response, the CSOM client expected a specific data type structure, but received something different. The exact format cannot be replicated without: 1. Real SharePoint server for comparison 2. Microsoft CSOM protocol specification (unavailable) 3. Reverse engineering via binary protocol analysis

Why This Can't Be Fixed: 1. ❌ Requires protocol specification (not publicly available) 2. ❌ Requires real SharePoint proxy capture for format comparison 3. ❌ Requires binary format analysis tools 4. ✅ Could potentially be worked around by using REST API instead of CSOM

Workaround:

Use REST API instead of CSOM for affected operations:

# ❌ DON'T: Use CSOM if possible (may encounter serialization errors)
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext("http://mocksharepoint.local")
$list = $ctx.Web.Lists.GetByTitle("Documents")
$ctx.Load($list.Items)
$ctx.ExecuteQuery()

# ✅ DO: Use REST API instead
$web = Invoke-WebRequest -Uri "http://mocksharepoint.local/_api/web" -UseDefaultCredentials
$lists = Invoke-WebRequest -Uri "http://mocksharepoint.local/_api/web/lists" -UseDefaultCredentials
$items = Invoke-WebRequest -Uri "http://mocksharepoint.local/_api/web/lists/getbytitle('Documents')/items" -UseDefaultCredentials

Affected Tests: - CSOM test failures: ~27% (20/74 failures from S2.641 analysis) - PnP test failures: ~27% (50/187 failures from S2.656 analysis)

Statistics: - Baseline: 175/249 CSOM tests (70.3%) pass - Failure Rate: 74/249 (29.7%) fail, ~27% due to serialization - Fix Status: ❌ NOT VIABLE - protocol specification required

Documentation: - See: KNOWN_LIMITATIONS.md for details - See: API_REFERENCE.md for REST API documentation


PnP PowerShell Errors (21.4% Pass Rate Baseline)

PnP PowerShell failures are 85% CSOM-dependent, inheriting failures from the CSOM layer.

PnP-CSOM Dependency

Pattern: Most PnP failures trace back to CSOM PropertyNotInitializedException or Serialization errors

Root Cause: - PnP PowerShell cmdlets use CSOM client library internally - 85% of PnP failures (155-165 of 187 from S2.656 analysis) are CSOM-dependent - PropertyNotInitializedException: ~73% of failures - CSOM Serialization Errors: ~27% of failures - 10-15% of PnP failures are PnP-specific (parameter binding, missing operations)

Example: Get-PnPList failure chain:

Get-PnPList (PnP cmdlet)
  ↓
PnP.PowerShell calls CSOM ClientContext
  ↓
CSOM client.Load(web.Lists) with lambda expressions
  ↓
Mock server returns response
  ↓
CSOM client can't parse response (PropertyNotInitializedException)
  ↓
Get-PnPList fails with "Property 'Title' has not been initialized"

Workaround:

Use REST API via PowerShell's Invoke-WebRequest instead of PnP cmdlets for affected operations:

# ❌ DON'T: Use PnP cmdlets (may hit CSOM limitations)
Connect-PnPOnline -Url "http://mocksharepoint.local" -CurrentCredentials
Get-PnPList

# ✅ DO: Use REST API with PowerShell
$list = Invoke-RestMethod -Uri "http://mocksharepoint.local/_api/web/lists" `
  -UseDefaultCredentials

Statistics: - Baseline: 51/238 PnP tests (21.4%) pass - CSOM-Dependent Failures: 155-165/187 (85%) - PnP-Specific Failures: 15-25/187 (10-15%) - Fix Status: ❌ CSOM base issues must be fixed first

Documentation: - See: KNOWN_LIMITATIONS.md for PnP compatibility - See: API_REFERENCE.md for REST API documentation


RestSoap/REST API Errors

REST API has excellent compatibility (78.7% baseline, exceeds 74.4% minimum threshold by +17 tests).

Most failures are edge cases or advanced features: - Complex OData filtering - Advanced collection navigation - Rarely-used SOAP operations - Legacy API compatibility layers

For REST API issues, contact project maintainers with: 1. Specific endpoint that fails 2. Request/response headers and body 3. Error message


Error Logging in Mock Server

The mock server categorizes and logs CSOM errors with clear guidance:

Log Message Format

When an error occurs, the mock server logs:

CSOM PropertyNotInitialized error in GetListByTitle (Items collection).
This is a KNOWN LIMITATION due to CSOM protocol constraints.
When using Load() with lambda expressions, CSOM doesn't properly initialize all properties.
Workaround: Use ctx.Load(obj) without lambda expressions instead.
See: _docs/KNOWN_LIMITATIONS.md#csom-load-with-lambda

Log Levels

  • Debug: PnP operation path tracing (CSOM vs REST)
  • Information: General operations and initialization
  • Warning: Known CSOM limitations (PropertyNotInitializedException, Serialization errors)
  • Error: Unexpected failures, implementation bugs

Finding Relevant Logs

# View recent server logs
tail -100 MockData/Logs/Server/cesivi-*.log

# Find CSOM error warnings
grep "CSOM.*error" MockData/Logs/Server/cesivi-*.log

# Find PropertyNotInitializedException
grep "PropertyNotInitialized" MockData/Logs/Server/cesivi-*.log

# Find PnP operation tracing
grep "PnP Cmdlet" MockData/Logs/Server/cesivi-*.log

Summary Table

Error Type Cause Workaround Fixable
PropertyNotInitializedException CSOM protocol limitation Use Load() without lambda ❌ No
Serialization Format Error Undocumented binary format Use REST API ❌ No
DateTime Format Mismatch Format incompatibility Use ISO 8601 format ✅ Possibly
Collection Not Loaded Missing context.Load() call Load before access ✅ Yes (client-side)
Method Not Implemented Feature not in mock Use REST API ✅ Yes (if needed)
PnP Cmdlet Failure Usually CSOM-dependent Use REST API ❌ If CSOM-caused

Getting Help

  1. Check this catalog for your error pattern
  2. Review logs: MockData/Logs/Server/cesivi-*.log
  3. Try the workaround listed in this document
  4. Use REST API as fallback for CSOM issues
  5. Report issues with:
  6. Full error message
  7. Server logs excerpt
  8. Steps to reproduce
  9. Whether workaround helps

Last Updated: 2025-11-15 (S2.657 - Logging & Observability)

This catalog documents architectural constraints (CSOM limitations) and provides workarounds. Rest assured that these are not bugs in the mock server, but rather limitations of the CSOM protocol itself.