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

Backend not using proxy configuration despite claiming it's using it #1340

Open
x32xx23x opened this issue Feb 28, 2024 · 5 comments
Open

Backend not using proxy configuration despite claiming it's using it #1340

x32xx23x opened this issue Feb 28, 2024 · 5 comments

Comments

@x32xx23x
Copy link

Hi. I am trying to build a proof of concept for our team to start using shuffle. At the moment I'm stuck 'cause I cannot even seem to configure the use of our proxy. May I kindly ask you to take a look?

The current backend image used is ghcr.io/shuffle/shuffle-backend:nightly

This issue is the same as #1318 which was closed without resolution.

Describe the bug
After setting the HTTP_PROXY and HTTPS_PROXY, the backend acknowledges them.

shuffle-backend | 2024/02/01 11:34:20 [INFO] Running with HTTP proxy http://proxy:3128 (env: HTTP_PROXY)
shuffle-backend | 2024/02/01 11:34:20 [INFO] Running with HTTPS proxy http://proxy:3128 (env: HTTPS_PROXY)

But then it tries to resolve the url's domain.

shuffle-backend | 2024/02/01 11:35:21 [WARNING] Error getting app with ID 971706758e274c2e4083f2621fb5a6f7 (app config): App doesn't exist. Starting remote download(2)
shuffle-backend | 2024/02/01 11:35:21 Downloading API from https://shuffler.io/api/v1/apps/971706758e274c2e4083f2621fb5a6f7/config
shuffle-backend | 2024/02/01 11:35:26 [ERROR] Failed running auto-download request for 971706758e274c2e4083f2621fb5a6f7: Get "https://shuffler.io/api/v1/apps/971706758e274c2e4083f2621fb5a6f7/config": dial tcp: lookup shuffler.io: Try again

I confirm through a packet capture that these DNS queries are sent. Moreover nothing related to these requests appear in the proxy logs.

To Reproduce
Steps to reproduce the behavior:

  1. Set the HTTP_PROXY and HTTPS_PROXY variables for shuffle-backend
  2. Trigger an http request by starting an app that doesn't exist.

Expected behavior
Usual HTTP proxy behavior, send http request to the proxy, let it do the name resolution.

@frikky
Copy link
Member

frikky commented Feb 28, 2024

Hi. I am trying to build a proof of concept for our team to start using shuffle. At the moment I'm stuck 'cause I cannot even seem to configure the use of our proxy. May I kindly ask you to take a look?

The current backend image used is ghcr.io/shuffle/shuffle-backend:nightly

This issue is the same as #1318 which was closed without resolution.

Describe the bug After setting the HTTP_PROXY and HTTPS_PROXY, the backend acknowledges them.

shuffle-backend | 2024/02/01 11:34:20 [INFO] Running with HTTP proxy http://proxy:3128 (env: HTTP_PROXY)
shuffle-backend | 2024/02/01 11:34:20 [INFO] Running with HTTPS proxy http://proxy:3128 (env: HTTPS_PROXY)

But then it tries to resolve the url's domain.

shuffle-backend | 2024/02/01 11:35:21 [WARNING] Error getting app with ID 971706758e274c2e4083f2621fb5a6f7 (app config): App doesn't exist. Starting remote download(2)
shuffle-backend | 2024/02/01 11:35:21 Downloading API from https://shuffler.io/api/v1/apps/971706758e274c2e4083f2621fb5a6f7/config
shuffle-backend | 2024/02/01 11:35:26 [ERROR] Failed running auto-download request for 971706758e274c2e4083f2621fb5a6f7: Get "https://shuffler.io/api/v1/apps/971706758e274c2e4083f2621fb5a6f7/config": dial tcp: lookup shuffler.io: Try again

I confirm through a packet capture that these DNS queries are sent. Moreover nothing related to these requests appear in the proxy logs.

To Reproduce Steps to reproduce the behavior:

  1. Set the HTTP_PROXY and HTTPS_PROXY variables for shuffle-backend
  2. Trigger an http request by starting an app that doesn't exist.

Expected behavior Usual HTTP proxy behavior, send http request to the proxy, let it do the name resolution.

Heyo! Thanks for reopening this :)

I checked the logs, and based on what I can see, you are most likely not on nightly, as the line we fixed last time starts with [DEBUG], and yours doesn't. The proxy usage was changed in the previous issue, which is why we closed it, and this just indicates your version may be wrong: https://github.com/Shuffle/Shuffle/blame/1.4.0/backend/go-app/docker.go#L801

Please make sure to docker pull ghcr.io/shuffle/shuffle-backend:nightly again

@x32xx23x
Copy link
Author

x32xx23x commented Mar 1, 2024

Hi Frikky,

Thanks for your reply. I was actually dumb enough to recycle the log messages from previous time. Here are the logs after switching to nightly.

shuffle-backend | 2024/03/01 11:19:01 [INFO] Running with HTTP proxy http://proxy:3128 (env: HTTP_PROXY)
shuffle-backend | 2024/03/01 11:19:01 [INFO] Running with HTTPS proxy http://proxy:3128 (env: HTTPS_PROXY)

And

shuffle-backend | 2024/03/01 11:30:21 [WARNING] Error getting app with ID 971706758e274c2e4083f2621fb5a6f7 (app config): App doesn't exist. Starting remote download(2)
shuffle-backend | 2024/03/01 11:30:21 [DEBUG] Downloading API from URL https://shuffler.io/api/v1/apps/971706758e274c2e4083f2621fb5a6f7/config
shuffle-backend | 2024/03/01 11:30:26 [ERROR] Failed running auto-download request for 971706758e274c2e4083f2621fb5a6f7: Get "https://shuffler.io/api/v1/apps/971706758e274c2e4083f2621fb5a6f7/config": dial tcp: lookup shuffler.io: Try again

Thanks in advance for your help

@frikky
Copy link
Member

frikky commented Mar 6, 2024

So does the server you're running on have access to https://shuffler.io?

@x32xx23x
Copy link
Author

x32xx23x commented Mar 8, 2024

Hey, yes it does:

$ curl https://shuffler.io -v
* Uses proxy env variable no_proxy == 'localhost,'
* Uses proxy env variable https_proxy == 'http://proxy:3128'
*   Trying 10.redacted:3128...
* TCP_NODELAY set
* Connected to proxy (10.redacted) port 3128 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to shuffler.io:443
> CONNECT shuffler.io:443 HTTP/1.1
> Host: shuffler.io:443
> User-Agent: curl/7.68.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection established

Can you reproduce the issue?

@frikky
Copy link
Member

frikky commented Mar 8, 2024

Hey, yes it does:

$ curl https://shuffler.io -v
* Uses proxy env variable no_proxy == 'localhost,'
* Uses proxy env variable https_proxy == 'http://proxy:3128'
*   Trying 10.redacted:3128...
* TCP_NODELAY set
* Connected to proxy (10.redacted) port 3128 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to shuffler.io:443
> CONNECT shuffler.io:443 HTTP/1.1
> Host: shuffler.io:443
> User-Agent: curl/7.68.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection established

Can you reproduce the issue?

No, we can't reproduce as it's been solved proxy-wise. That's why I keep asking, as this is most likely just a DNS/other network issue at this point. Network inside containers is not the same as on the host.

Do this:
docker exec -u 0 -it shuffle-frontend bash

Then run the curl command again. I know this is a different container, but it's the only one that has curl :)

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

No branches or pull requests

2 participants