rss-lambda icon indicating copy to clipboard operation
rss-lambda copied to clipboard

[ERROR] AlgoliaUnreachableHostException: Unreachable hosts

Open bazooka720 opened this issue 4 years ago • 5 comments

I tried running this and keep getting this / similar error notes. Thoughts?

Traceback (most recent call last):  File "/opt/python/aws_lambda_powertools/logging/logger.py", line 347, in decorate    return lambda_handler(event, context)  File "/opt/python/aws_lambda_powertools/tracing/tracer.py", line 314, in decorate    response = lambda_handler(event, context, **kwargs)  File "/var/task/getfeed.py", line 493, in handler    blogupdate, newblogs = get_feed(url, blogsource, guids, table, event)  File "/opt/python/aws_lambda_powertools/tracing/tracer.py", line 631, in decorate    response = method(*args, **kwargs)  File "/var/task/getfeed.py", line 251, in get_feed    put_dynamo(timest_post, title, cleantxt, rawhtml, description, link, blogsource, author, guid, tags, category, datestr_post, table, event)  File "/opt/python/aws_lambda_powertools/tracing/tracer.py", line 631, in decorate    response = method(*args, **kwargs)  File "/var/task/getfeed.py", line 85, in put_dynamo    index.save_objects([smallitem])  File "/opt/python/algoliasearch/search_index.py", line 72, in save_objects    response = self._chunk("updateObject", objects, request_options)  File "/opt/python/algoliasearch/search_index.py", line 527, in _chunk    raw_responses.append(self._raw_batch(requests, request_options))  File "/opt/python/algoliasearch/search_index.py", line 534, in _raw_batch    return self._transporter.write(  File "/opt/python/algoliasearch/http/transporter.py", line 35, in write    return self.request(verb, hosts, path, data, request_options, timeout)  File "/opt/python/algoliasearch/http/transporter.py", line 72, in request    return self.retry(hosts, request, relative_url)  File "/opt/python/algoliasearch/http/transporter.py", line 94, in retry    raise

bazooka720 avatar Nov 23 '21 01:11 bazooka720

Hey @bazooka720 ,

What is in your samconfig.toml file? I added a few additional options you can configure with the SAM CLI, where most options can be disabled without issue.

I cannot tell what's going wrong based on the error, but is i.e. EnableAlgolia set to "n" in your config? It seems to try and reach that service, which is likely an add-on you don't need.

marekq avatar Nov 23 '21 10:11 marekq

@marekq version = 0.1 [default] [default.deploy] [default.deploy.parameters] stack_name = "rss-app" s3_bucket = "aws-sam-cli-managed-default-samclisourcebucket-XXXXXXXX" s3_prefix = "rss-app" region = "ca-central-1" confirm_changeset = true capabilities = "CAPABILITY_IAM" parameter_overrides = "SourceEmail="My emaill" DestEmail="<My email>" SendEmails="n" StorePublicS3="n" CreateAppSync="y" EnableAlgolia="y" AlgoliaApp="rssapp" AlgoliaApikey="XXXX" AlgoliaIndex=""" image_repositories = []

bazooka720 avatar Nov 23 '21 15:11 bazooka720

@marekq only thing is that i did add Algolia index name directly in the cloudformation stack parameters (just remembered)

bazooka720 avatar Nov 23 '21 15:11 bazooka720

what does enable algolia do @marekq

bazooka720 avatar Nov 23 '21 17:11 bazooka720

I extended the stack with many options that I use in "production", but others may not need. Algolia is an online search service that allows me to index and search through all the various blog posts. It's a managed service from a startup that allows me to offer a simple search option without having to maintain this myself. If AWS had an equivalent service I'd integrate that, but they don't.

What you could best try is to deploy the stack with the features disabled and no entries set. I didn't extensively test this part of enabling/disabling features, but happy to fix anything. I may remove or change this part long term too, since I'm probably the only one using Algolia, the email service etc. It's making this project harder to adopt for people like you.

marekq avatar Nov 25 '21 19:11 marekq