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

fix: improve disk attach/detach error message #2093

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

umagnus
Copy link
Contributor

@umagnus umagnus commented Nov 28, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

[bug] improve attach error message
csi-attacher has limit for attach/detach error message. When the CSI error message length is more than 1024, it will get error:

I1127 02:46:27.220987       1 csi_handler.go:258] Failed to save attach error to "csi-9a0cbb0637aadd0e423ee0c25225b5d8d84e377a1d8a90ab5e05f2872e9964e3": VolumeAttachment.storage.k8s.io "csi-9a0cbb0637aadd0e423ee0c25225b5d8d84e377a1d8a90ab5e05f2872e9964e3" is invalid: status.attachError.message: Too long: must have at most 262144 bytes

Because of it, volumeattachment cannot save error message from csi, then it only get timeout error in pod events.

Which issue(s) this PR fixes:

Fixes #

Requirements:

Special notes for your reviewer:

test results:

Events:
  Type     Reason              Age                 From                     Message
  ----     ------              ----                ----                     -------
  Normal   Scheduled           21m                 default-scheduler        Successfully assigned default/nginx-azuredisk to aks-nodepool1-34988195-vmss000002
  Warning  FailedMount         71s (x9 over 19m)   kubelet                  Unable to attach or mount volumes: unmounted volumes=[azuredisk01], unattached volumes=[azuredisk01], failed to process volumes=[]: timed out waiting for the condition
  Warning  FailedAttachVolume  43s (x18 over 21m)  attachdetach-controller  AttachVolume.Attach failed for volume "pv-azuredisk" : rpc error: code = Internal desc = Attach volume /subscriptions/8ecadfc9-d1a3-4ea4-b844-0d9f87e4d7c8/resourcegroups/MC_aks-byokdisk_group_aks-byokdisk_eastus/providers/microsoft.compute/disks/pvc-disk2 to instance aks-nodepool1-34988195-vmss000002 failed with Retriable: false, RetryAfter: 0s, HTTPStatusCode: 403, RawError: {"error":{"code":"LinkedAuthorizationFailed","message":"The client 'e1bd9998-d829-4291-adca-c949ab1fe65a' with object id 'e1bd9998-d829-4291-adca-c949ab1fe65a' has permission to perform action 'Microsoft.Compute/virtualMachineScaleSets/virtualMachines/write' on scope '/subscriptions/8ecadfc9-d1a3-4ea4-b844-0d9f87e4d7c8/resourceGroups/mc_aks-byokdisk_group_aks-byokdisk_eastus/providers/Microsoft.Compute/virtualMachineScaleSets/aks-nodepool1-34988195-vmss/virtualMachines/2'; however, it does not have permission to perform action(s) 'Microsoft.Compute/diskEncryptionSets/read' on the linked scope(s) '/subscriptions/8ecadfc9-d1a3-4ea4-b844-0d9f87e4d7c8/resourceGroups/AKS-BYOKDISK_GROUP/providers/

Release note:

none

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 28, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @umagnus. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 28, 2023
@andyzhangx andyzhangx removed the request for review from edreed November 28, 2023 07:37
Copy link
Member

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 28, 2023
@andyzhangx andyzhangx changed the title [bug] improve attach error message fix: improve attach/detach error message Nov 28, 2023
@andyzhangx andyzhangx changed the title fix: improve attach/detach error message fix: improve disk attach/detach error message Nov 28, 2023
@andyzhangx
Copy link
Member

/retest

Copy link
Member

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 28, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx, umagnus

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 28, 2023
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Nov 28, 2023

@umagnus: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-azuredisk-csi-driver-e2e-capz-windows-2019 db53b1f link true /test pull-azuredisk-csi-driver-e2e-capz-windows-2019

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@andyzhangx andyzhangx merged commit 8ac1b36 into kubernetes-sigs:master Nov 29, 2023
25 of 27 checks passed
@andyzhangx
Copy link
Member

/cherrypick release-1.29

@andyzhangx
Copy link
Member

/cherrypick release-1.28

@andyzhangx
Copy link
Member

/cherrypick release-1.27

@andyzhangx
Copy link
Member

/cherrypick release-1.26

@k8s-infra-cherrypick-robot

@andyzhangx: new pull request created: #2096

In response to this:

/cherrypick release-1.29

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-infra-cherrypick-robot

@andyzhangx: #2093 failed to apply on top of branch "release-1.27":

Applying: improve attach error message
Using index info to reconstruct a base tree...
M	pkg/azuredisk/controllerserver.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/azuredisk/controllerserver.go
CONFLICT (content): Merge conflict in pkg/azuredisk/controllerserver.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 improve attach error message
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-1.27

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-infra-cherrypick-robot

@andyzhangx: new pull request created: #2097

In response to this:

/cherrypick release-1.28

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-infra-cherrypick-robot

@andyzhangx: #2093 failed to apply on top of branch "release-1.26":

Applying: improve attach error message
Using index info to reconstruct a base tree...
M	pkg/azuredisk/controllerserver.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/azuredisk/controllerserver.go
CONFLICT (content): Merge conflict in pkg/azuredisk/controllerserver.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 improve attach error message
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-1.26

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants