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

cURL error 56: SSL read: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac, errno 0 #74

Closed
duncan-qabana opened this issue Sep 16, 2016 · 10 comments

Comments

@duncan-qabana
Copy link

So after cache fail, a new one popped up for my clients. This time, I got no clue what is causing this, I tried reinstalling everything through composer, I restarted the services, checked my ssl cerificate. Nothing seems to have changed, anyone has this problem and a solution to it?

Fatal error: Uncaught exception 'Picqer\Financials\Exact\ApiException' with message 'cURL error 56: SSL read: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac, errno 0 (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)' in /vagrant/vendor/picqer/exact-php-client/src/Picqer/Financials/Exact/Connection.php:526 Stack trace: #0 /vagrant/vendor/picqer/exact-php-client/src/Picqer/Financials/Exact/Connection.php(192): Picqer\Financials\Exact\Connection->parseExceptionForErrorMessages(Object(GuzzleHttp\Exception\RequestException)) #1 /vagrant/vendor/picqer/exact-php-client/src/Picqer/Financials/Exact/Query/Findable.php(52): Picqer\Financials\Exact\Connection->get('crm/Accounts') #2 /vagrant/valvomo/include/application/class.Exact.php(891): Picqer\Financials\Exact\Account->get() #3 /vagrant/valvomo/include/application/class.Exact.php(718): Exact->checkCustomer(Object(Picqer\Financials\Exact\Connection), Array) #4 /vagrant/mijn/index.php(1067): Exact->postToExact() #5 {main} thrown in /vagrant/vendor/picqer/exact-php-client/src/Picqer/Financials/Exact/Connection.php on line 526

@duncan-qabana
Copy link
Author

Debugging it: \Query\Findable.php line 66: infinite loop:

while ($this->connection()->nextUrl !== null)
{
$nextResult = $this->connection()->get($this->connection()->nextUrl);
$result = array_merge($result, $nextResult);
}

@stephangroen
Copy link
Member

Have you tried on another server? And just the example.php file? Did you update of change the server this code runs on?

@duncan-qabana
Copy link
Author

duncan-qabana commented Sep 16, 2016

I tried it on my local instance, on the online dev env and the live website, the latter 2 give the error, my local hangs on the while loop. Nothing has been update since last week. Tried running the example.php locally in a new vagrant box, same result.

edit: used a default debian box from vagrant, exact the same result, works for getting division and making the connection, fails on the first ->get(); no matter the model.

@stephangroen
Copy link
Member

What code are you executing?

@duncan-qabana
Copy link
Author

duncan-qabana commented Sep 16, 2016

The connection is straight from the example, and then that code to get some results

$customersModel = new \Picqer\Financials\Exact\Account($connection);
$customers = $customersModel->get();

@stephangroen
Copy link
Member

I'm having no issues with this code using dev-master of this repo. Using a Laravel Homestead vagrant box for testing.

@duncan-qabana
Copy link
Author

it is really strange, a couple of lines above, I do:
$salesEntryModel = new \Picqer\Financials\Exact\SalesEntry($connection); $salesResults = $salesEntryModel->get();

and that works fine too. But then the second request to \Accounts fails either with that infinite loop or with the error in my first post. I am stuck at the moment of where to go now.

@duncan-qabana
Copy link
Author

Okay, going to leave it here for today:

  1. \Query\Findable.php line 66 causes infinite loop and a 504 gateway error.
  2. Thanks to the time out error, I get the SSL error. Restarting PHP fixes it.
  3. Running the composer command from the page along with the example.php gives the same problem when making 2 calls.
  4. Tried it on 3 custom debians wheezys, 1 default wheezy and 1 ubuntu 16.01

@duncan-qabana
Copy link
Author

Okay, fixed it.. There is a limit on how much you can get through this library. I made my own curl set up and started testing with that. I noted that there is a big loop if you have more then 100 records. With only curl that wasn't a problem. This library with that while loop crashes. I fixed it by limiting with ['$top'=> 50] and a loop around it to check if it completly filled.

@stephangroen
Copy link
Member

Thanks you for the info @duncan-qabana. We're using this library in production and haven't experienced this with one of our clients before. I'll note this for my README rewrite, that is some cases this might be a problem with getting too much results.

It's still odd this happens though.

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

No branches or pull requests

2 participants