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

yarn install fails silently inside docker container behind a corporate proxy #6963

Closed
lmcarreiro opened this issue Jan 25, 2019 · 6 comments
Closed
Assignees
Labels

Comments

@lmcarreiro
Copy link

Do you want to request a feature or report a bug?

It is a bug

What is the current behavior?
It fails silently with exit code 0

If the current behavior is a bug, please provide the steps to reproduce.

  1. Download the package.json and yarn.lock from this gist

  2. Create a Dockerfile with this content:

FROM node:10.15.0
COPY . .
RUN yarn install
  1. Run docker build .

I ran it behind a corporate proxy, without passing the build environment variables http_proxy and https_proxy. It fails silently in the step 2 of the install with no error message and exit code zero.

If I run docker build . --build-arg http_proxy=http://user:pass@proxy-host:port --build-arg https_proxy=http://user:pass@proxy-host:port it works fine.

What is the expected behavior?
An error message saying that some http request failed.

Please mention your node.js, yarn and operating system version.
OS, node and yarn version are from the official docker image node:10.15.0:

root@de27e495d159:/app# env
YARN_VERSION=1.12.3
HOSTNAME=de27e495d159
PWD=/app
HOME=/root
NODE_VERSION=10.15.0
TERM=xterm
SHLVL=1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/usr/bin/env
root@de27e495d159:/app# yarn install
yarn install v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
[--------------------------------------------------------------------------------------------------------------] 0/1363
root@de27e495d159:/app# echo $?
0
root@de27e495d159:/app# yarn --version
1.12.3
root@de27e495d159:/app# node --version
v10.15.0
root@de27e495d159:/app# uname -a
Linux de27e495d159 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 GNU/Linux
root@de27e495d159:/app#
@ghost ghost assigned torifat Jan 25, 2019
@ghost ghost added the triaged label Jan 25, 2019
@lmcarreiro
Copy link
Author

I saw an "info" message just one time:
image

Tried again many times and this messege never happened again:
image

@lmcarreiro
Copy link
Author

Tried the same in node:10.5 instead of node:10.15 image, the yarn version was 1.7.0 instead of 1.12.3, and it does show error messages:

root@b9c1c6edafdb:/app# yarn install
yarn install v1.7.0
(node:29) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@material-ui/core/-/core-3.7.1.tgz: connect ECONNREFUSED 104.16.16.35:443".
info If you think this is a bug, please open a bug report with the information provided in "/app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
root@b9c1c6edafdb:/app#

image

Version 1.12.3 is not handling the error like it was used to.

I tested in node:latest that has the yarn 1.13.0 and it doesn't too, the behavior is the same as node:10.15 image (with yarn 1.12.3)

@dllozhkin
Copy link

Hello @lmcarreiro
I saw the same error, but I used proxy. I could not add a proxy command
yarn set proxy http://example-proxy:8080

it works like this
yarn install --proxy http://example-proxy:8080

@yan12125
Copy link
Contributor

Looks quite similar to #6915. I believe it's a bug since yarn 1.11.0, and here's my fix: #6968.

@azz
Copy link

azz commented Apr 1, 2019

Thanks @yan12125 - confirmed this is fixed in node:11-alpine.

@lmcarreiro
Copy link
Author

Tried in node:12 with yarn 1.16.0 and it is fixed.

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

No branches or pull requests

5 participants