Skip to content

Vue storefront problem when connecting to server - Elasticsearch Error #4275

@ArjanStudent

Description

@ArjanStudent

I have installed vue storefront following all the documentation given on the docs ( and migrated my magento 2 project ) , the migration was succesful according to the logs but when I try to the vue storefront app ( localhost:3000 ) I get following error in the logs :

[search] Can not connect the vue-storefront-api / ElasticSearch instance! Error: {"code":500,"result":{"diagnosticText":"src/processor/default.ts(25,48): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'string | Query | (string | Query)[] | ((searchString: string, position?: number) => number) | ((searchElement: string | Query, fromIndex?: number) => number)' has no compatible call signatures.\n","diagnosticCodes":[2349]}}
    at SearchAdapter.exports.modules../core/lib/search/adapter/api/searchAdapter.ts.SearchAdapter.handleResult (vsf-search-adapter-0.server-bundle.js:547:23)
    at Object.resultProcessor (vsf-search-adapter-0.server-bundle.js:582:30)
    at server-bundle.js:3188:92
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

When I try to launch vue storefront on legacy mode ( yarn dev ) I get following error :

(node:4545) 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%2Cid%2Centity_type_id%2Coptions%2Cdefault_value%2Cis_user_defined%2Cfrontend_label%2Cattribute_id%2Cdefault_frontend_label%2Cis_visible_on_front%2Cis_visible%2Cis_comparable%2Ctier_prices%2Cfrontend_input&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%22size%22%2C%22price%22%2C%22erin_recommends%22%2C%22activity%22%2C%22type_id%22%2C%22sku%22%2C%22name%22%2C%22tax_class_id%22%2C%22final_price%22%2C%22special_price%22%2C%22special_to_date%22%2C%22special_from_date%22%2C%22price_incl_tax%22%2C%22original_price_incl_tax%22%2C%22original_price%22%2C%22special_price_incl_tax%22%2C%22id%22%2C%22image%22%2C%22sale%22%2C%22new%22%2C%22product_links%22%2C%22url_path%22%2C%22url_key%22%2C%22status%22%2C%22tier_prices%22%5D%7D%7D%7D%7D%7D&size=150&sort= failed,
 reason: socket hang up

On the api i get following error when I try to connect to the local vue storefront server :

$GET /api/catalog/vue_storefront_catalog/attribute/_search?_source_include=activity%2Cattribute_code%2Cid%2Centity_type_id%2Coptions%2Cdefault_value%2Cis_user_defined%2Cfrontend_label%2Cattribute_id%2Cdefault_frontend_label%2Cis_visible_on_front%2Cis_visible%2Cis_comparable%2Ctier_prices%2Cfrontend_input&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%22size%22%2C%22price%22%2C%22erin_recommends%22%2C%22activity%22%2C%22type_id%22%2C%22sku%22%2C%22name%22%2C%22tax_class_id%22%2C%22final_price%22%2C%22special_price%22%2C%22special_to_date%22%2C%22special_from_date%22%2C%22price_incl_tax%22%2C%22original_price_incl_tax%22%2C%22original_price%22%2C%22special_price_incl_tax%22%2C%22id%22%2C%22image%22%2C%22sale%22%2C%22new%22%2C%22product_links%22%2C%22url_path%22%2C%22url_key%22%2C%22status%22%2C%22tier_prices%22%5D%7D%7D%7D%7D%7D&size=150&sort= - 521.628 ms - -
(node:4444) UnhandledPromiseRejectionWarning: RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: ECONNREFUSED
    at ServerResponse.writeHead (_http_server.js:248:11)
    at ServerResponse.writeHead (/home/awest/Documents/Stage/Vue/vue-storefront-api/node_modules/on-headers/index.js:44:26)
    at ServerResponse._implicitHeader (_http_server.js:239:8)
    at write_ (_http_outgoing.js:650:9)
    at ServerResponse.end (_http_outgoing.js:760:5)
    at ServerResponse.send (/home/awest/Documents/Stage/Vue/vue-storefront-api/node_modules/express/lib/response.js:221:10)
    at ServerResponse.json (/home/awest/Documents/Stage/Vue/vue-storefront-api/node_modules/express/lib/response.js:267:15)
    at apiStatus (/home/awest/Documents/Stage/Vue/vue-storefront-api/src/lib/util.js:77:20)
    at Object.apiError (/home/awest/Documents/Stage/Vue/vue-storefront-api/src/lib/util.js:89:10)
    at /home/awest/Documents/Stage/Vue/vue-storefront-api/src/api/catalog.js:92:9
(node:4444) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:4444) UnhandledPromiseRejectionWarning: RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: ECONNREFUSED
    at ServerResponse.writeHead (_http_server.js:248:11)
    at ServerResponse.writeHead (/home/awest/Documents/Stage/Vue/vue-storefront-api/node_modules/on-headers/index.js:44:26)
    at ServerResponse._implicitHeader (_http_server.js:239:8)
    at write_ (_http_outgoing.js:650:9)
    at ServerResponse.end (_http_outgoing.js:760:5)
    at ServerResponse.send (/home/awest/Documents/Stage/Vue/vue-storefront-api/node_modules/express/lib/response.js:221:10)
    at ServerResponse.json (/home/awest/Documents/Stage/Vue/vue-storefront-api/node_modules/express/lib/response.js:267:15)
    at apiStatus (/home/awest/Documents/Stage/Vue/vue-storefront-api/src/lib/util.js:77:20)
    at Object.apiError (/home/awest/Documents/Stage/Vue/vue-storefront-api/src/lib/util.js:89:10)
    at /home/awest/Documents/Stage/Vue/vue-storefront-api/src/api/catalog.js:92:9

Any help on how I could solve this problem would be appreciated, none of the code has been touched, I have cloned vue storefront from github & followed the installation options ( yarn & yarn installer ).

Kind Regards

Arjan

Metadata

Metadata

Assignees

Labels

P3: NormalPriority mark - normal prioritybugBug reports

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions