Azure/Bridge-To-Kubernetes

file path issue with local dev win11 and remote explorer on ubuntu linux

Daxcor69 opened this issue · 9 comments

Describe the bug
When using the exact same code that is in production, running it through the bridge, the code is not able to find assets in the file system on the remote machine.

Mention the platform you are using
Mention what platform you are using (oss, vscode) and pick the corresponding label.
vscode 1.82.0
bridge 2.0.120230817
remote ubuntu: Linux dev1 5.15.0-82-generic #91-Ubuntu SMP Mon Aug 14 14:14:14 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
windows 11 home vscode run as admin.
ubuntu user account for remote, is NOT admin, but is granted sudo privileges.

To Reproduce
Steps to reproduce the behavior:
setup bridge, run code, hit browser link (isolated)

Expected behavior
A clear and concise description of what you expected to happen.
website should load

Screenshots
If applicable, add screenshots to help explain your problem.
website error
image
sample of code that is generating the error
image

Logs:

  • Please attach logs for Bridge to Kubernetes to triage issues faster, here are the log locations ( Window like C:\Users\Username\AppData\Local\Temp\Bridge To Kubernetes, Linux/Mac like $HOME/tmp/Bridge To Kubernetes or /tmp/Bridge To Kubernetes). Please attach logs relevant to your issue or bug.
    2023-09-08T19:47:33.2466399Z | MindaroCli | TRACE | Event: Command.Start {"properties":{"Arguments":"--version","IsRoutingEnabled":"false"},"metrics":null}\nOperation context: {"clientRequestId":null,"correlationId":"2c385883-817b-4613-b860-accb9adff5f91694202452262:d4353226cc88","requestId":null,"userSubscriptionId":null,"startTime":"2023-09-08T19:47:33.1845432+00:00","userAgent":"VSCode/2.0.120230817","requestHttpMethod":null,"requestUri":null,"version":"1.0.20230811.2","requestHeaders":{},"loggingProperties":{"ApplicationName":"MindaroCli","DeviceOperatingSystem":"Microsoft Windows 10.0.22621","Framework":".NET 7.0.7","MacAddressHash":"bed45ee23173837c784be65a45965f9003debecae430ea9cf3c2fb5cc42b94a9","ProcessId":5364,"TargetEnvironment":"Production","CommandId":"d4353226cc88"}}
    2023-09-08T19:47:33.2892076Z | MindaroCli | TRACE | Event: Command.End {"properties":{"Arguments":"--version","Result":"Succeeded"},"metrics":{"Duration":57}}

** More Info **

I am running vscode at home on a windows machine. I am then connecting to the source code on a remote ubuntu machine using the remote explorer functionality of vscode. I am running vscode as admin, and the remote machine account is a normal user with sudo privledges. I am bridging to a k8s cluster on digital ocean. the remote explorer and the kubernetes extension all work as expected in isolation. The only thing that was weird, was that I had to hand edit the hosts file on my windows machine for the isolated url to work. Here is the configurations for vscode launch and task.

{
	"version": "2.0.0",
	"tasks": [
		{
			"label": "bridge-to-kubernetes.resource",
			"type": "bridge-to-kubernetes.resource",
			"resource": "mainsite-server",
			"resourceType": "service",
			"ports": [
				8080
			],
			"targetCluster": "<redacted>",
			"targetNamespace": "development",
			"useKubernetesServiceEnvironmentVariables": true,
			"isolateAs": "brad-f2b4"
		}
	]
}

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program with Kubernetes",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "program": "${file}",
            "preLaunchTask": "bridge-to-kubernetes.resource",
            "env": {
                "GRPC_DNS_RESOLVER": "native"
            }
        },
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "program": "${file}"
        }
    ]
}```

Please help I can't remove bridge components from my cluster! I have closed vscode and manually remove all of the deployments, jobs, ingress and services and they keep restarting. What is controlling all of this behaviour? Please if you can't help with the bug, at least show me how to clean up this mess.

@Daxcor69 Thanks for raising the concern. bridge will put back your cluster to its original state in few mins since it will check if there are any active session. There is pod with name restore which will take care of this, if you can send logs of this pod I can help if it doesn't. Regarding your other issue of manually editing host files - are you using ingress like nginx ? if so yes you need to hand edit, this will be a feature request to make bridge to edit host files automatically, I am not even sure if we can do that, I need to talk with my team about it. Thanks.

there is no pod "restore" I most likely deleted it try to remove the components.

@Daxcor69 Did your cluster go back to original state ? Please share logs from /tmp/Bridge To Kubernetes folder since you are running bridge from remote ubuntu. thanks.

No it did not. The "restore" pod is not there. here are the logs.

brad@dev1:/tmp/Bridge To Kubernetes$ cat bridge-mindarocli-2023-09-08-20-24-40-606190.txt
2023-09-08T20:24:41.4462020Z | MindaroCli | TRACE | Event: Command.Start {"properties":{"Arguments":"check-credentials --namespace development","IsRoutingEnabled":"false"},"metrics":null}\nOperation context: {"clientRequestId":null,"correlationId":"b155b774-a242-44f9-b196-e285bd9fef4b1694204659764:ffb5f65b1796","requestId":null,"userSubscriptionId":null,"startTime":"2023-09-08T20:24:40.9935858+00:00","userAgent":"VSCode/2.0.120230817","requestHttpMethod":null,"requestUri":null,"version":"1.0.20230811.2","requestHeaders":{},"loggingProperties":{"ApplicationName":"MindaroCli","DeviceOperatingSystem":"Linux 5.15.0-82-generic #91-Ubuntu SMP Mon Aug 14 14:14:14 UTC 2023","Framework":".NET 7.0.7","MacAddressHash":"0000000000000000000000000000000000000000000000000000000000000000","ProcessId":606190,"TargetEnvironment":"Production","CommandId":"ffb5f65b1796"}}
2023-09-08T20:24:41.7561017Z | MindaroCli | TRACE | Running Microsoft.BridgeToKubernetes.Exe.Commands.Connect.CheckCredentialsCommand...
2023-09-08T20:24:45.4845341Z | MindaroCli | TRACE | Event: Command.End {"properties":{"Arguments":"check-credentials --namespace development","Result":"Succeeded"},"metrics":{"Duration":4250}}

@Daxcor69 Are you still facing issues ? Thanks for the logs, I don't see any issues from the logs.

The associated pods did eventually stop. That is very weird. I have abandoned the effort to make this work, due to a lack of support. I posted a very specific problem and never got a response. The only thing you picked up on was how to remove it and attempted to help, which you did not. Your documentation on this product is lacking and was not able to help in anyway. This would be such a huge help to development in the k8s world, but the product has issues and is not supported very well.

This is the same old same old run around with tools and packages. Great idea, lets code it, it works but has issues, create simple technical docs that don't help, and then release it to the wild, and offer support when we get around to it. Why bother releasing the project in the first place? You just waste our time.

@Daxcor69 Apologies for the delayed response. I would need more details and logs to see why bridge is not working in your case. Seems like this is a node js or express project, bridge doesn't deal with assets may be your project is missing something to run in your local. Again, I am trying my best to help you out of this issue. Simple search gave me few responses from stackoverflow if you have already seen this and didn't work then please share me all the logs from (/tmp/Bridge To Kubernetes) since you are using ubuntu. On the documentation side definitely we will take that as feedback and improve on it. Thanks for your patience and again apologies.

@Daxcor69 Please feel free to reopen this issue if it is still not working for you. Thank you.