fuzzbench icon indicating copy to clipboard operation
fuzzbench copied to clipboard

Cloud Config: Improve error message for deleting an experiment that doesn't exist.

Open mvanotti opened this issue 2 years ago • 1 comments

Today I tried to delete an experiment twice, and the error message returned by stop_experiment.py was not really clear:

DEBUG:googleapiclient.discovery:URL being requested: GET https://compute.googleapis.com/compute/v1/projects/google.com%3Amyproject/zones/us-central1-a/instances?alt=json
DEBUG:google_auth_httplib2:Making request: POST https://oauth2.googleapis.com/token
Traceback (most recent call last):
  File "/data/fuzzbench/experiment/stop_experiment.py", line 77, in <module>
    sys.exit(main())
  File "/data/fuzzbench/experiment/stop_experiment.py", line 73, in main
    return 0 if stop_experiment(sys.argv[1], sys.argv[2]) else 1
  File "/data/fuzzbench/experiment/stop_experiment.py", line 40, in stop_experiment
    instances = list(gce.get_instances(cloud_project, cloud_compute_zone))
  File "/data/fuzzbench/common/gce.py", line 47, in get_instances
    for instance in _get_instance_items(project, zone):
  File "/data/fuzzbench/common/gce.py", line 39, in _get_instance_items
    for instance in response['items']:
KeyError: 'items'

It would be nice if the script displays a better error message for the user.

mvanotti avatar Apr 04 '23 21:04 mvanotti

Good point! Would you like to create a PR to include the error message that you desire?

We would really appreciate that.

DonggeLiu avatar Apr 10 '23 23:04 DonggeLiu