question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@searchable throws Elasticsearch:User IllegalArgumentException

See original GitHub issue

Describe the bug

I’m using AWS AppSync with @searchable and I did search* query. All of which will throw Elasticsearch:User IllegalArgumentException when the resource was only instantiated for the first time, i.e., I just created and I haven’t done any other mutations to it (create), so the tables are currently empty.

sample query

query {
  searchUsers {
    items {
      id
    }
    nexToken
  }
}

To Reproduce Steps to reproduce the behavior:

  1. Create a resource with AWS AppSync using GraphQL.
  2. Use @searchable with it.
  3. On AppSync GraphQL UI, try to use search* query.

Expected behavior

Instead of throwing that error, it should return items: [] which is what it normally does. (After applying the workaround specified at the bottom of this document).

Screenshots

image

Desktop (please complete the following information):

The error is not specific to any platform. You can use the AWS AppSync GraphQL UI and still be able to replicate the error.

Smartphone (please complete the following information):

The error is not specific to any device. You can use the AWS AppSync GraphQL UI and still be able to replicate the error.

Additional context

As a workaround. You can insert data to the tables first, then you can remove those data. The next time you query that table with search you’ll get the desirable response:

data: {
  searchTable: {
    items: [],
    nextToken: null
  }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
attilahcommented, Nov 6, 2019

@aprilmintacpineda I was able to reproduce this issue thanks for reporting.

1reaction
aprilmintacpinedacommented, Feb 4, 2020

Hi @attilah,

Sorry for the delay on feedback. I just had the chance to get back to the project assigned to me that was using this. So here’s the scenario:

The project I have that’s experiencing this already have an existing UAT environment setup, I just checked it out and it’s still experiencing the error. It was previously using @aws-amplify/cli@3.17.0 but I have just upgraded it to 4.13.1 and the error still occurs. Is there any prerequisites for me to get the fix? or will it just be applied the next time I create a new environment?

I still have to touch the dynamo db to allow the searchable to create the indices. And I have to do that for each of the model with @searchable flag on it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Elastic search illegal argument exception - java - Stack Overflow
The error message suggests that you are trying to map the same field name two different ways (in different document types) in the...
Read more >
elasticsearch: docs/reference/index.x.asciidoc | Fossies
When a document is stored, it is indexed and fully searchable in near real-time—​within 1 ... Become the elasticsearch user in order to...
Read more >
Elasticsearch and the IllegalArgumentException (docID must ...
This search will return any and all documents in your index that have a negative value. This will help identify problem documents, and...
Read more >
Creating Users and Assigning Roles in Elasticsearch
To create users and assign roles to users, use the elasticsearchuser script available in ES_HOME/bin. You can use the script for the following...
Read more >
Elasticsearch IllegalArgumentException - Elastic Discuss
... to parse [time]]; nested: IllegalArgumentException[Invalid format: ... curl 'http://elastic.local:9200/assets.access/_search' -d ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found