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

Builds in WoodpeckerCI fail due to a default HTTPS_PROXY environment variable. #90

Open
wkpatrick opened this issue Aug 13, 2023 · 1 comment · May be fixed by #92
Open

Builds in WoodpeckerCI fail due to a default HTTPS_PROXY environment variable. #90

wkpatrick opened this issue Aug 13, 2023 · 1 comment · May be fixed by #92

Comments

@wkpatrick
Copy link

Problem

Builds run in WoodpeckerCI fail due to it setting HTTPS_PROXY to some value by default that does not match what this library expects.

+ cd .. && MIX_ENV=prod mix assets.deploy

01:10:30.698 [debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.2.7/tailwindcss-linux-x64

01:10:30.701 [debug] Using HTTPS_PROXY: 
** (FunctionClauseError) no function clause matching in String.to_charlist/1    
    
    The following arguments were given to String.to_charlist/1:
    
        # 1
        nil
    
    Attempted function clauses (showing 1 out of 1):
    
        def to_charlist(+string+) when -is_binary(string)-
    
    (elixir 1.14.4) lib/string.ex:2530: String.to_charlist/1
    (tailwind 0.2.1) lib/tailwind.ex:276: Tailwind.fetch_body!/1
    (tailwind 0.2.1) lib/tailwind.ex:224: Tailwind.install/1
    (tailwind 0.2.1) lib/tailwind.ex:205: Tailwind.install_and_run/2
    (tailwind 0.2.1) lib/mix/tasks/tailwind.ex:57: Mix.Tasks.Tailwind.install_and_run/1
    (mix 1.14.4) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4
    (mix 1.14.4) lib/mix/task.ex:479: Mix.Task.run_alias/6
    (mix 1.14.4) lib/mix/cli.ex:84: Mix.CLI.run_task/2

Solution

Should the library silently (or with a log message, but still continue running) continue without setting a proxy when URI.parse cant parse the environment variable? If so, id be happy to get a PR up this weekend for that.

@wkpatrick wkpatrick changed the title Builds in Builds in WoodpeckerCI fail due to a default HTTPS_PROXY environment variable. Aug 13, 2023
@reavessm
Copy link

reavessm commented Feb 2, 2024

I'm noticing the same issue in an OpenShift BuildConfig. Is there a fix/workaround?

EDIT: I was able to get it working by force unsetting the vars inline with the mix assets.deploy command, but I'd rather not have to do that.

Here is the relevant section of my Containerfile:

RUN unset HTTPS_PROXY && unset HTTP_PROXY \
  && mix deps.get --only prod \
  && mix deps.compile \
  && mix assets.deploy \
  && mix compile \
  && mix release

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

Successfully merging a pull request may close this issue.

2 participants