FOSElasticaBundle: "Error: Wrong parameters for Exception(..)" - while populating FOSElasticaBundle/Symfony2
Hi,
I’m having the same issue as described here in this stackoverflow question (after upgrading elasticsearch from 1.7.3 => 2.0):
Error: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]])
I was using elasticsearch 1.7.3 with foselasticabundle, but after upgrading elasticsearch to 2.0, and running console fos:elastica:populate --no-debug, I get the following error & trace:
~/Sites/webapp $ console fos:elastica:populate --no-debug
Resetting app
PHP Fatal error: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]]) in /Users/user/Sites/webapp/vendor/ruflin/elastica/lib/Elastica/Exception/ResponseException.php on line 34
PHP Stack trace:
PHP 1. {main}() /Users/user/Sites/webapp/bin/console:0
PHP 2. Symfony\Component\Console\Application->run() /Users/user/Sites/webapp/bin/console:27
PHP 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /Users/user/Sites/webapp/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:120
PHP 4. Symfony\Component\Console\Application->doRun() /Users/user/Sites/webapp/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:96
PHP 5. Symfony\Component\Console\Application->doRunCommand() /Users/user/Sites/webapp/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:189
PHP 6. Symfony\Component\Console\Command\Command->run() /Users/user/Sites/webapp/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:846
PHP 7. FOS\ElasticaBundle\Command\PopulateCommand->execute() /Users/user/Sites/webapp/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:256
PHP 8. FOS\ElasticaBundle\Command\PopulateCommand->populateIndex() /Users/user/Sites/webapp/vendor/friendsofsymfony/elastica-bundle/Command/PopulateCommand.php:124
PHP 9. FOS\ElasticaBundle\Index\Resetter->resetIndex() /Users/user/Sites/webapp/vendor/friendsofsymfony/elastica-bundle/Command/PopulateCommand.php:144
PHP 10. Elastica\Index->create() /Users/user/Sites/webapp/vendor/friendsofsymfony/elastica-bundle/Index/Resetter.php:100
PHP 11. Elastica\Index->delete() /Users/user/Sites/webapp/vendor/ruflin/elastica/lib/Elastica/Index.php:257
PHP 12. Elastica\Index->request() /Users/user/Sites/webapp/vendor/ruflin/elastica/lib/Elastica/Index.php:183
PHP 13. FOS\ElasticaBundle\Elastica\Client->request() /Users/user/Sites/webapp/vendor/ruflin/elastica/lib/Elastica/Index.php:496
PHP 14. Elastica\Client->request() /Users/user/Sites/webapp/vendor/friendsofsymfony/elastica-bundle/Elastica/Client.php:47
PHP 15. Elastica\Request->send() /Users/user/Sites/webapp/vendor/ruflin/elastica/lib/Elastica/Client.php:621
PHP 16. Elastica\Transport\Http->exec() /Users/user/Sites/webapp/vendor/ruflin/elastica/lib/Elastica/Request.php:171
PHP 17. Elastica\Exception\ResponseException->__construct() /Users/user/Sites/webapp/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php:159
PHP 18. Exception->__construct() /Users/user/Sites/webapp/vendor/ruflin/elastica/lib/Elastica/Exception/ResponseException.php:34
Fatal error: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]]) in /Users/user/Sites/webapp/vendor/ruflin/elastica/lib/Elastica/Exception/ResponseException.php on line 34
Call Stack:
0.0006 235128 1. {main}() /Users/user/Sites/webapp/bin/console:0
0.0465 3396792 2. Symfony\Component\Console\Application->run() /Users/user/Sites/webapp/bin/console:27
0.0500 3612624 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /Users/user/Sites/webapp/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:120
0.1798 11821888 4. Symfony\Component\Console\Application->doRun() /Users/user/Sites/webapp/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:96
0.1801 11822808 5. Symfony\Component\Console\Application->doRunCommand() /Users/user/Sites/webapp/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:189
0.1811 11872392 6. Symfony\Component\Console\Command\Command->run() /Users/user/Sites/webapp/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:846
0.1907 12786088 7. FOS\ElasticaBundle\Command\PopulateCommand->execute() /Users/user/Sites/webapp/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:256
0.1908 12787344 8. FOS\ElasticaBundle\Command\PopulateCommand->populateIndex() /Users/user/Sites/webapp/vendor/friendsofsymfony/elastica-bundle/Command/PopulateCommand.php:124
0.1913 12807512 9. FOS\ElasticaBundle\Index\Resetter->resetIndex() /Users/user/Sites/webapp/vendor/friendsofsymfony/elastica-bundle/Command/PopulateCommand.php:144
0.1920 12884920 10. Elastica\Index->create() /Users/user/Sites/webapp/vendor/friendsofsymfony/elastica-bundle/Index/Resetter.php:100
0.1920 12885152 11. Elastica\Index->delete() /Users/user/Sites/webapp/vendor/ruflin/elastica/lib/Elastica/Index.php:257
0.1922 12919776 12. Elastica\Index->request() /Users/user/Sites/webapp/vendor/ruflin/elastica/lib/Elastica/Index.php:183
0.1922 12920352 13. FOS\ElasticaBundle\Elastica\Client->request() /Users/user/Sites/webapp/vendor/ruflin/elastica/lib/Elastica/Index.php:496
0.1926 12962168 14. Elastica\Client->request() /Users/user/Sites/webapp/vendor/friendsofsymfony/elastica-bundle/Elastica/Client.php:47
0.1927 12964968 15. Elastica\Request->send() /Users/user/Sites/webapp/vendor/ruflin/elastica/lib/Elastica/Client.php:621
0.1937 13088032 16. Elastica\Transport\Http->exec() /Users/user/Sites/webapp/vendor/ruflin/elastica/lib/Elastica/Request.php:171
0.1989 13198928 17. Elastica\Exception\ResponseException->__construct() /Users/user/Sites/webapp/vendor/ruflin/elastica/lib/Elastica/Transport/Http.php:159
0.1989 13199008 18. Exception->__construct() /Users/user/Sites/webapp/vendor/ruflin/elastica/lib/Elastica/Exception/ResponseException.php:34
[Symfony\Component\Debug\Exception\FatalErrorException]
Error: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]])
Any ideas on a fix?
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 28 (4 by maintainers)
What’s about elasticsearch 2.X? When bundle will support it?
It seems master branch supports ES 2.x. Using
"friendsofsymfony/elastica-bundle": "dev-master"in composer solved my problem. Waiting for a stable release.Have the same issue. After a brief investigation found following:
I suppose that dependency should be changed to proper one.
You need to use Elasticasearch 1.x Check on past release https://www.elastic.co/downloads/past-releases it works for me with 1.7.5
@alfonsomga FOSElasticaBundle does not support elasticsearch v.2.X yet, please try with v.1.7.4
+1 for 2.x support
+1 For 2.x support
+1 for supporting elasticsearch 2.x
+1 for supporting elasticsearch 2.x
+1 for supporting the latest version of elastica and elastic-search (2.x)
+1 For 2.x support
Check this please https://github.com/ruflin/Elastica/issues/974
I think it must be already fixed
PR with quick fix ?