Closed Darwex closed 5 years ago
Do You have any error in dev mode / outside the docker? Is the vsapi accessible to connect to from vs docker? It seems like a lack of connectivity for ssr (server side) app to Vue Storefront api. Please also attach Your vs and vsapi config files to give us some more info
If you’re connecting to vsapi using “localhost” not the public IP please make sure your containers work in host network mode
I do not see any errors outside docker. I also suspect docker networking but the error I received seemed unclear to me, since I do not know vue-storefront well enough. When I start the docker-compose up i can access the vsapi via browser as well as vue-storefront and kibana (connected to elastic) that is what confuses me.
Please see my vs and vsapi configs below.
vs config
{
"server": {
"host": "0.0.0.0",
"port": 3000,
"protocol": "http",
"api": "api",
"useOutputCacheTagging": false,
"useOutputCache": false,
"outputCacheDefaultTtl": 86400,
"availableCacheTags": ["product", "category", "home", "checkout", "page-not-found", "compare", "my-account", "P", "C", "error"],
"invalidateCacheKey": "aeSu7aip",
"dynamicConfigReload": false,
"dynamicConfigExclude": ["ssr", "storeViews", "entities", "localForage", "shipping", "boost", "query"],
"dynamicConfigInclude": []
},
"console": {
"verbosityLevel": "only-errors"
},
"redis": {
"host": "localhost",
"port": 6379,
"db": 0
},
"graphql":{
"host": "localhost",
"port": 8080
},
"elasticsearch": {
"httpAuth": "",
"host": "localhost:8080/api/catalog",
"index": "vue_storefront_catalog",
"min_score": 0.02,
"csrTimeout": 5000,
"ssrTimeout": 1000
},
"ssr": {
"templates": {
"default": "dist/index.html",
"minimal": "dist/index.minimal.html",
"basic": "dist/index.basic.html"
},
"executeMixedinAsyncData": true,
"initialStateFilter": ["__DEMO_MODE__", "version", "storeView"],
"useInitialStateFilter": true
},
"defaultStoreCode": "",
"storeViews": {
"multistore": false,
"mapStoreUrlsFor": ["de", "it"],
"de": {
"storeCode": "de",
"disabled": true,
"storeId": 3,
"name": "German Store",
"url": "/de",
"elasticsearch": {
"host": "localhost:8080/api/catalog",
"index": "vue_storefront_catalog_de"
},
"tax": {
"sourcePriceIncludesTax": false,
"defaultCountry": "DE",
"defaultRegion": "",
"calculateServerSide": true
},
"i18n": {
"fullCountryName": "Germany",
"fullLanguageName": "German",
"defaultLanguage": "DE",
"defaultCountry": "DE",
"defaultLocale": "de-DE",
"currencyCode": "EUR",
"currencySign": "EUR",
"dateFormat": "HH:mm D-M-YYYY"
}
},
"it": {
"storeCode": "it",
"disabled": true,
"storeId": 4,
"name": "Italian Store",
"url": "/it",
"elasticsearch": {
"host": "localhost:8080/api/catalog",
"index": "vue_storefront_catalog_it"
},
"tax": {
"sourcePriceIncludesTax": false,
"defaultCountry": "IT",
"defaultRegion": "",
"calculateServerSide": true
},
"i18n": {
"fullCountryName": "Italy",
"fullLanguageName": "Italian",
"defaultCountry": "IT",
"defaultLanguage": "IT",
"defaultLocale": "it-IT",
"currencyCode": "EUR",
"currencySign": "EUR",
"dateFormat": "HH:mm D-M-YYYY"
}
}
},
"entities": {
"optimize": true,
"twoStageCaching": true,
"optimizeShoppingCart": true,
"category": {
"includeFields": [ "children_data", "id", "children_count", "sku", "name", "is_active", "parent_id", "level", "url_key", "product_count", "path"]
},
"attribute": {
"includeFields": [ "attribute_code", "id", "entity_type_id", "options", "default_value", "is_user_defined", "frontend_label", "attribute_id", "default_frontend_label", "is_visible_on_front", "is_visible", "is_comparable", "tier_prices" ]
},
"productList": {
"sort": "",
"includeFields": [ "type_id", "sku", "product_links", "tax_class_id", "special_price", "special_to_date", "special_from_date", "name", "price", "priceInclTax", "originalPriceInclTax", "originalPrice", "specialPriceInclTax", "id", "image", "sale", "new", "url_key", "status", "tier_prices" ],
"excludeFields": [ "configurable_children", "description", "configurable_options", "sgn" ]
},
"productListWithChildren": {
"includeFields": [ "type_id", "sku", "name", "tax_class_id", "special_price", "special_to_date", "special_from_date", "price", "priceInclTax", "originalPriceInclTax", "originalPrice", "specialPriceInclTax", "id", "image", "sale", "new", "configurable_children.image", "configurable_children.sku", "configurable_children.price", "configurable_children.special_price", "configurable_children.priceInclTax", "configurable_children.specialPriceInclTax", "configurable_children.originalPrice", "configurable_children.originalPriceInclTax", "configurable_children.color", "configurable_children.size", "configurable_children.id", "configurable_children.tier_prices", "product_links", "url_key", "status", "tier_prices"],
"excludeFields": [ "description", "sgn"]
},
"review": {
"excludeFields": ["review_entity", "review_status"]
},
"product": {
"excludeFields": [ "updated_at", "created_at", "attribute_set_id", "options_container", "msrp_display_actual_price_type", "has_options", "stock.manage_stock", "stock.use_config_min_qty", "stock.use_config_notify_stock_qty", "stock.stock_id", "stock.use_config_backorders", "stock.use_config_enable_qty_inc", "stock.enable_qty_increments", "stock.use_config_manage_stock", "stock.use_config_min_sale_qty", "stock.notify_stock_qty", "stock.use_config_max_sale_qty", "stock.use_config_max_sale_qty", "stock.qty_increments", "small_image"],
"includeFields": null
}
},
"cart": {
"bypassCartLoaderForAuthorizedUsers": true,
"multisiteCommonCart": true,
"server_merge_by_default": true,
"synchronize": true,
"synchronize_totals": true,
"setCustomProductOptions": true,
"setConfigurableProductOptions": true,
"create_endpoint": "http://localhost:8080/api/cart/create?token={{token}}",
"updateitem_endpoint": "http://localhost:8080/api/cart/update?token={{token}}&cartId={{cartId}}",
"deleteitem_endpoint": "http://localhost:8080/api/cart/delete?token={{token}}&cartId={{cartId}}",
"pull_endpoint": "http://localhost:8080/api/cart/pull?token={{token}}&cartId={{cartId}}",
"totals_endpoint": "http://localhost:8080/api/cart/totals?token={{token}}&cartId={{cartId}}",
"paymentmethods_endpoint": "http://localhost:8080/api/cart/payment-methods?token={{token}}&cartId={{cartId}}",
"shippingmethods_endpoint": "http://localhost:8080/api/cart/shipping-methods?token={{token}}&cartId={{cartId}}",
"shippinginfo_endpoint": "http://localhost:8080/api/cart/shipping-information?token={{token}}&cartId={{cartId}}",
"collecttotals_endpoint": "http://localhost:8080/api/cart/collect-totals?token={{token}}&cartId={{cartId}}",
"deletecoupon_endpoint": "http://localhost:8080/api/cart/delete-coupon?token={{token}}&cartId={{cartId}}",
"applycoupon_endpoint": "http://localhost:8080/api/cart/apply-coupon?token={{token}}&cartId={{cartId}}&coupon={{coupon}}"
},
"products": {
"useShortCatalogUrls": false,
"useMagentoUrlKeys": false,
"setFirstVarianAsDefaultInURL": false,
"configurableChildrenStockPrefetchStatic": false,
"configurableChildrenStockPrefetchDynamic": false,
"configurableChildrenStockPrefetchStaticPrefetchCount": 8,
"filterUnavailableVariants": false,
"listOutOfStockProducts": false,
"preventConfigurableChildrenDirectAccess": true,
"alwaysSyncPlatformPricesOver": false,
"clearPricesBeforePlatformSync": false,
"waitForPlatformSync": false,
"setupVariantByAttributeCode": true,
"endpoint": "http://localhost:8080/api/product",
"defaultFilters": ["color", "size", "price", "erin_recommends"],
"filterFieldMapping": {
"category.name": "category.name.keyword"
},
"sortByAttributes": {
"Latest": "updated_at",
"Price":"final_price"
},
"gallery": {
"variantsGroupAttribute": "color",
"mergeConfigurableChildren": true,
"imageAttributes": ["image","thumbnail","small_image"],
"width": 600,
"height": 744
}
},
"orders": {
"endpoint": "http://localhost:8080/api/order",
"payment_methods_mapping": {
},
"offline_orders": {
"automatic_transmission_enabled": false,
"notification" : {
"enabled": true,
"title" : "Order waiting!",
"message": "Click here to confirm the order that you made offline.",
"icon": "/assets/logo.png"
}
}
},
"localForage": {
"defaultDrivers": {
"user": "LOCALSTORAGE",
"carts": "LOCALSTORAGE",
"orders": "LOCALSTORAGE",
"wishlist": "INDEXEDDB",
"categories": "INDEXEDDB",
"attributes": "INDEXEDDB",
"products": "INDEXEDDB",
"elasticCache": "INDEXEDDB",
"claims": "LOCALSTORAGE",
"compare": "INDEXEDDB",
"syncTasks": "INDEXEDDB",
"ordersHistory": "INDEXEDDB",
"checkoutFieldValues": "LOCALSTORAGE"
}
},
"reviews": {
"create_endpoint": "http://localhost:8080/api/review/create"
},
"users": {
"autoRefreshTokens": true,
"endpoint": "http://localhost:8080/api/user",
"history_endpoint": "http://localhost:8080/api/user/order-history?token={{token}}",
"resetPassword_endpoint": "http://localhost:8080/api/user/reset-password",
"changePassword_endpoint": "http://localhost:8080/api/user/change-password?token={{token}}",
"login_endpoint": "http://localhost:8080/api/user/login",
"create_endpoint": "http://localhost:8080/api/user/create",
"me_endpoint": "http://localhost:8080/api/user/me?token={{token}}",
"refresh_endpoint": "http://localhost:8080/api/user/refresh"
},
"stock": {
"synchronize": true,
"allowOutOfStockInCart": true,
"endpoint": "http://localhost:8080/api/stock"
},
"images": {
"baseUrl": "https://demo.vuestorefront.io/img/",
"productPlaceholder": "/assets/placeholder.jpg"
},
"install": {
"is_local_backend": true,
"backend_dir": "../vue-storefront-api"
},
"demomode": false,
"tax": {
"defaultCountry": "PL",
"defaultRegion": "",
"sourcePriceIncludesTax": false,
"calculateServerSide": true
},
"shipping": {
"methods": [
{
"method_title": "DPD Courier",
"method_code": "flatrate",
"carrier_code": "flatrate",
"amount": 4,
"price_incl_tax": 5,
"default": true,
"offline": true
}
]
},
"i18n": {
"defaultCountry": "US",
"defaultLanguage": "EN",
"availableLocale": ["en-US","de-DE","fr-FR","es-ES","nl-NL", "jp-JP", "ru-RU", "it-IT", "pt-BR", "pl-PL"],
"defaultLocale": "en-US",
"currencyCode": "USD",
"currencySign": "$",
"dateFormat": "HH:mm D/M/YYYY",
"fullCountryName": "United States",
"fullLanguageName": "English",
"bundleAllStoreviewLanguages": true
},
"mailchimp": {
"endpoint": "http://localhost:8080/api/ext/mailchimp-subscribe/subscribe"
},
"mailer": {
"endpoint": {
"send": "http://localhost:8080/api/ext/mail-service/send-email",
"token": "http://localhost:8080/api/ext/mail-service/get-token"
},
"contactAddress": "contributors@vuestorefront.io",
"sendConfirmation": true
},
"theme": "@vue-storefront/theme-default",
"analytics": {
"id": false
},
"stripe": {
"api_key": "my_example_api_key"
},
"cms": {
"endpoint": "http://localhost:8080/api/ext/cms-data/cms{{type}}/{{cmsId}}",
"endpointIdentifier": "http://localhost:8080/api/ext/cms-data/cms{{type}}Identifier/{{cmsIdentifier}}/storeId/{{storeId}}"
},
"usePriceTiers": false,
"boost": {
"name": 3,
"category.name": 1,
"short_description": 1,
"description": 1,
"sku": 1,
"configurable_children.sku": 1
},
"query": {
"inspirations": {
"filter": [
{
"key": "category.name",
"value" : { "eq": "Performance Fabrics" }
}
]
},
"newProducts": {
"filter": [
{
"key": "category.name",
"value" : { "eq": "Tees" }
}
]
},
"coolBags": {
"filter": [
{
"key": "category.name",
"value" : { "eq": "Women" }
}
]
},
"bestSellers": {
"filter": [
{
"key": "category.name",
"value" : { "eq": "Tees" }
}
]
}
}
}
vsapi config
{
"server": {
"host": "localhost",
"port": 8080,
"searchEngine": "elasticsearch"
},
"elasticsearch": {
"host": "http://vue_storefront_elasticsearch",
"port": 9200,
"user": "elastic",
"password": "changeme",
"min_score": 0.01,
"indices": [
"vue_storefront_catalog",
"vue_storefront_catalog_de",
"vue_storefront_catalog_it"
],
"indexTypes": [
"product",
"category",
"cms",
"attribute",
"taxrule",
"review"
]
},
"redis": {
"host": "localhost",
"port": 6379,
"db": 0
},
"kue": {},
"availableStores": [
"de",
"it"
],
"storeViews": {
"multistore": true,
"mapStoreUrlsFor": [
"de",
"it"
],
"de": {
"storeCode": "de",
"disabled": true,
"storeId": 3,
"name": "German Store",
"url": "/de",
"elasticsearch": {
"host": "localhost:8080/api/catalog",
"index": "vue_storefront_catalog_de"
},
"tax": {
"defaultCountry": "DE",
"defaultRegion": "",
"calculateServerSide": true,
"sourcePriceIncludesTax": false
},
"i18n": {
"fullCountryName": "Germany",
"fullLanguageName": "German",
"defaultLanguage": "DE",
"defaultCountry": "DE",
"defaultLocale": "de-DE",
"currencyCode": "EUR",
"currencySign": "EUR",
"dateFormat": "HH:mm D-M-YYYY"
}
},
"it": {
"storeCode": "it",
"disabled": true,
"storeId": 4,
"name": "Italian Store",
"url": "/it",
"elasticsearch": {
"host": "localhost:8080/api/catalog",
"index": "vue_storefront_catalog_it"
},
"tax": {
"defaultCountry": "IT",
"defaultRegion": "",
"calculateServerSide": true,
"sourcePriceIncludesTax": false
},
"i18n": {
"fullCountryName": "Italy",
"fullLanguageName": "Italian",
"defaultCountry": "IT",
"defaultLanguage": "IT",
"defaultLocale": "it-IT",
"currencyCode": "EUR",
"currencySign": "EUR",
"dateFormat": "HH:mm D-M-YYYY"
}
}
},
"authHashSecret": "__SECRET_CHANGE_ME__",
"objHashSecret": "__SECRET_CHANGE_ME__",
"cart": {
"setConfigurableProductOptions": false
},
"tax": {
"defaultCountry": "PL",
"defaultRegion": "",
"calculateServerSide": true,
"alwaysSyncPlatformPricesOver": false,
"usePlatformTotals": true,
"setConfigurableProductOptions": true,
"sourcePriceIncludesTax": false
},
"bodyLimit": "100kb",
"corsHeaders": [
"Link"
],
"platform": "magento2",
"registeredExtensions": [
"mailchimp-subscribe",
"example-magento-api",
"cms-data",
"mail-service"
],
"extensions": {
"mailchimp": {
"listId": "e06875a7e1",
"apiKey": "a9a3318ea7d30f5c5596bd4a78ae0985-us3",
"apiUrl": "https://us3.api.mailchimp.com/3.0"
},
"mailService": {
"transport": {
"host": "smtp.gmail.com",
"port": 465,
"secure": true,
"user": "vuestorefront",
"pass": "vuestorefront.io"
},
"targetAddressWhitelist": ["contributors@vuestorefront.io"],
"secretString": "__THIS_IS_SO_SECRET__"
}
},
"magento2": {
"url": "host-url",
"imgUrl": "http://demo-magento2.vuestorefront.io/media/catalog/product",
"assetPath": "/../var/magento2-sample-data/pub/media",
"magentoUserName": "",
"magentoUserPassword": "",
"httpUserName": "",
"httpUserPassword": "",
"api": {
"url": the-host/rest",
"consumerKey": "key",
"consumerSecret": "secret",
"accessToken": "token",
"accessTokenSecret": "token-secret"
}
},
"imageable": {
"namespace": "",
"maxListeners": 512,
"imageSizeLimit": 1024,
"whitelist": {
"allowedHosts": [
".*divante.pl",
".*vuestorefront.io"
]
},
"cache": {
"memory": 50,
"files": 20,
"items": 100
},
"concurrency": 0,
"counters": {
"queue": 2,
"process": 4
},
"simd": true,
"keepDownloads": true
},
"entities": {
"category": {
"includeFields": [ "children_data", "id", "children_count", "sku", "name", "is_active", "parent_id", "level", "url_key" ]
},
"attribute": {
"includeFields": [ "attribute_code", "id", "entity_type_id", "options", "default_value", "is_user_defined", "frontend_label", "attribute_id", "default_frontend_label", "is_visible_on_front", "is_visible", "is_comparable" ]
},
"productList": {
"sort": "",
"includeFields": [ "type_id", "sku", "product_links", "tax_class_id", "special_price", "special_to_date", "special_from_date", "name", "price", "priceInclTax", "originalPriceInclTax", "originalPrice", "specialPriceInclTax", "id", "image", "sale", "new", "url_key" ],
"excludeFields": [ "configurable_children", "description", "configurable_options", "sgn" ]
},
"productListWithChildren": {
"includeFields": [ "type_id", "sku", "name", "tax_class_id", "special_price", "special_to_date", "special_from_date", "price", "priceInclTax", "originalPriceInclTax", "originalPrice", "specialPriceInclTax", "id", "image", "sale", "new", "configurable_children.image", "configurable_children.sku", "configurable_children.price", "configurable_children.special_price", "configurable_children.priceInclTax", "configurable_children.specialPriceInclTax", "configurable_children.originalPrice", "configurable_children.originalPriceInclTax", "configurable_children.color", "configurable_children.size", "product_links", "url_key"],
"excludeFields": [ "description", "sgn"]
},
"product": {
"excludeFields": [ "updated_at", "created_at", "attribute_set_id", "status", "visibility", "tier_prices", "options_container", "msrp_display_actual_price_type", "has_options", "stock.manage_stock", "stock.use_config_min_qty", "stock.use_config_notify_stock_qty", "stock.stock_id", "stock.use_config_backorders", "stock.use_config_enable_qty_inc", "stock.enable_qty_increments", "stock.use_config_manage_stock", "stock.use_config_min_sale_qty", "stock.notify_stock_qty", "stock.use_config_max_sale_qty", "stock.use_config_max_sale_qty", "stock.qty_increments", "small_image"],
"includeFields": null,
"filterFieldMapping": {
"category.name": "category.name.keyword"
}
}
},
"usePriceTiers": false,
"boost": {
"name": 3,
"category.name": 1,
"short_description": 1,
"description": 1,
"sku": 1,
"configurable_children.sku": 1
}
}
vs seem to successfully connect to vsapi in the browser.
Thanks for your help. I appreciate it.
I managed to solve this.
vue-storefront-api/docker/vue-storefront-api/default.env
contains elastic-search config as well, and it is overriding the default one in config.local.
You can either delete it from the default.env or alter it there.
The truth is, that the error message was not very clear. Maybe we could improve error handling for connection issues.
Thanks for help. Closing the issue.
Is there any option to enable error message so we can debug it. Right not it really hard to understand the exact issue. it just showing
Something went wrong ... We've noticed Internal Server Error while rendering this request.
If you need an assistance you can drop us a line on a contact page
I am also trying to run it inside docker but I can't access it. Container is up and running. But when i load port 3000 in browser, it can't connect.
Current behavior
Vue-storefront shows error, something went wrong when started inside docker via docker-compose. It seems to return error below when trying to connect to elastic search. Kibana is on the same network connected with same credentials successfully.
I am just truing to wrap it now, I will polish it later on.
The js error after placing breakpoint inside search.ts
My docker-compose
vue-storefront-api config - elastic search section (the same as for Kibana)
Expected behavior
It should be working even inside docker.
Steps to reproduce the issue
Folder structure
Create the docker-compose mentioned above.
Change line 6 vue-storefront/docker/vue-storefront/vue-storefront.sh line 6
Added sw build, because it was missing inside dist folder.
go to http://localhost:3000
open console and click on top left arrow back
Can you handle fixing this bug by yourself?
No.
Environment details
See the repository.