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

Can't get routing method to work with todo app #205

Closed
matter-it-does opened this issue Mar 15, 2023 · 7 comments
Closed

Can't get routing method to work with todo app #205

matter-it-does opened this issue Mar 15, 2023 · 7 comments

Comments

@matter-it-does
Copy link

matter-it-does commented Mar 15, 2023

Describe the bug

Isolation routing method doesn't work. direct one works.

Mention the platform you are using
Vscode,
Extension v2.0.120230216

To Reproduce
Following BridgeToKubernetes.md file, VSCode, routing enabled

  • From the deployment.yaml file, commented readiness and liveness probes
  • deploy services
  • npm install
  • select service > stats-api
  • port = 3001
  • Select launch task Run Script: dev.
  • routing yes

It waits.. sometimes I get #55, other times this:

Redirecting Kubernetes service stats-api to your machine...
Target cluster: company-aks
Current cluster: companyaks
Target namespace: dev
Current namespace: dev
Target service name: stats-api
Target service ports: 3001
Isolating service with routing header: matter.-1a66
Using kubernetes service environment variables: false

Retrieving the current context and credentials...
Validating the credentials to access the cluster...
Validating the requirements to replicate resources locally...
Redirecting traffic from the cluster to your machine...
Routing successfully enabled for service through pod 'matter-stats-api-57b7c44d45-bv8md' in namespace 'dev'.
Waiting for 'matter-stats-api-57b7c44d45-bv8md' in namespace 'dev' to reach running state...
Pod 'matter-stats-api-57b7c44d45-bv8md' created in namespace 'dev'.
Remote agent deployed in container 'stats-api' in pod 'matter-stats-api-57b7c44d45-bv8md'.
Preparing to run Bridge To Kubernetes configured as pod dev/matter-stats-api-57b7c44d45-bv8md ...
Failed to get routing manager deployment status - ran out of time : 'Failed to get routing manager deployment status: 'Invalid value of trigger matter-stats-api-57b7c44d45-bv8md'Please include the following Correlation ID when contacting support: 'aba53e77-7a9e-4d91-a359-3217e9f0e8a91678853343234:da05f313d6a0'. '
Stopping workload and cleaning up...
Restore: Pod 'matter-stats-api-57b7c44d45-bv8md' deleted.

Error: Failed to establish a connection. Error: Failed to get routing manager deployment status - ran out of time : 'Failed to get routing manager deployment status: 'Invalid value of trigger matter-stats-api-57b7c44d45-bv8md'Please include the following Correlation ID when contacting support: 'aba53e77-7a9e-4d91-a359-3217e9f0e8a91678853343234:da05f313d6a0'. '

In the router manager pod, I get these logs

 | RoutingManager | WARNG | Logging handled exception: System.Net.Http.HttpRequestException: {"StatusCode":null,"Message":"The proxy tunnel request to proxy 'http://proxy....com:8080/' failed with status code '403'.\"","Data":{},"InnerException":null,"HelpLink":null,"Source":"System.Net.Http","HResult":-2146233088,"StackTrace":"   at System.Net.Http.HttpConnectionPool.EstablishProxyTunnelAsync(Boolean async, HttpRequestHeaders headers, CancellationToken cancellationToken)
System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request)
System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
Microsoft.Rest.RetryAfterDelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Microsoft.Rest.RetryDelegatingHandler.<>c__DisplayClass15_0.<<SendAsync>b__0>d.MoveNext()\n--- End of stack trace from previous location ---
Microsoft.Rest.RetryDelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
Microsoft.BridgeToKubernetes.Common.Services.Kubernetes.KubernetesWatcher.StartAsync(Uri requestUri, CancellationToken cancellationToken) in /src/common/Kubernetes/KubernetesWatcher.cs:line 242
Microsoft.BridgeToKubernetes.Common.Services.Kubernetes.KubernetesWatcher.<>c__DisplayClass16_0.<<WatchAsync>b__0>d.MoveNext() in /src/common/Kubernetes/KubernetesWatcher.cs:line 196"}
@matter-it-does
Copy link
Author

I'll try to be clear and focus on one issue only, so closed my last issue. Answering questions:

Thanks for raising this issue. Was this tested against current B2K production version v2.0.120230216 via vscode?

yes

I tried testing stats-api, i couldn't reproduce the issue with routing enabled and it is working fine without any proxy issues. Can you provide more specifics?

The pods have a proxy set by env vars. Any connection outside the pod has to go through the proxy

I see it is 403 which is forbidden, is your VPN enabled and blocking the connection?

VPN is enabled, and the proxy server is blocked by firewall to be connected from my browser. But from the pod, it should have no auth issues.

Also are you able to access the cluster using normal kubectl commands from your local terminal ? Please let me know.

Yes

@elenavillamil
Copy link
Contributor

Thank you @matter-it-does Have you tried it on a computer without VPN or with VPN disabled? Since we cannot repo on our end, this will help us narrow down on where issue may be coming from. 403 is unahutorized, so it does seem like either something on your cluster or on your machine is keeping routing manager from starting proxy tunnel.

@matter-it-does
Copy link
Author

Have you tried it on a computer without VPN or with VPN disabled?

Then I won't be able to connect to the cluster

403 is unahutorized, so it does seem like either something on your cluster or on your machine is keeping routing manager from starting proxy tunnel.

The proxy is password less. Is it that the code is not respecting the env vars ?

@hsubramanianaks
Copy link
Collaborator

@matter-it-does are you still facing this issue ? Please let me know, thank you.

@matter-it-does
Copy link
Author

@matter-it-does are you still facing this issue ? Please let me know, thank you.

Yes unless some release has happened after my last comment

@hsubramanianaks
Copy link
Collaborator

@matter-it-does there has been a release , can you try again let us know? Thank you.

@hsubramanianaks
Copy link
Collaborator

@matter-it-does Closing this issue, please feel free to open it again if you still face issues. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants