Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Client connection #26

Open
iammeenugupta96 opened this issue Apr 6, 2017 · 7 comments
Open

Issue with Client connection #26

iammeenugupta96 opened this issue Apr 6, 2017 · 7 comments

Comments

@iammeenugupta96
Copy link

Hi Tamsad,

I'm integrating
https://www.drupal.org/project/brightcove
in one of my drupal project. Setting up the module requires this library to be installed
https://github.com/brightcove/PHP-API-Wrapper/

I integrated this almost a month back. It was all working fine. We were able to connect to the client and communicate with Brightcove studio.

Suddenly from last two days it has stopped working and error which we get is:

Brightcove\API\Exception\APIException: Invalid status code: expected 200-299, got 0. in Brightcove\API\Client->request() (line 274 of /var/www/drupal-7.38/sites/all/libraries/PHP-API-Wrapper/lib/Brightcove/API/Client.php).

Thereafter, I tried with new release of the library and today installed
https://github.com/brightcove/PHP-API-Wrapper/
allover again. But no luck.

Can you please suggest what could be the issue.

@janmashat
Copy link
Contributor

Please enable debug logging in lib/Brightcove/API/Client.php and post the results...
public static $debugRequests = "/tmp/bc.log";

Also you didn't mention what versions of the module and wrapper you're using.

@iammeenugupta96
Copy link
Author

Sure, will enable the logging.
I'm using Drupal 7.34 and brightcove module 7.x-6.4 and this latest version of php-api-wrapper.

@iammeenugupta96
Copy link
Author

By the way, thank you for your response.

@janmashat
Copy link
Contributor

Module version 7.x-6.4 requires version 0.8 of the wrapper.

@iammeenugupta96
Copy link
Author

Okay, even with that version facing issues.

integrated this almost a month back. It was all working fine. We were able to connect to the client and communicate with Brightcove studio.

Suddenly from last two days it has stopped working and error which we get is:

Brightcove\API\Exception\APIException: Invalid status code: expected 200-299, got 0. in Brightcove\API\Client->request()

So the $code is 0. I'll debug more on this and get back to you.

Please let me know if you have any clue why we get 0 as $code value. Not sure why it suddenly stopped working.

@janmashat
Copy link
Contributor

It's difficult to say without the debug log.

@DrLightman
Copy link

In my case, from localhost, I had the same issue and the fired exception message was empty and the log of this kind:

array (
  'request' => false,
  'request_body' => 'grant_type=client_credentials',
  'response' => 
  array (
    0 => 0,
    1 => '',
  ),
  'response_headers' => '',
)

Since I had already met this kind of issue with other libraries, I tried the same "fix" and it worked.
It's related to SSL, I added these lines into curl_set_opt_array next to the others, in Client.php, HTTPRequest method:

CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_PROXY_SSL_VERIFYPEER => 0,
CURLOPT_PROXY_SSL_VERIFYHOST => 0,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants