Search Troubleshooting
This page covers issues encountered when using the VamsCLI search commands against the Amazon OpenSearch Service dual-index search system.
Search Availability
Search Commands Report That Search Is Disabled
Symptoms:
vamscli search assets,search files,search simple, orsearch mappingfails with "Search functionality is disabled for this environment"- The error suggests using
vamscli assets listinstead
Cause:
The NOOPENSEARCH feature switch is enabled in the deployment, so Amazon OpenSearch Service is not provisioned. All search subcommands check this feature switch before issuing a request and stop early when it is set.
Resolution:
-
Confirm the feature state:
vamscli features listA
NOOPENSEARCHentry in the enabled features confirms search is unavailable. -
Use the non-search listing commands, which do not depend on Amazon OpenSearch Service:
vamscli assets listvamscli database list-assets -d my-database -
To enable full-text and metadata search, ask your VAMS administrator to provision Amazon OpenSearch Service for the deployment.
Search Service Is Unavailable or the Endpoint Is Missing
Symptoms:
- "Search service unavailable" errors when the deployment otherwise has search enabled
- "Search endpoint not found" against an older deployment
Cause:
The Amazon OpenSearch Service domain is temporarily unreachable, or the deployment predates the dual-index search API.
Resolution:
- Retry after a short delay, or confirm domain health with your administrator.
- Verify the deployment version with
vamscli version. The dual-index search system requires VAMS 2.2 or later. - Fall back to
vamscli assets listorvamscli database list-assets -d <database-id>while the service is recovering.
Authentication and Setup
Profile Is Not Configured or Authentication Has Expired
Symptoms:
- "Configuration not found for profile" before any search runs
- "Authentication failed" or repeated 401 responses
Cause:
The active profile has not been initialized with setup, or the stored token is expired or invalid.
Resolution:
-
Configure and authenticate the profile:
vamscli setup <api-gateway-url> --profile <profile-name>vamscli auth login -u <username> --profile <profile-name> -
Check the current session:
vamscli auth status
For external (non-Cognito) authentication, supply a token directly with vamscli auth set-override --token <jwt>. Override tokens are not auto-refreshed, so an expired override token fails immediately and must be replaced.
Search Parameters
Invalid Entity Types in Simple Search
Symptoms:
vamscli search simple --entity-types <value>fails with "Invalid entity types"
Cause:
The --entity-types option accepts only asset and file (comma-separated). Any other value is rejected during parsing.
Resolution:
vamscli search simple -q "model" --entity-types asset
vamscli search simple -q "texture" --entity-types file
vamscli search simple -q "content" --entity-types asset,file
The search assets and search files commands set the entity type automatically and do not accept --entity-types.
Metadata Query or Metadata Mode Is Rejected
Symptoms:
- No results, or an invalid-parameter error, when using
--metadata-query - An error when passing an unexpected value to
--metadata-mode
Cause:
Metadata queries use field:value syntax with uppercase AND/OR operators, and --metadata-mode accepts only key, value, or both (default both).
Resolution:
# field:value syntax with the MD_ prefix
vamscli search assets --metadata-query "MD_str_product:Training"
# Combine conditions with uppercase AND / OR
vamscli search assets --metadata-query "MD_str_product:A AND MD_num_version:1"
# Wildcards belong in the value portion
vamscli search assets --metadata-query "MD_str_product:Train*"
# Valid metadata modes: key, value, both
vamscli search assets --metadata-query "product" --metadata-mode key
vamscli search assets --metadata-query "Training" --metadata-mode value
Run vamscli search mapping to list the searchable fields per index. It returns the live index mapping, so metadata appears as the single flat_object field MD_ (and file attributes as AB_) rather than as one field per key — the keys themselves are inside those objects and are not part of the mapping. A --metadata-query key may be written bare (product), with the entity prefix (MD_product), or with a type prefix (MD_str_product).
Invalid JSON in an Input File
Symptoms:
- "Invalid JSON in input file" or "JSON input file not found" when a search reads parameters from a file
Cause:
The referenced file is missing, or its contents are not valid JSON (often a trailing comma or unquoted key).
Resolution:
Validate the file before reusing it:
python -m json.tool search_params.json
{
"query": "test",
"database": "my-db"
}
Filters
Filter String Fails to Parse
Symptoms:
- "Invalid JSON filter format" or "JSON filters must be an array" from the
--filtersoption
Cause:
The --filters option accepts two formats: a JSON array of OpenSearch clauses, or a query-string expression. A JSON object (not wrapped in an array) and malformed JSON are both rejected.
Resolution:
# Query-string format (simplest)
vamscli search assets --filters 'str_databaseid:"my-db"'
# JSON array format — note the surrounding brackets
vamscli search assets --filters '[{"query_string": {"query": "str_databaseid:\"my-db\""}}]'
A bare JSON object such as '{"query_string": {"query": "test"}}' is invalid; wrap it in [ ... ] or use the query-string form.
Filter Returns Unexpected Results
Symptoms:
- A filter that looks correct returns no results, or matches more than intended
Cause:
Query-string values must be quoted, field names must exist in the target index, and exact-match comparisons can be case-sensitive.
Resolution:
-
Quote values and combine clauses with uppercase
AND/OR:vamscli search assets --filters 'str_databaseid:"my-db" AND str_assettype:"3d-model"' -
Confirm field names against the mapping, and test clauses individually before combining them:
vamscli search mappingvamscli search assets --filters 'str_databaseid:"my-db"' -
For case-insensitive matching, use wildcards in the value:
vamscli search assets --metadata-query "MD_str_product:*training*"
Results and Output
No Results Found
Symptoms:
- A search that should match returns zero hits
Cause:
The query is too narrow, the items are archived, the wrong entity command is in use, or recent uploads have not finished indexing.
Resolution:
-
Broaden the query, then confirm the searchable fields:
vamscli search assets -q "model"vamscli search mapping -
Include archived items when relevant:
vamscli search assets -q "model" --include-archived -
Try the matching entity command — file attributes such as
--file-extapply tosearch files, notsearch assets:vamscli search files --filters 'str_fileext:"gltf"'
Amazon OpenSearch Service indexing is asynchronous. After a large upload or bulk metadata change, allow 30-60 seconds for newly indexed items to appear in search results.
Metadata Missing From or Unexpectedly Present in General Search
Symptoms:
- Metadata terms are expected in a general
-qsearch but do not match, or metadata noise appears when it is not wanted
Cause:
General search includes metadata fields by default. The --include-metadata/--no-metadata toggle controls this behavior.
Resolution:
# Default — metadata included in the general query
vamscli search assets -q "Training"
# Exclude metadata from the general query
vamscli search assets -q "Training" --no-metadata
Match Explanations Do Not Appear
Symptoms:
--explain-resultsis set but no explanation text is shown
Cause:
Explanations are derived from field matches and only appear alongside search hits. A query with no hits, or matches on fields without highlightable content, produces little or no explanation.
Resolution:
vamscli search assets -q "model" --explain-results
vamscli search assets -q "model" --explain-results --output-format json
Confirm the query returns hits first; explanations accompany the results rather than appearing on an empty result set.
Sorting and the Dual-Index Layout
Sort or Field Reference Targets the Wrong Index
Symptoms:
- Sorting by a field has no effect, or a field referenced in a filter is not found
vamscli search mappingshows two distinct sets of fields
Cause:
The dual-index system maintains separate mappings for assets and files. Each command searches its own index, so asset-only fields are not present in the file index and the reverse. Two field sets in the mapping output is expected.
Resolution:
Use fields that belong to the index being searched:
# Asset index fields
vamscli search assets --sort-field str_assetname
# File index fields
vamscli search files --sort-field str_key
Run vamscli search mapping --output-format json to see which fields belong to each index.
Performance
Searches Are Slow or Return Very Large Result Sets
Symptoms:
- Queries take a long time or exhaust memory when formatting output
Cause:
Overly broad queries (for example, -q "*"), broad metadata-mode searches, wide wildcards, and large page sizes all increase load. The --size maximum is 2000 for search assets/search files and 1000 for search simple.
Resolution:
-
Narrow the query with filters and a specific database:
vamscli search assets -q "model" --filters 'str_databaseid:"my-db" AND str_assettype:"3d-model"' -
Prefer specific metadata modes and exact matches over
bothwith broad wildcards:vamscli search assets --metadata-query "MD_str_product:Training" --metadata-mode value -
Page through large result sets and export with CSV, which is more memory-efficient than table formatting:
vamscli search assets -q "model" --from 0 --size 1000 --output-format csv > batch1.csvvamscli search assets -q "model" --from 1000 --size 1000 --output-format csv > batch2.csv
Diagnostics
For detailed request and response information, run the CLI with the global --verbose flag before the command group:
vamscli --verbose search assets -q "test"
Verbose mode reports the full API request and response, timing, and detailed error information, which helps distinguish parameter problems from service-side errors.