1

While running npm run dev then after I am getting errors like

    [search] Can not connect the vue-storefront-api / ElasticSearch instance! Error: FetchError in request to ES: FetchError: request to http://localhost:8080/api/catalog/vue_storefront_catalog/attribute/_search?_source_include=activity%2Cattribute_code%2Cattribute_id%2Cdefault_frontend_label%2Cdefault_value%2Centity_type_id%2Cfrontend_input%2Cfrontend_label%2Cid%2Cis_user_defined%2Cis_visible_on_front%2Cis_visible%2Cis_comparable%2Coptions%2Ctier_prices&from=0&request=%7B%22query%22%3A%7B%22bool%22%3A%7B%22filter%22%3A%7B%22terms%22%3A%7B%22attribute_code%22%3A%5B%22color%22%2C%22erin_recommends%22%2C%22price%22%2C%22size%22%2C%22activity%22%2C%22final_price%22%2C%22id%22%2C%22image%22%2C%22name%22%2C%22new%22%2C%22original_price%22%2C%22original_price_incl_tax%22%2C%22price_incl_tax%22%2C%22product_links%22%2C%22sale%22%2C%22sku%22%2C%22special_price%22%2C%22special_price_incl_tax%22%2C%22special_from_date%22%2C%22special_to_date%22%2C%22status%22%2C%22tax_class_id%22%2C%22tier_prices%22%2C%22type_id%22%2C%22url_path%22%2C%22url_key%22%5D%7D%7D%7D%7D%7D&size=150&sort= failed, reason: connect ECONNREFUSED 127.0.0.1:8080
    at vsf-search-adapter-api-searchAdapter.server-bundle.js:155:39
    at processTicksAndRejections (internal/process/task_queues.js:88:5)
(node:11095) UnhandledPromiseRejectionWarning: Error: FetchError in request to ES: FetchError: request to http://localhost:8080/api/catalog/vue_storefront_catalog/attribute/_search?_source_include=activity%2Cattribute_code%2Cattribute_id%2Cdefault_frontend_label%2Cdefault_value%2Centity_type_id%2Cfrontend_input%2Cfrontend_label%2Cid%2Cis_user_defined%2Cis_visible_on_front%2Cis_visible%2Cis_comparable%2Coptions%2Ctier_prices&from=0&request=%7B%22query%22%3A%7B%22bool%22%3A%7B%22filter%22%3A%7B%22terms%22%3A%7B%22attribute_code%22%3A%5B%22color%22%2C%22erin_recommends%22%2C%22price%22%2C%22size%22%2C%22activity%22%2C%22final_price%22%2C%22id%22%2C%22image%22%2C%22name%22%2C%22new%22%2C%22original_price%22%2C%22original_price_incl_tax%22%2C%22price_incl_tax%22%2C%22product_links%22%2C%22sale%22%2C%22sku%22%2C%22special_price%22%2C%22special_price_incl_tax%22%2C%22special_from_date%22%2C%22special_to_date%22%2C%22status%22%2C%22tax_class_id%22%2C%22tier_prices%22%2C%22type_id%22%2C%22url_path%22%2C%22url_key%22%5D%7D%7D%7D%7D%7D&size=150&sort= failed, reason: connect ECONNREFUSED 127.0.0.1:8080
(node:11095) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2646)

Does anyone have any idea how can I fix it?

1 Answer 1

1

It is possible you are running old elastic-search version in vuestorefront-api . generally vue-storefront-api provide two elasticsearch version based configuration. you can choose your compatible elatic-search version in docker-compose.yml file. just replace this configuration

**es1:**
    container_name: elasticsearch
    build: **docker/elasticsearch/**
    ulimits:
      memlock:
        soft: -1
        hard: -1    
    volumes:
      - **./docker/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro**
    ports:
      - '9200:9200'
      - '9300:9300'
    environment:
      - discovery.type=single-node
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xmx512m -Xms512m"

  kibana:
    build: docker/kibana/
    volumes:
      - ./docker/kibana/config/:/usr/share/kibana/config:ro
    ports:
      - '5601:5601'
    depends_on:
      - **es1**

with latest elastic search version

es7:
    container_name: elasticsearch
    build: docker/elasticsearch7/
    ulimits:
      memlock:
        soft: -1
        hard: -1    
    volumes:
      - ./docker/elasticsearch7/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
    ports:
      - '9200:9200'
      - '9300:9300'
    environment:
      - discovery.type=single-node
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xmx512m -Xms512m"

  kibana:
    build: docker/kibana/
    volumes:
      - ./docker/kibana/config/:/usr/share/kibana/config:ro
    ports:
      - '5601:5601'
    depends_on:
      - es7

i hope this will solve your problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.