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 stat virt-vnc and virt-serial0 return error #8667

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

huyinhou
Copy link
Contributor

@huyinhou huyinhou commented Oct 26, 2022

the default base image for virt-handler is centos, which workdir is /. but we use a custom debian:buster as the base image, which workdir is /root.

when we run virtctl -n test vnc vm1, it reports an error:
Can't access VMI vm1: Internal error occurred: dialing virt-handler: websocket: bad handshake
I digged into this problem, and found that the virt-vnc sock path in getUnixSocketPath is proc/3484989/root/var/run/kubevirt-private/a44829ef-d44c-4a64-bf8a-2bcf274bad12/virt-vnc without leading '/'.
when it runs os.Stat with this path, it will return an error "no such file or directory".

so, I think maybe we can add a leading '/' to make an absolute path, it will work no matter what the workdir of the virt-handler image is.

Signed-off-by: huyinhou [email protected]

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

connect VM vnc failed when virt-launcher work directory is not /

…r as the base image

the default base image for virt-handler is centos, which workdir is /.
but we use a custom debian:buster as the base image, which workdir is /root.

when we run `virtctl -n test vnc vm1`, it reports an error:
Can't access VMI vm1: Internal error occurred: dialing virt-handler: websocket: bad handshake
I digged into this problem, and found that the virt-vnc sock path in `getUnixSocketPath`
is `proc/3484989/root/var/run/kubevirt-private/a44829ef-d44c-4a64-bf8a-2bcf274bad12/virt-vnc`
without leading '/'.
when it runs `os.Stat` with this path, it will return an error "no such file or directory".

so, I think maybe we can add a leading '/' to make an absolute path,
it will work no matter what the workdir of the virt-handler image is.

Signed-off-by: huyinhou <[email protected]>
@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 26, 2022
@kubevirt-bot
Copy link
Contributor

Hi @huyinhou. Thanks for your PR.

I'm waiting for a kubevirt 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.

@kubevirt-bot kubevirt-bot added size/XS needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 26, 2022
@huyinhou huyinhou changed the title fix stat virt-vnc and virt-serial0 return error when use debian:buste… fix stat virt-vnc and virt-serial0 return error Oct 26, 2022
Copy link
Member

@xpivarc xpivarc left a comment

Choose a reason for hiding this comment

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

/approve
/test all

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xpivarc

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 26, 2022
@huyinhou
Copy link
Contributor Author

/retest

@kubevirt-bot
Copy link
Contributor

@huyinhou: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 26, 2022
@rmohr
Copy link
Member

rmohr commented Oct 26, 2022

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 26, 2022
@brianmcarey
Copy link
Member

/test pull-kubevirt-fossa

@kubevirt-bot kubevirt-bot merged commit 11316e0 into kubevirt:main Oct 28, 2022
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants