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.

app ignores config, queries localhost

See original GitHub issue

Just tried to run the app with docker: docker-compose -f docker-compose.yml -f docker-compose.nodejs.yml exec app yarn mage2vs import

Elasticsearch ERROR: 2018-12-24T12:13:06Z
  Error: Request error, retrying
  POST http://localhost:9200/vue_storefront_catalog_eur/category/2/_update => connect ECONNREFUSED 127.0.0.1:9200
      at Log.error (/var/www/node_modules/elasticsearch/src/lib/log.js:226:56)
      at checkRespForFailure (/var/www/node_modules/elasticsearch/src/lib/transport.js:259:18)
      at HttpConnector.<anonymous> (/var/www/node_modules/elasticsearch/src/lib/connectors/http.js:163:7)
      at ClientRequest.wrapper (/var/www/node_modules/lodash/lodash.js:4935:19)
      at emitOne (events.js:116:13)
      at ClientRequest.emit (events.js:211:7)
      at Socket.socketErrorListener (_http_client.js:401:9)
      at emitOne (events.js:116:13)
      at Socket.emit (events.js:211:7)
      at emitErrorNT (internal/streams/destroy.js:66:8)

However, localhost is not what I have given in my config before I started the app. There’s http://172.24.0.8:9200 in there and I can confirm there’s correct ES on that IP with docker-compose -f docker-compose.yml -f docker-compose.nodejs.yml exec app curl http://172.24.0.8:9200.

I would expect the app to query what was given in config, but that’s not the case. Why?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
janmyszkiercommented, Apr 13, 2019

@lukeromanowicz steps to reproduce fresh git clone of this repo

  1. clone vue-storefront-api repo
  2. spin up external host (DO droplet is fine)
  3. copy default.json to local.json
  4. provide your magento2 keys in config/local.json and change the elasticsearch node to
  "elasticsearch": {
    "host": "IP.OF.DO.DROPLET",
  1. make sure to edit docker-compose to remove references to es1 (also in depends_on nodes in both docker files) so internal ES never launches (makes the connection error easier to spot)
  2. to spin up docker without elasticsearch run
docker-compose -f docker-compose.yml -f docker-compose.nodejs.yml up -d
  1. then run dataimport with
docker-compose -f docker-compose.yml -f docker-compose.nodejs.yml exec app yarn mage2vs import

see how you get:

== CREATING NEW DATABASE ==
Elasticsearch INFO: 2019-04-13T20:35:32Z
  Adding connection to http://elasticsearch:9200/


** Hello! I am going to create NEW ES index

Elasticsearch DEBUG: 2019-04-13T20:35:32Z
  starting request {
    "method": "DELETE",
    "path": "/*/_alias/vue_storefront_catalog",
    "query": {}
  }
  


Elasticsearch ERROR: 2019-04-13T20:35:32Z
  Error: Request error, retrying
  DELETE http://elasticsearch:9200/*/_alias/vue_storefront_catalog => getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200
      at Log.error (/var/www/node_modules/elasticsearch/src/lib/log.js:226:56)
      at checkRespForFailure (/var/www/node_modules/elasticsearch/src/lib/transport.js:259:18)
      at HttpConnector.<anonymous> (/var/www/node_modules/elasticsearch/src/lib/connectors/http.js:163:7)
      at ClientRequest.wrapper (/var/www/node_modules/lodash/lodash.js:4935:19)
      at emitOne (events.js:116:13)
      at ClientRequest.emit (events.js:211:7)
      at Socket.socketErrorListener (_http_client.js:401:9)
      at emitOne (events.js:116:13)
      at Socket.emit (events.js:211:7)
      at emitErrorNT (internal/streams/destroy.js:66:8)

It tried to query named host elasticsearch completely ignoring the host config node.

1reaction
cmcmannuscommented, Jul 30, 2020

@janmyszkier that was exactly it. Sorry I forgot to update the thread saying I’d figured it out, but thanks for following up!

Read more comments on GitHub >

github_iconTop Results From Across the Web

app ignores config, queries localhost · Issue #163 - GitHub
Just tried to run the app with docker: docker-compose -f docker-compose.yml -f ... app ignores config, queries localhost #163.
Read more >
How to Ignore localhost on Azure application insights
I added the following lines of code in my FilterConfig.cs: #if !RELEASE TelemetryConfiguration.Active.DisableTelemetry = true; #endif Anastasia, ...
Read more >
Was "Urls" in appsettings.json ignored in ASP.NET Core 6.0?
In ASP.NET Core 6.0, is it no longer possible to override the Kestrel URL in appsettings.json > "Urls" as it was up to...
Read more >
Configuration | StackHawk Docs
Allowed URL's include hostnames, IP:PORT, and localhost -- paths (such as https://domain.com/api/v2) can be scanned but cannot be set as the app.host value....
Read more >
Configure Hosting behavior | Firebase Hosting - Google
You define your Firebase Hosting configuration in your firebase.json file. ... The ignore attribute specifies the files to ignore on deploy.
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