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

az iot ops support create-bundle fails with Invalid kube-config file. No configuration found. #28152

Closed
BillmanH opened this issue Jan 8, 2024 · 4 comments
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. IoT/CLI IoT Service Attention This issue is responsible by Azure service team.

Comments

@BillmanH
Copy link

BillmanH commented Jan 8, 2024

Describe the bug

az iot ops support create-bundle --ops-service dataprocessor or az iot ops support create-bundle. Fails on run. Doesn't do anything. The docs suggest that "If auto is selected, the operation will detect which services are available.", but doesn't seem to.

I can't figure out how to specify the config file, or what should be there. Can you help understand what the API is looking for?

Related command

  • az iot ops support create-bundle
  • az iot ops support create-bundle --ops-service auto
  • az iot ops support create-bundle --ops-service dataprocessor

Errors

Command group 'iot ops' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
The command failed with an unexpected error. Here is the traceback:

Invalid kube-config file. No configuration found.
Traceback (most recent call last):
  File "/usr/lib64/az/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/home/william/.azure/cliextensions/azure-iot-ops/azext_edge/edge/commands_edge.py", line 31, in support_bundle
    load_config_context(context_name=context_name)
  File "/home/william/.azure/cliextensions/azure-iot-ops/azext_edge/edge/providers/base.py", line 41, in load_config_context
    config.load_kube_config(context=context_name)
  File "/home/william/.azure/cliextensions/azure-iot-ops/kubernetes/config/kube_config.py", line 815, in load_kube_config
    loader = _get_kube_config_loader(
  File "/home/william/.azure/cliextensions/azure-iot-ops/kubernetes/config/kube_config.py", line 772, in _get_kube_config_loader
    raise ConfigException(
kubernetes.config.config_exception.ConfigException: Invalid kube-config file. No configuration found.
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Issue script & Debug output

Just running the commend from the CLI. No script involved.

Expected behavior

Per the docs, expected behavior is:
"Creates a standard support bundle zip archive for use in troubleshooting and diagnostics."

Environment Summary

azure-cli 2.55.0

core 2.55.0
telemetry 1.1.0

Extensions:
ai-examples 0.2.5
azure-iot 0.21.2
azure-iot-ops 0.2.0b1
ml 2.22.0
ssh 2.0.2

Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2

Python location '/usr/bin/python3.9'
Extensions directory '/home/william/.azure/cliextensions'
Extensions system directory '/usr/lib/python3.9/site-packages/azure-cli-extensions'

Python (Linux) 3.9.14 (main, Oct 12 2023, 19:48:32)
[GCC 11.2.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

Thanks for the help!

@BillmanH BillmanH added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jan 8, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. IoT Service Attention This issue is responsible by Azure service team. Auto-Assign Auto assign by bot IoT/CLI labels Jan 8, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Jan 8, 2024

Thank you for opening this issue, we will look into it.

Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-iot-cli-triage.

@digimaun
Copy link
Member

digimaun commented Jan 8, 2024

Hi @BillmanH that command needs direct access to your cluster, where configuring direct access (cluster ip, client certs etc) are defined in the kubeconfig similar to how kubectl works.

Typically its located at ~/.kube/config. Is your kubeconfig in a different location?

If you don't have a kubeconfig but you have an arc connected cluster, you can first run the following commad from the connectedk8s extension az connectedk8s proxy -n mycluster -g myrg to create a temporary proxy between your local environment and the target arc connected cluster, the command generates and merges a suitable kubeconfig to interact with the cluster through the proxy. While the proxy is running, the az iot ops support create-bundle operations you listed should work.

@BillmanH
Copy link
Author

BillmanH commented Jan 8, 2024

Hey thanks, this is useful. I was using cloud shell, thinking that the bundle is created based on the logs in the cloud deployment, not the edge. Running this on my IoT device, where the path is properly mounted solved the issue.

@BillmanH BillmanH closed this as completed Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. IoT/CLI IoT Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants