collect fails with "ValueError: Parameter 'subscription_id' must not be None"
- Dominant language
- Python
- Stars
- 2
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
I was able to successfully deploy an environment in my Azure subscription. Attempts to run the "collect" action consistently failed with following traceback:

After increasing the log level and adding some additional logging, the issue was traced to the `batch_handler.py` script that was attempting to find the `subscription_id` from a `subscription_name`
`892: env["SUBSCRIPTION"] = get_subscription_id(env["SUBSCRIPTION"])`
```
def get_subscription_id(subscription_name):
credential = DefaultAzureCredential()
subscription_client = SubscriptionClient(credential)
for sub in subscription_client.subscriptions.list():
if sub.display_name == subscription_name:
log.info(f"Subscription found: {sub.subscription_id}")
return sub.subscription_id
log.info(f"Subscription_ID found is: NONE")
return None
```
A quick and dirty workaround was to comment out line #892 and hardcode my subscription_id:
```
892: #env["SUBSCRIPTION"] = get_subscription_id(env["SUBSCRIPTION"])
893: env["SUBSCRIPTION"] =
```
This worked as the pool, job and tasks were successfully created:
```
(hpcadvisor-py3.12) bash-3.2$ ./hpcadvisor collect -n jm2502171356kur -u ../examples/matrixmult/ui_defaults.yaml
/Users/jmorey/batch_projects/hpcadvisor/src/hpcadvisor/batch_handler.py:792: SyntaxWarning: invalid escape sequence '\+'
f"/bin/bash -c 'export HOSTLIST_PPN=$(paste -d, -s <(sed \"s/ slots=[0-9]\+/:{ppn}/\" $HOSTFILE_PATH)); set ; source {anfmountdir}/{app_run_script} ; cd {fulltaskrundir}; {HPCADVISOR_FUNCTION_RUN}'",
Using existing tasks file: /Users/jmorey/.hpcadvisor/jm2502171356kur/tasks.json
Starting tasks...this may take a while
Create pool: pool-2502181035xlt
Pool pool-2502181035xlt created!
create job: job-2502181035pij
Job [job-2502181035pij] created!
Creating setup task for jobid=job-2502181035pij
Task [task-app-setup-2502181035daq] created!
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.