产品保存报错:Exception 'XSException' with message 'php_network_getaddresses: getaddrinfo failed: Name or service not known(C#0, xunsearch:8383)

问题咨询 · UOY_KCUF · 于 6年前 发布 · 2255 次阅读

后台产品在报错的时候报错,信息如下:

Http status: 500 Internal Server Error
ajaxOptions: error
thrownError: Internal Server Error

Exception 'XSException' with message 'php_network_getaddresses: getaddrinfo failed: Name or service not known(C#0, xunsearch:8383)' 

in /www/web/develop/fecshop/vendor/hightman/xunsearch/lib/XSServer.class.php:477

Stack trace:
#0 /www/web/develop/fecshop/vendor/hightman/xunsearch/lib/XSServer.class.php(172): XSServer->connect()
#1 /www/web/develop/fecshop/vendor/hightman/xunsearch/lib/XSServer.class.php(147): XSServer->open('xunsearch:8383')
#2 /www/web/develop/fecshop/vendor/hightman/xunsearch/lib/XS.class.php(415): XSServer->__construct('xunsearch:8383', Object(XS))
#3 /www/web/develop/fecshop/vendor/hightman/xunsearch/lib/XS.class.php(186): XS->getIndex()
#4 /www/web/develop/fecshop/vendor/hightman/xunsearch/wrapper/yii2-ext/Database.php(83): XSComponent->__get('index')
#5 /www/web/develop/fecshop/vendor/hightman/xunsearch/wrapper/yii2-ext/ActiveRecord.php(297): hightman\xunsearch\Database->getIndex()
#6 /www/web/develop/fecshop/vendor/yiisoft/yii2/db/BaseActiveRecord.php(646): hightman\xunsearch\ActiveRecord->insert(true, NULL)
#7 /www/web/develop/fecshop/vendor/fancyecommerce/fecshop/services/helper/AR.php(99): yii\db\BaseActiveRecord->save()
#8 /www/web/develop/fecshop/vendor/fancyecommerce/fecshop/services/search/XunSearch.php(76): fecshop\services\helper\AR->save(Object(fecshop\models\xunsearch\Search), Array, true)
#9 [internal function]: fecshop\services\search\XunSearch->actionSyncProductInfo(Array, 20)
#10 /www/web/develop/fecshop/vendor/fancyecommerce/fecshop/services/Service.php(49): call_user_func_array(Array, Array)
#11 /www/web/develop/fecshop/vendor/fancyecommerce/fecshop/services/Search.php(62): fecshop\services\Service->__call('syncProductInfo', Array)
#12 /www/web/develop/fecshop/vendor/fancyecommerce/fecshop/services/Search.php(62): fecshop\services\search\XunSearch->syncProductInfo(Array, 20)
#13 [internal function]: fecshop\services\Search->actionSyncProductInfo(Array)
#14 /www/web/develop/fecshop/vendor/fancyecommerce/fecshop/services/Service.php(49): call_user_func_array(Array, Array)
#15 /www/web/develop/fecshop/vendor/fancyecommerce/fecshop/services/product/ProductMongodb.php(338): fecshop\services\Service->__call('syncProductInfo', Array)
#16 /www/web/develop/fecshop/vendor/fancyecommerce/fecshop/services/product/ProductMongodb.php(338): fecshop\services\Search->syncProductInfo(Array)
#17 /www/web/develop/fecshop/vendor/fancyecommerce/fecshop/services/Product.php(357): fecshop\services\product\ProductMongodb->save(Array, 'catalog/product...')
#18 [internal function]: fecshop\services\Product->actionSave(Array, 'catalog/product...')
#19 /www/web/develop/fecshop/vendor/fancyecommerce/fecshop/services/Service.php(49): call_user_func_array(Array, Array)
#20 /www/web/develop/fecshop/vendor/fancyecommerce/fecshop/app/appadmin/modules/Catalog/block/productinfo/Manageredit.php(400): fecshop\services\Service->__call('save', Array)
#21 /www/web/develop/fecshop/vendor/fancyecommerce/fecshop/app/appadmin/modules/Catalog/block/productinfo/Manageredit.php(400): fecshop\services\Product->save(Array, 'catalog/product...')
#22 /www/web/develop/fecshop/vendor/fancyecommerce/fecshop/app/appadmin/modules/Catalog/controllers/ProductinfoController.php(50): fecshop\app\appadmin\modules\Catalog\block\productinfo\Manageredit->save()
#23 [internal function]: fecshop\app\appadmin\modules\Catalog\controllers\ProductinfoController->actionManagereditsave()
#24 /www/web/develop/fecshop/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#25 /www/web/develop/fecshop/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#26 /www/web/develop/fecshop/vendor/yiisoft/yii2/base/Module.php(528): yii\base\Controller->runAction('managereditsave', Array)
#27 /www/web/develop/fecshop/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction('catalog/product...', Array)
#28 /www/web/develop/fecshop/vendor/yiisoft/yii2/base/Application.php(386): yii\web\Application->handleRequest(Object(yii\web\Request))
#29 /www/web/develop/fecshop/appadmin/web/index.php(76): yii\base\Application->run()
#30 {main}
共收到 1 条回复
Fecmall#16年前 0 个赞

如果是手动安装,则:

添加host, xunsearch指向 127.0.0.1

vim /etc/hosts

127.0.0.1  xunsearch

保存即可。

2.如果是docker安装fecshop,不会出这个问题,除非xunsearch 容器启动失败,获取其他等问题,肯定不是host的问题

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics