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

qibo-client 404 error #39

Closed
BrunoLiegiBastonLiegi opened this issue May 10, 2024 · 6 comments
Closed

qibo-client 404 error #39

BrunoLiegiBastonLiegi opened this issue May 10, 2024 · 6 comments
Assignees

Comments

@BrunoLiegiBastonLiegi
Copy link
Contributor

BrunoLiegiBastonLiegi commented May 10, 2024

Running the example shown in the readme results in a connection error.

[2024-05-10 12:56:09,926] INFO: Post new circuit on the server
---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
Cell In[4], line 2
      1 # run the circuit
----> 2 result = client.run_circuit(circuit, nshots=1000, device="sim")

File ~/python_envs/qibo/lib/python3.11/site-packages/qibo_client/qibo_client.py:167, in Client.run_circuit(self, circuit, nshots, device)
    164 logger.info("Post new circuit on the server")
    166 try:
--> 167     self._post_circuit(circuit, nshots, device)
    168 except JobPostServerError as err:
    169     logger.error(err.message)

File ~/python_envs/qibo/lib/python3.11/site-packages/qibo_client/qibo_client.py:195, in Client._post_circuit(self, circuit, nshots, device)
    192 response = requests.post(url, json=payload, timeout=constants.TIMEOUT)
    194 # checks
--> 195 response.raise_for_status()
    196 check_response_has_keys(response, ["pid", "message"])
    198 # save the response

File ~/python_envs/qibo/lib/python3.11/site-packages/requests/models.py:1021, in Response.raise_for_status(self)
   1016     http_error_msg = (
   1017         f"{self.status_code} Server Error: {reason} for url: {self.url}"
   1018     )
   1020 if http_error_msg:
-> 1021     raise HTTPError(http_error_msg, response=self)

HTTPError: 404 Client Error: Not Found for url: https://cloud.qibo.science/run_circuit/

I am using qibo-client/main.
This is blocking some developments in qibo-cloud-backends (qiboteam/qibo-cloud-backends#20, qiboteam/qibo-cloud-backends#7) and qibo indirectly (qiboteam/qibo#1282).

@scarrazza
Copy link
Member

@BrunoLiegiBastonLiegi thanks. I believe this is due to the new quota system, cc @marcorossi5.

@marcorossi5
Copy link
Contributor

This is due to the following lines:

https://github.com/qiboteam/qibo-webapp/blob/7edd2b389074650a4c3ce0d3574e235871f5ddd5/src/accounts/views.py#L84-L85

Both of try to access objects that are not present in the database. We should fix the fixtures to correctly load the objects in the database schema.

@scarrazza
Copy link
Member

@marcorossi5 thanks, could you please take care of this and deploy the new website?

@BrunoLiegiBastonLiegi
Copy link
Contributor Author

Hi, I noticed that a fix for this has been merged. However, I still get the 404 error by simply running the code example.
I don't think it's due to my token being wrong, because the same error happens in qibo-cloud-backends main https://github.com/qiboteam/qibo-cloud-backends/actions/runs/8917928327/job/25510345685.

@scarrazza
Copy link
Member

@marcorossi5 for completeness, please find below the circuit which is generating issues during the json encoding:

from qibo.quantum_info import random_clifford
from qibo import gates

circuit = random_clifford(3)
circuit.add(gates.M(0, 2))

@scarrazza
Copy link
Member

This is now fixed in Qibo.

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