Azure / azure-sdk-for-php

Microsoft Azure SDK for PHP
http://azure.microsoft.com/en-us/develop/php/
Apache License 2.0
415 stars 273 forks source link

Unable to open a $serviceBusRestProxy object in php #917

Open ZebpayHitesh opened 7 years ago

ZebpayHitesh commented 7 years ago

Fatal error: Uncaught <table style="border: 1px" cellspacing="0"> <tr><td colspan="3" style="background: #ff9999"> <b>HTTP_Request2_ConnectionException</b>: Unable to connect to tls://zebpaytestnet-sb.accesscontrol.windows.net:443. Error: php_network_getaddresses: getaddrinfo failed: Name or service not known in <b>/var/www/html/Myoperator/support-scripts/Zendesk/vendor/pear/http_request2/HTTP/Request2/Adapter/Socket.php</b> on line <b>331</b></td></tr> <tr><td colspan="3" style="background-color: #aaaaaa; text-align: center; font-weight: bold;">Exception trace</td></tr> <tr><td style="text-align: center; background: #cccccc; width:20px; font-weight: bold;">#</td><td style="text-align: center; background: #cccccc; font-weight: bold;">Function</td><td style="text-align: center; background: #cccccc; font-weight: bold;">Location</td></tr> <tr><td style="text-align: center;">0</td><td>HTTP_Request2_SocketWrapper->__construct('tls://zebpaytest&hellip;', 10, Array)</td><td>/var/www/html/Myoperator/support-scripts/Zendesk/vendor in /var/www/html/Myoperator/support-scripts/Zendesk/vendor/pear/http_request2/HTTP/Request2/SocketWrapper.php on line 134

sergey-shandar commented 7 years ago

@ZebpayHitesh Could you provide more info? It looks like the service was not available at this time "Name or service not known"

fabio-vyzvoice commented 7 years ago

Hello, I'm having the same issue, using PHP 5.6.25 and microsoft/windowsazure 0.4.5. I'm following the example at Microsoft PHP topic example and I'm getting this error message: Unable to connect to tls:\/\/my-sb.accesscontrol.windows.net:443. Error: php_network_getaddresses: getaddrinfo failed: No such host is known. I'm able to connect to sb://my-sb.servicebus.windows.net/, but after that, for some reason, the connection goes to .accesscontrol.windows.net:4443 which seems impossible to reach

sergey-shandar commented 7 years ago

@fabio-vyzvoice Could you also try 0.5.0 ?

fabio-vyzvoice commented 7 years ago

Nope, I'm stuck with Zend fromawork 2.4 and can't upgrade to 2.7, which is required for version 0.5.0. I believe the problem is that the https://*-sb.servicebus.windows.net is not accessible at all. It seems that, with 0.4.5, it is not possible to use SAS authentication but CAS, as the endpoint parser can't understand the SharedAccessKey & Name, but only the SHARED_SECRET_ISSUER_NAME & SHARED_SECRET_VALUE_NAME (in src/Common/Internal/ServiceBusSettings.php ) . It seems the SAS authentication is not supported for ServicesBuilder->createServiceBusService; Would it work ServiceBuilder->createQueueService($connectionString)? Maybe tomorrow I can give it a try. Meanwhile I implemented my own SAS token generator.

hail2skins commented 7 years ago

Just to affirm. I'm running into the same error using the Ruby example fabio is using the PHP example above.

2.4.1 :011 > topic = azure_service_bus_service.create_queue("test-topic") Faraday::ConnectionFailed: Failed to open TCP connection to spike-ds1-powershell-sb.accesscontrol.windows.net:443 (getaddrinfo: Name or service not known)

vinayakac commented 7 years ago

Fatal error: Uncaught

HTTP_Request2_MessageException: Error writing request in C:\xampp\htdocs\edmin\RETS\NWMLS\vendor\pear-pear.php.net\HTTP_Request2\HTTP\Request2\Adapter\Socket.php on line 130
Exception trace
#FunctionLocation
0HTTP_Request2_SocketWrapper->write('DELETE /nwmls-ge…')C:\xampp\htdocs\edmin\RETS\NWMLS\vendor\pear-pear.php.net\HTTP_Request2\HTTP\Request2\Adapter\Socket.php:130
1HTTP_Request2_Adapter_Socket->sendRequest(Obj in C:\xampp\htdocs\edmin\RETS\NWMLS\vendor\pear-pear.php.net\HTTP_Request2\HTTP\Request2\SocketWrapper.php on line 206

vinayakac commented 7 years ago

I am also facing same issue