microsoft / mindaro

Bridge to Kubernetes - for Visual Studio and Visual Studio Code
MIT License
307 stars 106 forks source link

'Access to path is denied' error #218

Open callum94b opened 3 years ago

callum94b commented 3 years ago

Up until about 1-2 weeks ago we were using bridge to kubernetes to successfully run services on our machines and connect to a cluster. However around that time we started having issues where the replacement pod (using the bridgetokubernetes.azurecr.io/lpkremoteagent:0.1.7 image) would enter a crashloop when it tried to start up and every time it will throw the same error (attached) saying 'Access to the path '/proc/1/map_files' is denied.' . Everything up to that point still seems to work as it did before, connecting to the cluster, choosing the service you want to replace, altering the hosts file to redirect services etc.

The stacktrace that is output by the replacement pod is attached here: BridgeToKubernetesErr.txt

Environment Details Client used (VS Code/Visual Studio): VS Code Client's version: v1.0.120210803 Operating System: OSX (K8s env is in Linux)

pragyamehta commented 3 years ago

Hi @callum94b Thanks for reporting this, we will investigate and get back to you. Thanks!

pragyamehta commented 3 years ago

Hi @callum94b Can you try this scenario with an older version of the extension and see if this issue reproduces for you?

callum94b commented 3 years ago

So I tried the two versions below from 2 months ago (when it was definitely working for us) and it behaved the same. Crashloop with the same stacktrace as before.

v1.0.120210803 v1.0.120210605

shalev123d commented 3 years ago

Hi, issue occurs in our environment as well

rakeshvanga commented 3 years ago

@shalev123d Thanks for letting us know. We are investigating this issue and update the thread once we find out a solution.

pragyamehta commented 3 years ago

Hi @callum94b and @shalev123d can you set the below environment variable and then open the IDE and try debugging? BRIDGE_DEVHOSTIMAGENAME=lpkremoteagent:20210708.3

Please let us know if you are able to repro.

shalev123d commented 3 years ago

Hi @pragyamehta This new image seems to solve the issue! I have set the variable value to "bridgetokubernetes.azurecr.io/lpkremoteagent:20210708.3" and not "lpkremoteagent:20210708.3" Is this part of the solution to #147? And if so can we have the rest of the environment variables names? this would help us a lot

Thanks!

callum94b commented 3 years ago

I tried with the same value as shalev and that image seems to solve our problem. Everything works as before now

Thanks so much guys!

pragyamehta commented 3 years ago

Thanks for trying out the new steps and I'm happy it worked for you. This looks like a regression in our code and we are trying to figure out the root cause. We will update the thread once we have more information to share.

lolodi commented 3 years ago

Hello @shalev123d, @callum94b I am not able to repro this issue, but I had a guess of what the problem is and I created a modified image of the latest version with the potential fix. Could you please try it out and let me know if this also fix the issue?

BRIDGE_DEVHOSTIMAGENAME=lolodi/devhostagent:20210909.1

Thanks!

hellsnow commented 2 years ago

Hello @shalev123d, @callum94b I am not able to repro this issue, but I had a guess of what the problem is and I created a modified image of the latest version with the potential fix. Could you please try it out and let me know if this also fix the issue?

BRIDGE_DEVHOSTIMAGENAME=lolodi/devhostagent:20210909.1

Thanks!

How can I set this varialbe? Thanks

amsoedal commented 2 years ago

@hellsnow if you're using VS Code, you can add it to the launch.json file for your project: https://stackoverflow.com/questions/48595446/is-there-any-way-to-set-environment-variables-in-visual-studio-code

In VS you can add it to the Debug profile in the "Environment variables" section. Hope this helps!

Edit: My colleague pointed it out that you might need to set it even earlier. If the above doesn't work, you can try: 1) setting the environment variable on the command line, e.g. $env:BRIDGE_DEVHOSTIMAGENAME="lolodi/devhostagent:20210909.1" in powershell, and then 2) opening VS Code from the same shell like code ./your/path

JackSilk commented 2 years ago

Hi @lolodi your custom image also fixes the problem