Skip to content

URGENT: create_nil_db_user_client fails due to server/SDK incompatibility - missing required fields #267

@codingtogetherforever

Description

@codingtogetherforever

Problem

When attempting to initialize NilDbUserClient using create_nil_db_user_client, getting validation errors due to missing required fields in the server response:

pydantic_core._pydantic_core.ValidationError: 2 validation errors for ReadAboutNodeResponse
public_key
  Field required [type=missing, input_value={'started': '2025-06-12T0...b-nx8v.nillion.network'}, input_type=dict]
maintenance
  Field required [type=missing, input_value={'started': '2025-06-12T0...b-nx8v.nillion.network'}, input_type=dict]

Code That Triggers the Error

import asyncio
from secretvaults.user import create_nil_db_user_client
from nildb_config import NILDB_NODES

async def create_client():
    clients = []
    for node in NILDB_NODES.values():
        # This line fails with validation error
        client = await create_nil_db_user_client(node['url'])
        clients.append(client)
    return clients

asyncio.run(create_client())

Root Cause

The create_nil_db_user_client function calls the /about endpoint and expects the response to validate against ReadAboutNodeResponse, but the server response is missing required fields:

  • public_key
  • maintenance

The server response only contains:

{
  "started": "2025-06-12T...",
  "build": {...},
  "did": "...",
  "url": "https://nildb-nx8v.nillion.network"
}

But the SDK expects:

{
  "started": "...",
  "build": {...}, 
  "did": "...",
  "url": "...",
  "public_key": "...",  // Missing
  "maintenance": "..."  // Missing
}

Expected Solution

  1. Option 1: Update the server to include the missing fields in the /about endpoint response
  2. Option 2: Update the SDK to make these fields optional in ReadAboutNodeResponse
  3. Option 3: Provide alternative initialization method that doesn't require the /about endpoint

Environment

  • Python 3.12
  • secretvaults SDK (latest)
  • Ubuntu
  • Node URL: https://nildb-nx8v.nillion.network
  • User: codingtogetherforever
  • Date: 2025-07-24 18:29:05 UTC

Impact

This prevents users from being able to initialize nilDB clients using the documented approach with create_nil_db_user_client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions