Unable to stream models to ElasticSearch
See original GitHub issueWhat is the current behavior?
When I create a mutation, the lambda
function that streams dynamodb
model
s to elasticsearch
fails and logs Unable to import module 'python_streaming_function': cannot import name 'BotocoreHTTPSession'
.
I haven’t edited any of the code as it is automatically generated by the GraphQL Transform
What is the expected behavior?
I should be able to search my models in AWS elasticsearch
Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions?
"aws-amplify": "^1.1.40",
"aws-amplify-react-native": "^2.1.19",
"aws-appsync": "^2.0.0",
"aws-appsync-react": "^2.0.0",
"react": "^16.9.0",
"react-apollo": "2.5.8",
"react-native": "^0.60.5",
aws-cli/1.16.243 Python/3.6.0 Windows/10 botocore/1.12.233
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:23 (6 by maintainers)
Top Results From Across the Web
Troubleshooting searches | Elasticsearch Guide [8.5] | Elastic
Ensure the data stream, index, or alias existsedit · Ensure the data stream or index contains dataedit · Check that the field exists...
Read more >Use a data stream | Elasticsearch Guide [8.5] | Elastic
Open closed backing indicesedit. You cannot search a closed backing index, even by searching its data stream. You also cannot update or delete...
Read more >Set up a data stream | Elasticsearch Guide [8.5] | Elastic
A data stream requires a matching index template. In most cases, you compose this index template using one or more component templates. You...
Read more >Fix common cluster issues | Elasticsearch Guide [8.5] | Elastic
This error indicates a data node is critically low on disk space and has reached the flood-stage disk usage watermark. Circuit breaker errors:...
Read more >Troubleshooting discovery | Elasticsearch Guide [8.5] | Elastic
If the cluster has no elected master node for more than a few seconds, the master is unstable, or some nodes are unable...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
+1 We have started seeing this issue in an extremely similar timeframe.
Has the version of Botocore made available to AWS Lambda changed? Alternatively, have the amplify team made any changes to the underlying zipfile housing this Streaming code?
Please treat this as a high severity issue. As Amplify does not offer a way to “refresh” entries in ES, the only remedy to missing ES records at them moment is a full table rewrite.
@usmansbk We dug into the issue and after talking to the Lambda team, we understood the reason for the change and errors. We’re working on a fix in the CLI that will enable you to re-deploy your function as a part of the ampliy push command to avoid seeing the Lambda errors. For the time being, here’s an explanation and the workaround provided by the Lambda team to prevent your app from seeing errors:
AWS Lambda is updating the default boto3 and botocore SDKs for the Python 2.7, Python 3.6 and Python 3.7 runtimes. This update changes the version of boto3 from 1.7.74 to 1.9.221 for the Python 2.7 and Python 3.6 runtimes and from 1.9.42 to 1.9.221 for the Python 3.7 runtime. The update contains SDK enhancements and updated APIs. One notable example of an internal class that underwent change is the BotocoreHTTPSessions class which is no longer supported starting with botocore version 1.11.0.
Since the CLI used the
BotocoreHTTPSessions class
, that’s the reason why you’re seeing these errors.As a workaround, you can update your
DdbToEsFn-xxxxxx
function in the AWS Console to use a Lambda layer that contains the previous version of the SDK. For your convenience, the AWS Lambda team already published these layers for you to use. You can find additional information on Lambda layers out here - https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.htmlHere are the list of lambda layer ARN’s which you can use based on the region you are in:_