Qiskit / qiskit-ibm-runtime

IBM Client for Qiskit Runtime
https://docs.quantum.ibm.com/api/qiskit-ibm-runtime
Apache License 2.0
158 stars 156 forks source link

session.close() does not work #476

Closed nonhermitian closed 2 years ago

nonhermitian commented 2 years ago

Describe the bug Doing session.close() gives

RequestsApiError: '404 Client Error: Not Found for url: https://runtime-us-east.quantum-computing.ibm.com/sessions/cbuha1tlktk3613uee3g/close. {"errors":[{"code":"not_found","message":"unknown session","more_info":"https://cloud.ibm.com/apidocs/quantum-computing#error-handling"}],"trace":"cbuha6olvap7pf91jfr0"}'

Steps to reproduce Try to close a session

Expected behavior I can close a session

Suggested solutions

Additional Information

kt474 commented 2 years ago

@nonhermitian are you still having this issue? Can you paste your code - wasn't able to replicate to issue

renier commented 2 years ago

I can recreate this issue with the following program using the main branch:

from qiskit_ibm_runtime import QiskitRuntimeService, Sampler, Session, Options
from qiskit.test.reference_circuits import ReferenceCircuits

service = QiskitRuntimeService()

session = Session(service=service, max_time=int(2.5*60*60))

sampler = Sampler(session=session, options=Options(backend="my_backend"))

job = sampler.run(ReferenceCircuits.bell())

print(job.job_id)
session.close()
renier commented 2 years ago

It doesn't seem consistent, though.

renier commented 2 years ago

It looks like the queue is returning 404 if the job that created the session is still running. Opening an issue with that team.

jyu00 commented 2 years ago

This is fixed