Skip to content

Bug Report: Invalid Lock Handle (Status 423) on Windows when Writing/Updating ABAP Objects #92

@meisTJ

Description

@meisTJ

Summary
When attempting to create or update ABAP objects (programs and classes) via the MCP server on Windows, the write operation fails with a status 423 - invalid lock handle error. This issue appears to be Windows-specific as Mac users with the same setup do not experience this problem.

Environment

  • vsp.exe version: v2.32.0 (vsp-windows-amd64.exe)
  • OS: Windows x64
  • Claude: Claude Desktop (Team Standard account)
  • SAP System: S/4 HANA (non-HANA database)
  • SAP Client: 100

Steps to Reproduce

  1. Connect Claude Desktop to SAP S/4 via MCP server using vsp-windows-amd64.exe

  2. Attempt to create a new ABAP program or class with source code e.g.:

    WriteSource(name="Z_TEST", object_type="PROG", mode="create", source="REPORT z_test. WRITE 'Hello'.")

  3. Object shell is created successfully but source write fails

Expected Behaviour
Object should be created and source code written successfully, same as on Mac.

Actual Behaviour
Object shell is created but source write fails with:
Failed to update source: updating source: ADT API error: status 423 at
/sap/bc/adt/programs/programs/Z_TEST/source/main:
Resource INCLUDE Z_TEST is not locked (invalid lock handle: )

Additional Observations

  • The object shell is created but source code is never written
  • Attempting to Lock → EditSource sequence also fails — the LockObject call succeeds but leaves a stale lock in SM12 that prevents subsequent operations
  • The stale lock has to be manually deleted via SM12 each time
  • Workaround found: Creating a completely fresh object with a new name works reliably — the issue only occurs when trying to update/write to an existing object
  • Mac users running vsp-darwin-amd64 or vsp-darwin-arm64 with the same SAP system and config do not experience this issue
  • The files were recently updated (v2.32.0) — possible Windows regression in the latest release

Suspected Cause
The lock handle appears to expire or become invalid between the lock acquisition and the source write step on Windows. This may be related to how Windows handles process timing, threading, or socket connections differently from macOS.

Impact

  • Cannot update existing ABAP objects from Claude on Windows
  • Workaround of always creating new objects is not sustainable for production use
  • Text elements, debugging, and other WebSocket-dependent features are also unavailable (ZADT_VSP not yet installed)

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