Code Monkey home page Code Monkey logo

Comments (2)

printscreen avatar printscreen commented on June 14, 2024

Did you ever find the solution to this problem? I am having the same problem.

from http-aws-es.

printscreen avatar printscreen commented on June 14, 2024

So this may not apply to other people, but I did find the issue for me.
I wrote https://www.npmjs.com/package/elasticulize-cli

I was trying to work with an AWS ECS Container to automatically run a migration. Up till this point I have only ever used it locally with docker-compose.

I ran into your issue where I would get the following error.

(node:776) UnhandledPromiseRejectionWarning: TypeError: Invalid host
    at HttpAmazonESConnector.ConnectionAbstract (/usr/local/lib/node_modules/elasticsearch/src/lib/connection.js:27:11)
    at new HttpConnector (/usr/local/lib/node_modules/elasticsearch/src/lib/connectors/http.js:32:22)
    at new HttpAmazonESConnector (/usr/local/lib/node_modules/http-aws-es/connector.js:20:5)
    at ConnectionPool.setHosts (/usr/local/lib/node_modules/elasticulize-cli/node_modules/elasticsearch/src/lib/connection_pool.js:320:20)
    at Transport.setHosts (/usr/local/lib/node_modules/elasticulize-cli/node_modules/elasticsearch/src/lib/transport.js:451:23)
    at new Transport (/usr/local/lib/node_modules/elasticulize-cli/node_modules/elasticsearch/src/lib/transport.js:68:10)
    at new EsApiClient (/usr/local/lib/node_modules/elasticulize-cli/node_modules/elasticsearch/src/lib/client.js:58:22)
    at new Client (/usr/local/lib/node_modules/elasticulize-cli/node_modules/elasticsearch/src/lib/client.js:101:10)
    at Promise (/usr/local/lib/node_modules/elasticulize-cli/lib/commands.js:40:16)
    at <anonymous>

If you look at line 27, the check of host instanceOf Host was failing. After some debugging, i could clearly prove the host was an instanceOf Host.

My fix was just toying with it and I found the fix. Up till this point, http-aws-es was installed on the container globally. That was the issue. Once i installed it locally to /usr/local/lib/node_modules/elasticulize/node_modules it worked.

I dont know why, but there is something weird going on when http-aws-es is not installed to the local node_modules folder.

from http-aws-es.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.