Bug 1733934 - [IPI on Azure]Can't set length of spec.storage.azure.accountname value is equal to 3.
Summary: [IPI on Azure]Can't set length of spec.storage.azure.accountname value is equ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image Registry
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 4.6.0
Assignee: Oleg Bulatov
QA Contact: Wenjing Zheng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-29 09:10 UTC by XiuJuan Wang
Modified: 2020-10-27 15:54 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 15:54:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Not existing storage account (164.44 KB, image/jpeg)
2020-09-04 01:47 UTC, XiuJuan Wang
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 15:54:36 UTC

Description XiuJuan Wang 2019-07-29 09:10:27 UTC
Description of problem:
When set length to 2, prompt message "alidation failed: parameter=accountName constraint=MinLength value="zh" details: value length must be greater than or equal to 3".

But met 404 error when set length of spec.storage.azure.accountname value is equal to 3.

Version-Release number of selected component (if applicable):
4.2.0-0.nightly-2019-07-28-222114

How reproducible:
alwasy

Steps to Reproduce:
1.Set length of spec.storage.azure.accountname value is equal to 3
2.
3.

Actual results:
Met error:
  Storage:
    Azure:
      Account Name:  zhs
      Container:     image-registry-test
Status:
  Conditions:
    Last Transition Time:  2019-07-29T08:47:57Z
    Message:               Unable to get account primary keys: failed to get keys for the storage account zhs: storage.AccountsClient#ListKeys: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="The Resource 'Microsoft.Storage/storageAccounts/zhs' under resource group 'zhsun3-gzhhs-rg' was not found."
    Reason:                AzureError
    Status:                Unknown
    Type:                  StorageExists


Expected results:
Could set length of spec.storage.azure.accountname value between 3 and 24.

Additional info:

Comment 1 Corey Daley 2019-07-29 17:53:05 UTC
Can you please verify that you actually had an account with name "zhs" created on Azure?
It doesn't look like you got a name length failure, it was an account not found failure.

Comment 2 XiuJuan Wang 2019-07-30 02:20:08 UTC
Yeah, No ’zhs‘ created on Azure. The length of value 4-24 have been created for account name.

Comment 3 Corey Daley 2019-07-30 16:40:18 UTC
Closing as not a bug.

Comment 4 XiuJuan Wang 2019-07-31 01:59:55 UTC
We have message to announce 3 strings is vaild , however we can't create 3 strings for accountName. Shouldn't treat this as a issue?

Comment 5 Corey Daley 2019-07-31 02:38:53 UTC
Are you able to create an account name with three characters on Azure to test with?
According to your previous message, there was no "zhs" account on azure, hence the error that you recived about that account not existing.

Comment 6 XiuJuan Wang 2019-07-31 05:51:01 UTC
I could create a storage account with three chars manually on Azure.

Comment 7 XiuJuan Wang 2019-08-02 02:37:41 UTC
@Corey , IMO, this issue still is a problem, so I reopen it, feel free to correct me.

Comment 8 Corey Daley 2019-08-02 18:58:24 UTC
Ok, I must not be understanding then.
Could you please provide the steps that you are using to test this (in a good amount of detail) so I can try to figure out what I am missing here?

Comment 9 XiuJuan Wang 2019-08-05 03:16:21 UTC
Hi, Corey
Here is my reproduce steps,
1.install a ipi on azure cluster
2.Set spec.storage.azure.accountname with 3 chars.
$oc patch config.imageregistry.operator cluster -p  '{"spec":{"storage":{"azure":{"accountName":"wab"}}}}' --type=merge
3.Check imageregistry config.
$oc describe config.imageregistry.operator.

The storage account with 3 chars can't be created automaticlly when others with 4-24 chars do.

Comment 10 XiuJuan Wang 2019-08-12 08:25:14 UTC
Can't reproduce this issue with 4.2.0-0.nightly-2019-08-10-002649 payload.
Could you help move this bug to on_qa, so I can verify it?
Thanks

Comment 11 XiuJuan Wang 2019-08-13 02:14:37 UTC
Move to verified as comment #10.
Corey, thanks~

Comment 12 XiuJuan Wang 2019-09-11 02:58:05 UTC
Could reproduce the issue that can't set the length of spec.storage.azure.accountname value to 3 in 4.2.0-0.nightly-2019-09-10-235718 again.

Could handle the length 4:
$ oc describe config.image | grep Account -B2 -A2
  Storage:
    Azure:
      Account Name:  dudu
      Container:     qe-xiuwang-azure-911-j4rg2-test
Status:
--
  Storage:
    Azure:
      Account Name:  dudu
      Container:     qe-xiuwang-azure-911-j4rg2-test
  Storage Managed:   true


Will fail with the length 3, such as duo
$ oc describe config.image | grep Account -B2 -A2
  Storage:
    Azure:
      Account Name:  duo
      Container:     qe-xiuwang-azure-911-j4rg2-test
Status:
  Conditions:
    Last Transition Time:  2019-09-11T02:41:51Z
    Message:               Unable to get account primary key: failed to get keys for the storage account duo: storage.AccountsClient#ListKeys: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="The Resource 'Microsoft.Storage/storageAccounts/duo' under resource group 'qe-xiuwang-azure-911-j4rg2-rg' was not found."
    Reason:                AzureError
    Status:                False
--
    Type:                  Available
    Last Transition Time:  2019-09-11T02:41:51Z
    Message:               Unable to apply resources: unable to sync storage configuration: failed to get keys for the storage account duo: storage.AccountsClient#ListKeys: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="The Resource 'Microsoft.Storage/storageAccounts/duo' under resource group 'qe-xiuwang-azure-911-j4rg2-rg' was not found."
    Reason:                Error
    Status:                True
--
  Storage:
    Azure:
      Account Name:  dudu
      Container:     qe-xiuwang-azure-911-j4rg2-test
  Storage Managed:   true

Comment 13 Corey Daley 2019-09-11 15:44:16 UTC
Are you sure that the 3 letter long account name that you used exists?  I believe that was the issue last time.

"The Resource
'Microsoft.Storage/storageAccounts/duo' under resource group
'qe-xiuwang-azure-911-j4rg2-rg' was not found."

Comment 14 XiuJuan Wang 2019-09-17 02:16:15 UTC
@Corey, the 3 letter long account name does NOT exist which can't be created automaticlly, when name between 4-24 letters could be created automaticlly. So I treat it as a issue.
See https://github.com/openshift/cluster-image-registry-operator/blob/master/pkg/storage/azure/azure.go#L118-L121

Comment 15 Adam Kaplan 2019-11-07 20:10:09 UTC
Moving low priority 4.x bugs to 4.4.0

Comment 19 Oleg Bulatov 2020-07-08 14:09:46 UTC
$ oc describe config.image | grep Account -B2 -A2
  Storage:
    Azure:
      Account Name:  cil
      Container:     ci-ln-w8qjftb-002ac-ps5wx-image-registry-mwlfrdwkjebcvkmnevexd
Status:
--
--
  Storage:
    Azure:
      Account Name:  cil
      Container:     ci-ln-w8qjftb-002ac-ps5wx-image-registry-mwlfrdwkjebcvkmnevexd
  Storage Managed:   true

I tried to use the account name "cil", and the operator successfully created it. Can you still reproduce it?

Comment 22 XiuJuan Wang 2020-07-23 10:28:29 UTC
@Oleg I still could reproduce this issue with 4.6.0-0.nightly-2020-07-23-033606 version.
Does your `cli` accountname exist before you set up it? 

$oc describe config.image | grep Account -B2 -A2
  Storage:
    Azure:
      Account Name:  who
      Cloud Name:    AzurePublicCloud
      Container:     qeci-6585-7mphb-image-registry-rlelivtvbjcjgyfeiglgodleefcaicw
--
    Type:                  NodeCADaemonControllerDegraded
    Last Transition Time:  2020-07-23T10:22:01Z
    Message:               Unable to get account primary key: failed to get keys for the storage account who: storage.AccountsClient#ListKeys: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="The Resource 'Microsoft.Storage/storageAccounts/who' under resource group 'qeci-6585-7mphb-rg' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"
    Reason:                AzureError
    Status:                False
--
    Type:                  Available
    Last Transition Time:  2020-07-23T10:22:01Z
    Message:               Unable to apply resources: unable to sync storage configuration: failed to get keys for the storage account who: storage.AccountsClient#ListKeys: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="The Resource 'Microsoft.Storage/storageAccounts/who' under resource group 'qeci-6585-7mphb-rg' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"
    Reason:                Error
    Status:                True
--
  Storage:
    Azure:
      Account Name:  imageregistryqeci65l4wq4
      Cloud Name:    AzurePublicCloud
      Container:     qeci-6585-7mphb-image-registry-rlelivtvbjcjgyfeiglgodleefcaicw

=====================with 5 string account name======================

oc describe config.image | grep Account -B2 -A2
  Storage:
    Azure:
      Account Name:  whome
      Cloud Name:    AzurePublicCloud
      Container:     qeci-6585-7mphb-image-registry-rlelivtvbjcjgyfeiglgodleefcaicw
--
  Storage:
    Azure:
      Account Name:  whome
      Cloud Name:    AzurePublicCloud
      Container:     qeci-6585-7mphb-image-registry-rlelivtvbjcjgyfeiglgodleefcaicw

Comment 30 XiuJuan Wang 2020-09-04 01:47:08 UTC
Created attachment 1713698 [details]
Not existing storage account

Oleg, thanks
After check from Azure Web Console , I got 'imd' name is not taken and cmd also shows same thing.
$host imd.blob.core.windows.net
Host imd.blob.core.windows.net not found: 3(NXDOMAIN)

Then the 3 letter account could be created after configured.

  Storage:
    Azure:
      Account Name:    imd
      Cloud Name:      AzurePublicCloud
      Container:       xiuwang46azure-lsttk-image-registry-xdjghmfmtrrkneappkvveyblbi
    Management State:  Managed
  Storage Managed:     true
Events:                <none>

For improving the operator's error message for taken accounts, I will report a new bug.

Verified with 4.6.0-0.nightly-2020-09-02-210353 azure cluster.

Comment 33 errata-xmlrpc 2020-10-27 15:54:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.6 GA Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4196


Note You need to log in before you can comment on or make changes to this bug.