azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

Error on create Azure Red Hat Openshift with azure-cli-extensions

Open konosuke115 opened this issue 6 years ago • 13 comments

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az aro create Extension Name: aro. Version: 0.1.0.

Errors:

'NoneType' object has no attribute 'object_id'
Traceback (most recent call last):
python3.6/site-packages/knack/cli.py, ln 206, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 608, in execute
    raise ex
cli/core/commands/__init__.py, ln 666, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
cli/core/commands/__init__.py, ln 659, in _run_job
    six.reraise(*sys.exc_info())
...
cli/core/commands/__init__.py, ln 306, in __call__
    return self.handler(*args, **kwargs)
azure/cli/core/__init__.py, ln 493, in default_command_handler
    return op(**command_args)
cliextensions/aro/azext_aro/custom.py, ln 65, in aro_create
    assign_contributor_to_vnet(cmd.cli_ctx, vnet, rp_client_sp.object_id)
AttributeError: 'NoneType' object has no attribute 'object_id'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here...
  • az aro create -g {} -n {} --vnet {} --master-subnet {} --worker-subnet {}

Expected Behavior

Environment Summary

Linux-4.15.0-1071-azure-x86_64-with-debian-stretch-sid
Python 3.6.5

azure-cli 2.1.0

Extensions:
aro 0.1.0

Additional Context

konosuke115 avatar Mar 09 '20 07:03 konosuke115

az openshift is now included in the main Azure CLI: https://docs.microsoft.com/en-us/cli/azure/openshift?view=azure-cli-latest

Could you try the new commands?

jiasli avatar Mar 09 '20 12:03 jiasli

Thank you @jiasli

I tried az openshift create. But the following error statement was output.

Operation failed with status: 'Bad Request'. Details: An error has occurred in subscription 00cf50e4-14b0-4dc2-b58c-05db8a8c2c31, resourceGroup: giki-take-aro-rg request: [invalid properties.authProfile.identityProviders["Azure AD"]: could not authenticate: adal: Refresh request failed. Status Code = '400'. Response body: {"error":"unauthorized_client","error_description":"AADSTS700016: Application with identifier '4f5f6255-6b1f-47d2-a552-578b195f28c7' was not found in the directory 'dfab78d7-91cf-4743-8880-ccb6825e4fdf'. This can happen if the application has not been installed by the administrator of the tenant or consented to byany user in the tenant. You may have sent your authentication request to the wrong tenant.\r\nTrace ID: a1a056f3-f9e1-48f0-b4fa-b245f5c7f700\r\nCorrelation ID:48f5d17f-d93c-4102-9311-98d0928dea5d\r\nTimestamp: 2020-03-10 01:45:11Z","error_codes":[700016],"timestamp":"2020-03-10 01:45:11Z","trace_id":"a1a056f3-f9e1-48f0-b4fa-b245f5c7f700","correlation_id":"48f5d17f-d93c-4102-9311-98d0928dea5d","error_uri":"https://login.microsoftonline.com/error?code=700016"}].

I think I don't have the required permissions What permissions do you need?

Also, is it possible to create an Azure Red Hat Openshfit by preparing a new AAD (no subscription) separately from the current AAD / subscription?

konosuke115 avatar Mar 10 '20 01:03 konosuke115

This seems to be credential issue. Could you re-login with

az account clear
az login

If you login with a service principal, make sure --tenant is correct. Also make sure you are targeting the correct subscription using

az account show
az account set -s {}

For this question,

Also, is it possible to create an Azure Red Hat Openshfit by preparing a new AAD (no subscription) separately from the current AAD / subscription?

Usually all Azure resources need to be in some subscription for billing purpose. But I'd rather leave it to AKS service team to answer. @jluk

jiasli avatar Mar 10 '20 02:03 jiasli

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc

ghost avatar Mar 10 '20 02:03 ghost

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc

ghost avatar Mar 10 '20 02:03 ghost

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/aks-pm

ghost avatar Mar 10 '20 02:03 ghost

We will need to reroute this to the ARO product team.

jluk avatar Mar 10 '20 03:03 jluk

@amanohar

sauryadas avatar Mar 10 '20 04:03 sauryadas

az openshift & az aro commands are for different version of ARO: az openshift works for ARO 3.11 and az aro is for ARO 4.3 (and is currently under preview). Ack on the reported issue. We will take a look.

@konosuke115 what version of ARO are you deploying?

amanohar avatar Mar 10 '20 04:03 amanohar

Thank you @amanohar

I want to try creating ARO 4.3.

At the time of the first error, the documentation I used is below

https://docs.microsoft.com/en-us/azure/openshift/howto-using-azure-redhat-openshift az aro create \ -g "$RESOURCEGROUP" \ -n "$CLUSTER" \ --vnet vnet \ --master-subnet "$CLUSTER-master" \ --worker-subnet "$CLUSTER-worker"

konosuke115 avatar Mar 10 '20 04:03 konosuke115

Now I tried again and got another error.

Konosuke115@Azure:~ $ az aro create -g giki-take-aro-rg -n giki-take-aro --vnet vnet --master-subnet aro-master --worker-subnet aro-worker This command group is in preview. It may be changed/removed in a future release. The resource type could not be found in the namespace 'Microsoft.RedHatOpenShift' for api version '2019-12-31-preview'.

I'm sorry. In the first run, I may have forgotten to run the following command.

az provider register -n Microsoft.RedHatOpenShift --wait

konosuke115 avatar Mar 10 '20 04:03 konosuke115

Thanks for the error report. It makes sense that you got that error having not registered the RP first. We'll add in a better error message at https://github.com/Azure/ARO-RP/pull/264 .

jim-minter avatar Mar 10 '20 14:03 jim-minter

Looks like the error message has been updated. Closing this for now.

Jen7714 avatar May 29 '20 16:05 Jen7714