Skip to content

Using GO SDK behind a proxy fails #3726

Closed

Description

@juaruipav

What is the issue?

In #2053 and #2228, the dagger CLI was patched in order to use the host http_proxy and https_proxy env. vars from the host.

However, with the recent release of the GO SDK, the same errors shows up again (see log output). However, the APKINDEX.tar.gz is reachable since I'm able to curl it.

Log output

#9 [build 3/6] RUN apk add --no-cache file git
#9 5.369 fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
#9 5.369 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.16/main: temporary error (try again later)
#9 10.37 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.16/community: temporary error (try again later)
#9 10.38 ERROR: unable to select packages:
#9 10.38 file (no such package):
#9 10.38 required by: world[file]
#9 10.38 git (no such package):
#9 10.38 required by: world[git]

Steps to reproduce

Doing something basic with golang SDK will try to fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz file but it will fail when behind a proxy

Dagger version

require dagger.io/dagger v0.4.0 (Go SDK)

OS version

Ubuntu 18.04

Activity

  1. aluzzardi commented on Nov 15, 2022

    @aluzzardi
    Contributor

    /cc @sipsma @vito @grouville

    Should we handle this throw the host's HTTP_* vars or should we expose this in the SDK itself?

  2. sipsma commented on Nov 15, 2022

    @sipsma
    Contributor

    Should we handle this throw the host's HTTP_* vars or should we expose this in the SDK itself?

    I'd prefer it's in our actual API somehow. Applying host HTTP_* vars by default to commands that are running on (possibly remote) containers doesn't seem easy to work with.

    If it's not in the API itself then yeah it could be arguments to dagger.Connect, but even that seems really restrictive (what if you want the proxy for some calls but not another, or need different proxy settings).

    Putting it in the API like:

    extend type Query {
       withDefaultHTTPProxy(...) Query!
    }

    seems like it will cover the most cases (including future ones involving extensions) and it will also be the least work for our SDKs since it can just be picked up through codegen rather than manually coded into each SDK.

  3. grouville commented on Nov 15, 2022

    @grouville
    Member

    100% Agreeing with Erik's comment

  4. nipuna-perera commented on Nov 15, 2022

    @nipuna-perera
    Contributor
  5. juaruipav commented on Nov 20, 2022

    @juaruipav
    Author

    Ey Dagger Team, thanks for addressing this issue. We're super interested in trying this GO SDK in our company to replace our CICD pipeline.

    However we can't use it because the proxy issue.

    Do you have an idea about when you would have time to implement the patch?

    Thanks 👍
    JJ

  6. nipuna-perera commented on Nov 20, 2022

    @nipuna-perera
    Contributor

    Hey @juaruipav , this was resolved for me with #3913 and that change should be in the next release which is this week I believe. If you are curious to try it now locally, you can follow the workaround in - https://discord.com/channels/707636530424053791/1031785076029128784.

    The gist is, that the shim docker image is not built on the fly anymore. It's included with the engine and that solves the shim image proxy issue. For subsequent containers you could always pass in the proxy via container.withEnvVariable.

  7. nipuna-perera commented on Nov 20, 2022

    @nipuna-perera
    Contributor

    @aluzzardi , can this be closed with #3913 or are you waiting for a generic proxy solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions