lmacken / quantumrandom

Tools for utilizing the ANU Quantum Random Number Generator
https://pypi.python.org/pypi/quantumrandom
148 stars 36 forks source link

Service Seems Blocked #34

Open WASasquatch opened 1 year ago

WASasquatch commented 1 year ago

On Colab, Windows, Linux, all on different networks, this service is now being blocked. It runs once, but any subsequent calls result in 500 Internal Service Error.

Example code

import quantumrandom

print(quantumrandom.get_data()) # Prints random number first time, 500 any time after

listn = quantumrandom.get_data(data_type='uint16', array_length=5) 

print(listn) # Always gives 500 error as it runs after first call

Here is the stacktrace from Colab which seems more detailed then cmd or terminal:

---------------------------------------------------------------------------

HTTPError                                 Traceback (most recent call last)

[<ipython-input-4-8ea9948681cd>](https://localhost:8080/#) in <cell line: 3>()
      1 import quantumrandom
      2 
----> 3 print(quantumrandom.get_data())
      4 
      5 listn = quantumrandom.get_data(data_type='uint16', array_length=5)

7 frames

[/usr/local/lib/python3.9/dist-packages/quantumrandom/__init__.py](https://localhost:8080/#) in get_data(data_type, array_length, block_size)
     58         'size': block_size,
     59     })
---> 60     data = get_json(url)
     61     assert data['success'] is True, data
     62     assert data['length'] == array_length, data

[/usr/local/lib/python3.9/dist-packages/quantumrandom/__init__.py](https://localhost:8080/#) in get_json(url)
     75 else:
     76     def get_json(url):
---> 77         return json.loads(urlopen(url).read().decode('ascii'))
     78 
     79 

[/usr/lib/python3.9/urllib/request.py](https://localhost:8080/#) in urlopen(url, data, timeout, cafile, capath, cadefault, context)
    212     else:
    213         opener = _opener
--> 214     return opener.open(url, data, timeout)
    215 
    216 def install_opener(opener):

[/usr/lib/python3.9/urllib/request.py](https://localhost:8080/#) in open(self, fullurl, data, timeout)
    521         for processor in self.process_response.get(protocol, []):
    522             meth = getattr(processor, meth_name)
--> 523             response = meth(req, response)
    524 
    525         return response

[/usr/lib/python3.9/urllib/request.py](https://localhost:8080/#) in http_response(self, request, response)
    630         # request was successfully received, understood, and accepted.
    631         if not (200 <= code < 300):
--> 632             response = self.parent.error(
    633                 'http', request, response, code, msg, hdrs)
    634 

[/usr/lib/python3.9/urllib/request.py](https://localhost:8080/#) in error(self, proto, *args)
    559         if http_err:
    560             args = (dict, 'default', 'http_error_default') + orig_args
--> 561             return self._call_chain(*args)
    562 
    563 # XXX probably also want an abstract factory that knows when it makes

[/usr/lib/python3.9/urllib/request.py](https://localhost:8080/#) in _call_chain(self, chain, kind, meth_name, *args)
    492         for handler in handlers:
    493             func = getattr(handler, meth_name)
--> 494             result = func(*args)
    495             if result is not None:
    496                 return result

[/usr/lib/python3.9/urllib/request.py](https://localhost:8080/#) in http_error_default(self, req, fp, code, msg, hdrs)
    639 class HTTPDefaultErrorHandler(BaseHandler):
    640     def http_error_default(self, req, fp, code, msg, hdrs):
--> 641         raise HTTPError(req.full_url, code, msg, hdrs, fp)
    642 
    643 class HTTPRedirectHandler(BaseHandler):

HTTPError: HTTP Error 500: Internal Server Error
claudefalbriard commented 1 year ago

Same issue here on my Colab project using quantumrandom package.

felixd commented 11 months ago

@claudefalbriard @WASasquatch Error 500 -> Quantum Service Quota was hit

WASasquatch commented 10 months ago

@claudefalbriard @WASasquatch Error 500 -> Quantum Service Quota was hit

So you get to use it once, then blocked? Lol πŸ˜‚πŸ˜†

WASasquatch commented 10 months ago

@claudefalbriard @WASasquatch Error 500 -> Quantum Service Quota was hit

So you get to use it once, then blocked? Lol πŸ˜‚πŸ˜†

You can't even test per directions cause you blocked right away. None of this is mentioned on repo or pypi.

https://pypi.org/project/quantumrandom/

claudefalbriard commented 10 months ago

Hello, thanks for checking it; After the first access, still getting error at the Python API , see the message below:Β Β  HTTPError: HTTP Error 500: Internal Server Error Regards,Β ClaudeΒ  On Sunday, August 27, 2023 at 01:40:26 PM GMT-3, WAS @.***> wrote:

@claudefalbriard @WASasquatch Error 500 -> Quantum Service Quota was hit

So you get to use it once, then blocked? Lol πŸ˜‚πŸ˜†

You can't even test per directions cause you blocked right away. None of this is mentioned on repo or pypi.

https://pypi.org/project/quantumrandom/

β€” Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

justinsloan commented 2 months ago

It seems this is not an issue with the quantumrandom package, but rather the service provider ANU. They have switched to a paid model, but still offer a modest plan for free. The old service can still be accessed at the rate of one request per minute, but will eventually be phased out.

WASasquatch commented 2 months ago

I think they are blocking robots. It will work once and then never again on my IP without changing it. Not that it works once every minute. Never again.

On Sat, May 4, 2024, 2:22β€―PM Justin @.***> wrote:

It seems this is not an issue with the quantumrandom package, but rather the service provider ANU https://qrng.anu.edu.au/. They have switched to a paid model https://quantumnumbers.anu.edu.au/pricing, but still offer a modest plan for free. The old service can still be accessed at the rate of one request per minute, but will eventually be phased out.

β€” Reply to this email directly, view it on GitHub https://github.com/lmacken/quantumrandom/issues/34#issuecomment-2094401068, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIZEZJLJPF3YZTMXOV45ZLZAVGSNAVCNFSM6AAAAAAXEIPALSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJUGQYDCMBWHA . You are receiving this because you were mentioned.Message ID: @.***>