rancher / dashboard

The Rancher UI
https://rancher.com
Apache License 2.0
463 stars 261 forks source link

Shell fails to open in a pod #10840

Open IsaSih opened 7 months ago

IsaSih commented 7 months ago

Internal reference: SURE-8318

Setup

Describe the bug

Shell fails to open in a pod due to an unknown path/bin/sh: no such file or directory: unknown. According to the console logs, the error occurs in file ContainerShell.vue:319.

To Reproduce

  1. Create a downstream cluster (in this example, it's a GKE cluster)
  2. When the cluster is available, via UI, go to Workloads > Pods and click on the 3 dot button of any pod, then click on Execute Shell
  3. Observe the error message when the shell is open

Result Shell fails to open in a pod due to an unknown path/bin/sh: no such file or directory: unknown

Expected Result Shell should be open in a pod with no errors

Screenshots

Screenshot 2024-04-18 at 3 33 04 PM Screenshot 2024-04-12 at 1 48 51 AM
richard-cox commented 7 months ago

I wonder if this is related to changing the underlying image to BCI?

We should confirm if this is a bug in 2.7 and 2.8 as well

gaktive commented 6 months ago

Will file something for Mapps to figure out what we can do around new BCI behaviours. Ideally, the UI could detect that there is no shell and elegantly state there's nothing to shell into.

gaktive commented 6 months ago

@IsaSih when you get a moment, can you check the behaviour in 2.8.x? I don't know if we have to go back into 2.7.x at all but that may help if the problem existed somewhat earlier than 2.9.0

IsaSih commented 6 months ago

This issue does not occur in version 2.8-head. Tested on v2.8-94108186cf35028bb5f7db2c34c5ae99450dad9b-head

Screenshot 2024-04-25 at 10 13 43 AM
gaktive commented 6 months ago

Internal reference with Mapps: SURE-8318 May have to monitor here as that team works on that in case it comes back to UI or QA

nwmac commented 6 months ago

We should re-validate that this is still an issue - I believe this is down to a change in base image which does not contain sh - I think this may have been fixed - we should validate.

Should also add an automated test for this.

richard-cox commented 6 months ago

Worked through this with Neil.

The description shows pods with images not from Rancher, it looks like those just don't contain a shell so will never work.

I've brought up a new v2.9-head with the BCI change and can confirm some work

and some don't

I don't think this is a regression, but we need to make the error clearer. Two are the root failures and one is from the UI. We can do this by adding a return after each error and maybe some before our error.

gaktive commented 2 weeks ago

Holding on backport for now until someone picks this up to see what a solution looks like.