Skip to content

export-dd crashes with "Missing required property 'FieldValue.<variant value>'" under opensearch-java 3.x #83

Description

@jordanpadams

Checked for duplicates

Yes - I've already checked

🐛 Describe the bug

Running registry-manager export-dd (or any command using DataExporter) fails immediately with:

[ERROR] Missing required property 'FieldValue.<variant value>'

This is thrown by MissingRequiredPropertyException in opensearch-java 3.x when FieldValue.Builder.stringValue(null) is called. The crash occurs because DataExporter.export() initializes searchAfter = null and passes it directly to SearchImpl.all(), which unconditionally constructs a FieldValue from that null value.

The ES (non-AWS) SearchImpl implementation already guards against this with if (searchAfter != null) in RegistryRequestBuilder. The AWS SearchImpl was missing the same guard, making it incompatible with opensearch-java 3.x.

Root Cause

In registry-common: SearchImpl.all() (AWS connection):

// Before fix — crashes when searchAfter is null under opensearch-java 3.x
this.craftsman.searchAfter(Arrays.asList(new FieldValue.Builder().stringValue(searchAfter).build()));

Fix

Skip the searchAfter call when the value is null, matching the existing ES implementation behaviour:

if (searchAfter != null) {
    this.craftsman.searchAfter(Arrays.asList(new FieldValue.Builder().stringValue(searchAfter).build()));
}

🕵️ Expected behavior

registry-manager export-dd should execute without error and export documents from the -dd index.

📜 To Reproduce

  1. Build registry-mgr against registry-common using opensearch-java 3.x
  2. Run: registry-manager export-dd -registry file:///path/to/registry-config.xml -auth /path/to/auth.txt -file /tmp/out.json
  3. Observe: [ERROR] Missing required property 'FieldValue.<variant value>'

🖥 Environment Info

  • Version of this software: 6.2.2-SNAPSHOT
  • Operating System: macOS
  • OpenSearch Java client: 3.x (registry-common 2.5.4-SNAPSHOT)

📚 Version of Software Used

  • registry-mgr 6.2.2-SNAPSHOT
  • registry-common 2.5.4-SNAPSHOT

🩺 Test Data / Additional context

  • Affects all DataExporter-based commands: export-dd, export-data
  • The list-dd command is not affected (uses a different code path)
  • The non-AWS (ES direct) connection is not affected

🦄 Related requirements

N/A


For Internal Dev Team To Complete

⚙️ Engineering Details

Fix is in registry-common: src/main/java/gov/nasa/pds/registry/common/connection/aws/SearchImpl.java — add null guard in all(String sortField, int size, String searchAfter) before calling craftsman.searchAfter().

🎉 Integration & Test

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

Labels

B18bugSomething isn't workingiceboxs.lowLow level severity

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions