Issue in Connecting CosmosDB using Germlin Graph PHP - azure-cosmosdb

I am trying to connect cosmos azure db with Gremlin graph php I have enter all the details correctly but still facing the issue.
Here is exact error that I am facing:
Welcome to Azure Cosmos DB + Gremlin on PHP!
Attempting to connect...
Caught exception:
gremlin-php driver has thrown the following error :
PHP Fatal error:
Uncaught Brightzone\GremlinDriver\InternalException: gremlin-php driver has thrown the following error : Could not write to socket in E:\germl
in\azure-cosmos-db-graph-php-getting-started\vendor\brightzone\gremlin-php\src\C
onnection.php:791
Stack trace:
0 E:\germlin\azure-cosmos-db-graph-php-getting-started\vendor\brightzone\gremlin-php\src\Connection.php(523):Brightzone\GremlinDriver\Connection->error('Could not write...', 500, true)
1 E:\germlin\azure-cosmos-db-graph-php-getting-started\vendor\brightzone\gremlin-php\src\Connection.php(657):Brightzone\GremlinDriver\Connection->close()
2 [internal function]: Brightzone\GremlinDriver\Connection->__destruct()
3 {main}
thrown in E:\germlin\azure-cosmos-db-graph-php-getting-started\vendor\brightzone\gremlin-php\src\Connection.php on line 791
Any help is appreciated. Thanks

Related

Symfony2 error when deploying

I'm new with symfony. I get this error when launch project after deploying.
Could u help me please.
Thanks
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Service "fragment.renderer.inline" must implement interface "Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface".' in /htdocs/DEV-web/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/FragmentRendererPass.php:58 Stack trace: #0 /htdocs/DEV-web/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php(107): Symfony\Component\HttpKernel\DependencyInjection\FragmentRendererPass->process(Object(Symfony\Component\DependencyInjection\ContainerBuilder)) #1 /htdocs/DEV-web/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php(593): Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object(Symfony\Component\DependencyInjection\ContainerBuilder)) #2 /htdocs/DEV-web/app/bootstrap.php.cache(2698): Symfony\Component\DependencyInjection\ContainerBuilder->compile() #3 /htdocs/DEV-web/app/bootstrap.php.cache(2476): Symfony\Component\HttpKernel\Kernel->in in /htdocs/DEV-web/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/FragmentRendererPass.php on line 58

Symfony display exceptions in prod environment

In prod env when error occurured symfony displays a standard error page.
This is the standard default framework error page:
But when PDO can't connect to database symfony display this error to the client:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known' in /homepages/35/d619429344/htdocs/mcg/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43 Stack trace: #0 /homepages/35/d619429344/htdocs/mcg/web/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(43): PDO->__construct('mysql:host=db63...', 'dbo632759072', 'mgm_mgm', Array) #1 ...
PDO exeptions:
I can't display this error to the client for security reason.
Any ideas on how to disable these messages and redirect to an error page like other error ?
You should have display_errors = off in your PHP.ini anyway to avoid this problem. Errors that reveal details like these come from many places, in addition to PDO.

Fatal error: Uncaught exception 'ReflectionException' with message 'Class Cl\CommonBundle\Entity\integer does not exist

I have developed application in symfony2.3, it's working perfect in development environment but while I move to production it throws error. I tried but it can't resolve.
Following all error comes form different page :
This error comes while I tried to access my home page.
Fatal error: Uncaught exception 'ReflectionException' with message 'Class Cl\CommonBundle\Entity\integer does not exist' in /opt/lampp/htdocs/Cl/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php:795 Stack trace: #0 /opt/lampp/htdocs/Cl/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php(795): ReflectionParameter->getClass() #1 [internal function]: Doctrine\Common\Proxy\ProxyGenerator->generateMethods(Object(Doctrine\ORM\Mapping\ClassMetadata)) #2 /opt/lampp/htdocs/Cl/vendor/doctrine/common/lib/Doctrine/Common/Proxy/ProxyGenerator.php(276): call_user_func(Array, Object(Doctrine\ORM\Mapping\ClassMetadata)) #3 /opt/lampp/htdocs/Cl/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php(155): Doctrine\Common\Proxy\ProxyGenerator->generateProxyClass(Object(Doctrine\ORM\Mapping\ClassMetadata), '/opt/lampp/htdo...') #4 /opt/lampp/htdocs/Cl/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php(71 in /opt/lampp/htdocs/Cl/vendor/doctrine/common/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php on line 51
When I clear cache of production environment in command line, it throws following exception :
[Doctrine\Common\Proxy\Exception\UnexpectedValueException]
The type hint of parameter "user" in method "setUser" in class "Cl\CommonBundle\Entity\GroupEventComment" is invalid.
[ReflectionException]
Class Collegelife\CommonBundle\Entity\integer does not exist
Once this has been solved then it throws to other class, so I can't understand that what's happen.
When I tried to login into page :
it shows me error like :
Fatal error: require(): Failed opening required '/opt/lampp/htdocs/collegelife/app/cache/prod/doctrine/orm/Proxies/__CG__CollegelifeCommonBundleEntityUniversity.php' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/collegelife/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php on line 207
I had the same question and resolved it.
Because My Entity's setting.
You can't type hint on a scalar type (integer/string/boolean etc) in PHP. e.g.
public function setSortOrder(\integer $sortOrder)
Should be:
public function setSortOrder($sortOrder)

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Unable to load class "Twig_Extension_Escaper"'

I have this error in my system in the production server, but I have no idea why cause in my development server everything run fine.
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Unable to load class "Twig_Extension_Escaper"' in /home/content/79/11253479/html/witf/path/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php:259 Stack trace: #0 /home/content/79/11253479/html/witf/path/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php(98): Symfony\Component\ClassLoader\ClassCollectionLoader::getOrderedClasses(Array) #1 /home/content/79/11253479/html/witf/path/app/bootstrap.php.cache(2303): Symfony\Component\ClassLoader\ClassCollectionLoader::load(Array, '/home/content/7...', 'classes', false, false, '.php') #2 /home/content/79/11253479/html/witf/path/app/bootstrap.php.cache(2139): Symfony\Component\HttpKernel\Kernel->doLoadClassCache('classes', '.php') #3 /home/content/79/11253479/html/witf/path/app/bootstrap.php.cache(2173): Symfony\Component\HttpKernel\Kernel->boot() #4 /home/content/79/11253479/html/index.php(27): Symfony\Component\HttpKernel\Kernel->handle(Object(S in /home/content/79/11253479/html/witf/path/vendor/symfony/symfony/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php on line 259
please try composer update -o and afterwards app/console cache:clear --env=prod.
Further check that the file vendor/twig/twig/lib/Twig/Extension/Escaper.php actually exists on your production server.

Error when using #runInSeparateProcess with markTestSkipped()

/**
* Tests Response->redirect
* #runInSeparateProcess
*/
public function testRedirect() {
$this->markTestSkipped();
}
ERROR MESSAGE:
There was 1 error:
1) ResponseTest::testRedirect
PHPUnit_Framework_Exception: PHP Fatal error: Uncaught exception 'PDOException' with message 'You cannot serialize or unserialize PDO instances' in -:44
Stack trace:
0 [internal function]: PDO->__sleep()
1 -(44): serialize(Array)
2 -(332): __phpunit_run_isolated_test()
3 {main}
thrown in - on line 44
Fatal error: Uncaught exception 'PDOException' with message 'You cannot serialize or unserialize PDO instances' in -:44
Stack trace:
0 [internal function]: PDO->__sleep()
1 -(44): serialize(Array)
2 -(332): __phpunit_run_isolated_test()
3 {main}
thrown in - on line 44
When PHPUnit goes to run a test in another process it will serialize a bunch of different data to give to that new process. I will assume you have a database connection hanging around in a variable which PHPUnit is trying to serialize.
as #SamHennessy Mentioned , this issues is because of huge data in the stack trace when failures
This is because of a large Objects saved in the TestCase,
when there is a assertion failures , the trace is generated and serialized ,
so serialization breaks if there is huge data in traces.
in my case i was saving dataset in the test case , which generated a 239555 bytes of data in trace

Resources