Only 3 concurrent connections allowed

I have a little Node.js software that uses the OCR Space free API. It’s not finished or published yet, so I am the only one running it; for now only manually. It has worked fine so far.

But today it started giving me the error “ERROR: For this API KEY only 3 concurrent connections at the same time allowed. Contact support if you need more.”

Thing is, I don’t think I am having three or more concurrent connections. I start the app, it makes one request, receives results and then closes. Is it possible that the connections are left lingering? Do I need to manually close them?

Sorry about that. For the free API we rolled out a software update yesterday. But it turned out that in some situations the API did not count the number of connections correctly.

So meanwhile we restored the previous API version and the issue should be gone now.

The PRO OCR API was not affected.

Hi,

I have the same problem.
I run python requests one by one, but still getting error message " Only 3 …",
how properly close requests connection session in problem or this is another problem

This issue still persists. I am waiting 15 seconds between calls and I still receive the “3 concurrent connections” error.

15 seconds waiting should be more than enough (1-2 seconds should do).

If you test the connection with Postman, do you get the same result?

You probably know it, but just in case: Postman is a free Chrome app, see https://ocr.space/ocrapi#postman

If you see the problem even with Postman, a screenshot of the result could be helpful.

If the issue does not happen with Postman, than a snippet of the Python code would be helpful, so that we can recreate the issue.

same issue, i’m just using the python provided in documentation.

Hi everyone, thanks for reporting, I am also getting this strange bug off the FIRST and only request.

It sounds to me like their server may not be keeping up, and is sending a response back that is invalid. So we must wait for them to fix it.

LOVING this software by the way. Amazing.

@admin I think you guys still have a server side error to count connections, please fix asap :slight_smile: <3

Hi Guys, I have been having this issue as well and I think I might have solved it from the user end while waiting for them to fix the issue from their side. I simply disabled raising the exceptions, and used a try function for the parse. If it fails, I return none and attempt to send the request again instead of raising an error/exception and ending the program. Good luck!

1 Like

Yep that’s basically what I’ll be doing too. :frowning:

hi @admin ,
I am facing the same issue as all the others above. sometimes it is even occurs on the very first request - but seems very random. my nodeJs app is doing only one low-key request (via npm request), so not possible to be concurrent at all. I am able to get the error even with postman app, see the snippet below.

I am OK with doing such limitations on a free service, but the format of the “3 concurrent connections” response literally breaks my application (maybe I am not alone).

Why the
“For this API KEY only 3 concurrent connections at the same time allowed. Contact support if you need more.”
response arrives as the body and does not have the same error message format as the other error types you have? e.g.: with a dedicated OCRExitCode and this message in ParsedResults.ErrorMessage and ParsedResults.ErrorDetails.
That way error handling would be possible.

In the current case it wouldn’t solve the issue neither, as the errors are coming randomly even on single connection.

my example snippet where I get the error:

var request = require("request");

var options = { method: 'POST',
  url: 'https://api.ocr.space/parse/image',
  headers: 
   { 'Postman-Token': '*****************************',
     'cache-control': 'no-cache',
     apikey: '********************************',
     'content-type': 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' },
  formData: { language: 'hun', url: 'http://i.imgur.com/fwxooMv.png' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

thank you for fixing it as soon as possibble! OCR space free is still the best solution for pet projects! :slight_smile:

(edited grammar only)