qiskit-community / qiskit-aqua

Quantum Algorithms & Applications (**DEPRECATED** since April 2021 - see readme for more info)
https://qiskit.org/aqua
Apache License 2.0
573 stars 376 forks source link

Aqua QSVM - 403 Client Error: ..... Error code: NOT_CREDITS_AVALIABLES. #698

Closed patdenim closed 4 years ago

patdenim commented 5 years ago

Informations

What is the current behavior?

Error message when running Aqua Qsvm : 403 Client Error: Forbidden for url: https://api-qcon.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/Jobs?access_token=.... NOT_CREDITS_AVALIABLES, Error code: NOT_CREDITS_AVALIABLES.

2019-10-04 10:26:25,814:qiskit.aqua.algorithms.many_sample.qsvm.qsvm:DEBUG: Building circuits:
|██████████████████████████████████████████████████| 435/435 [00:00:00:00]
2019-10-04 10:27:28,305:qiskit.aqua.utils.run_circuits:WARNING: FAILURE: Can not get job id, Resubmit the qobj to get job id.Error: 403 Client Error: Forbidden for url: https://api-qcon.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/Jobs?access_token=.... NOT_CREDITS_AVALIABLES, Error code: NOT_CREDITS_AVALIABLES.

We're running on Open device (vigo or ourence) and after a chunk of about 280 error messages (NOT_CREDITS_AVALIABLES) that took about 15 minutes, the jobs are successfully executed

2019-10-04 10:40:07,936:qiskit.aqua.utils.run_circuits:WARNING: FAILURE: Can not get job id, Resubmit the qobj to get job id.Error: 403 Client Error: Forbidden for url: https://api-qcon.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/Jobs?access_token=.... NOT_CREDITS_AVALIABLES, Error code: NOT_CREDITS_AVALIABLES. 
2019-10-04 10:40:10,330:qiskit.aqua.utils.run_circuits:WARNING: FAILURE: Can not get job id, Resubmit the qobj to get job id.Error: 403 Client Error: Forbidden for url: https://api-qcon.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/Jobs?access_token=.... NOT_CREDITS_AVALIABLES, Error code: NOT_CREDITS_AVALIABLES. 
2019-10-04 10:40:12,604:qiskit.aqua.utils.run_circuits:WARNING: FAILURE: Can not get job id, Resubmit the qobj to get job id.Error: 403 Client Error: Forbidden for url: https://api-qcon.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/Jobs?access_token=.... NOT_CREDITS_AVALIABLES, Error code: NOT_CREDITS_AVALIABLES. 
2019-10-04 10:40:15,213:qiskit.aqua.utils.run_circuits:WARNING: FAILURE: Can not get job id, Resubmit the qobj to get job id.Error: 403 Client Error: Forbidden for url: https://api-qcon.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/Jobs?access_token=.... NOT_CREDITS_AVALIABLES, Error code: NOT_CREDITS_AVALIABLES. 
2019-10-04 10:40:17,852:qiskit.aqua.utils.run_circuits:WARNING: FAILURE: Can not get job id, Resubmit the qobj to get job id.Error: 403 Client Error: Forbidden for url: https://api-qcon.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/Jobs?access_token=.... NOT_CREDITS_AVALIABLES, Error code: NOT_CREDITS_AVALIABLES. 
2019-10-04 10:40:20,443:qiskit.aqua.utils.run_circuits:WARNING: FAILURE: Can not get job id, Resubmit the qobj to get job id.Error: 403 Client Error: Forbidden for url: https://api-qcon.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/Jobs?access_token=.... NOT_CREDITS_AVALIABLES, Error code: NOT_CREDITS_AVALIABLES. 
2019-10-04 10:40:24,393:qiskit.aqua.utils.run_circuits:INFO: Backend status: BackendStatus(backend_name='ibmq_vigo', backend_version='1.0.1', operational=True, pending_jobs=5, status_msg='active')
2019-10-04 10:40:24,393:qiskit.aqua.utils.run_circuits:INFO: There are 6 jobs are submitted.
2019-10-04 10:40:24,393:qiskit.aqua.utils.run_circuits:INFO: All job ids:
['5d97025849e903001915bebf', '5d97025d06da890018816dad', '5d9702615110a30018ef0f93', '5d970266a5fb6b00194d23d9', '5d97026a65da3400187d2d7d', '5d9705765110a30018ef0f94']
2019-10-04 10:40:24,393:qiskit.aqua.utils.run_circuits:INFO: Running 0-th qobj, job id: 5d97025849e903001915bebf
2019-10-04 10:40:26,361:qiskit.aqua.utils.run_circuits:INFO: COMPLETED the 0-th qobj, job id: 5d97025849e903001915bebf
2019-10-04 10:40:26,361:qiskit.aqua.utils.run_circuits:INFO: Running 1-th qobj, job id: 5d97025d06da890018816dad
2019-10-04 10:40:27,822:qiskit.aqua.utils.run_circuits:INFO: COMPLETED the 1-th qobj, job id: 5d97025d06da890018816dad
2019-10-04 10:40:27,837:qiskit.aqua.utils.run_circuits:INFO: Running 2-th qobj, job id: 5d9702615110a30018ef0f93
2019-10-04 10:40:28,554:qiskit.aqua.utils.run_circuits:INFO: COMPLETED the 2-th qobj, job id: 5d9702615110a30018ef0f93
2019-10-04 10:40:28,554:qiskit.aqua.utils.run_circuits:INFO: Running 3-th qobj, job id: 5d970266a5fb6b00194d23d9
2019-10-04 10:40:29,673:qiskit.aqua.utils.run_circuits:INFO: COMPLETED the 3-th qobj, job id: 5d970266a5fb6b00194d23d9
2019-10-04 10:40:29,673:qiskit.aqua.utils.run_circuits:INFO: Running 4-th qobj, job id: 5d97026a65da3400187d2d7d
2019-10-04 10:40:30,978:qiskit.aqua.utils.run_circuits:INFO: COMPLETED the 4-th qobj, job id: 5d97026a65da3400187d2d7d
2019-10-04 10:40:30,978:qiskit.aqua.utils.run_circuits:INFO: Running 5-th qobj, job id: 5d9705765110a30018ef0f94 
.................................
.................................

Steps to reproduce the problem

dev_instance = QuantumInstance(dev_backend, shots=1024, seed_transpiler=50, circuit_caching=False) qsvm_result = qsvm.run(dev_instance)

What is the expected behavior?

Suggested solutions

Similar problem referenced in issue : Error connecting to quantum devices #584 with Aqua version 0.5. Supposed to be fixed in Aqua 0.6 I noticed issue https://github.com/Qiskit/qiskit/issues/395 in qiskit referencing "Error msg typo: NOT_CREDITS_AVALIABLES" but seems to be related to the typo only ?? :-)

woodsp-ibm commented 5 years ago

When Aqua, such as via the IBM Q Provider, ends up with a remote connection, we retry job to ensure its success so that the algorithm can run to completion. We do show errors along the way and refusals to run such as lack of credits. These errors are from the backend/provider and we merely react/show these. Since credits are restored over time then at some point jobs can be run again which seems to be what you are seeing.

In the future I would expect this logic in Aqua to delegate over to a WorkEngine as described by this issue in the IBMQ Provider. https://github.com/Qiskit/qiskit-ibmq-provider/issues/333

woodsp-ibm commented 4 years ago

@patdenim Can this now be closed or do you still have any issue around this?

patdenim commented 4 years ago

@woodsp-ibm hoops Sorry Steve, sure we can close it.