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

getaddrinfo(3) failure when building bulk, interactive works #287

Closed
saper opened this issue Mar 30, 2015 · 20 comments
Closed

getaddrinfo(3) failure when building bulk, interactive works #287

saper opened this issue Mar 30, 2015 · 20 comments

Comments

@saper
Copy link

saper commented Mar 30, 2015

While there are or were some getaddrinfo(3) handling issues in node/npm npm/npm#7508, nodejs/node-v0.x-archive#9212) there is something strange happening:

I build a local port (textproc/node-sass, not yet in the tree) with:

 poudriere bulk -i -j nodejs_10_1_amd64 -p exp textproc/node-sass

and the build fails in npm with getaddrinfo(3) problem:

npm ERR! code EAI_FAIL
npm ERR! errno EAI_FAIL
npm ERR! syscall getaddrinfo

Full log: https://gist.github.com/anonymous/b1a9680802336c1ab059

However, after the failure, when I drop into the -i shell I can cd to /usr/ports/www/node-sass
and compile that port using make stage without problems.

DNS resolution also works, I have 2 IPv6 and 5 IPv6 addresses configured on the interface
and visible in the poudriere jail.

Local port tree changes (https://github.com/saper/ports-exp):

Portshaker configuration:

mirror_base_dir="/var/cache/portshaker"
poudriere_ports_mountpoint="/usr/local/poudriere/ports"
ports_trees="exp"
exp_poudriere_tree="exp"
exp_merge_from="ports myrepo"

Portshaker myrepo configuration:

#!/bin/sh
# $Id$

. /usr/local/share/portshaker/portshaker.subr

# Update ports using portsnap (faster)
method="rsync"

# *OR* update ports using csup (hidden portshaker ninja gurus)
#method="csup"
#csup_supfile="/usr/local/etc/portshaker.d/ports-supfile"
rsync_source_path="/home/saper/sw/FreeBSD/"

run_portshaker_command $*
@brd
Copy link
Member

brd commented Mar 30, 2015

This is because poudriere does not allow network access in the stage part of the build (only in the fetch phase IIRC). You might look at the FreeBSD node port to see how they get around this. But basically it is to prevent software from pulling in things that are unexpected and not properly setup in the ports Makefile. I imagine you can just disable that network test.

@saper
Copy link
Author

saper commented Mar 30, 2015

Makes sense.
npm is fetching dependencies automatically during install step.

node does not have this problem and the only package depending on node and npm in the tree is www/uglifyjs, which... does not have any dependencies, so nothing needs to be fetched.

Maybe I can force npm to do the download in the fetch phase.

@brd
Copy link
Member

brd commented Mar 30, 2015

You might need to create additional ports for those dependencies.

@saper
Copy link
Author

saper commented Mar 30, 2015

No way, there so many of them!

Plus I think there is no way we can sanely support node_modules dependency model with ports easily (every module can have it's node_modules directory where its "local" dependencies are).

So they nicely recurse, avoiding the "DLL hell" problem:

https://gist.github.com/1c887b483de687b024ca

Let's see if I can run npm in the post-fetch target

@saper
Copy link
Author

saper commented Mar 30, 2015

Well, I can't :) because it need an unpacked package.json file (from $WRKSRC) - and it's not yet there. In post-extract I have no network.

@brd
Copy link
Member

brd commented Mar 30, 2015

Ouch.

@saper
Copy link
Author

saper commented Mar 30, 2015

Some progress: saper/ports-exp@9564a10
but it seems that $WRKDIR gets deleted in between...

@brd
Copy link
Member

brd commented Mar 30, 2015

Cool! In between which phases?

@bdrewery
Copy link
Member

The bug for getifaddrs(3) is described at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=178881. I am working on a proper patch to fix the problem in head.

There's a temporary fix for npm at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198350

@saper
Copy link
Author

saper commented Mar 30, 2015

Thanks @bdrewery ! I think I reported 198350 :) Looks like the simpler fix for 9.x/10.x posted on bug 178881 does not work for me. Too many IPv6 addresses configured? :)

@saper
Copy link
Author

saper commented Mar 31, 2015

After a lot of fighting I finally got this port to build offline using poudriere saper/ports-exp@86b8a08

Thank you for your patience :)

@saper saper closed this as completed Mar 31, 2015
@bdrewery
Copy link
Member

@saper The "simpler" fix you mention. Which was it? Was it what I have in https://reviews.freebsd.org/D2131?

@saper
Copy link
Author

saper commented Mar 31, 2015

I mean https://bugs.freebsd.org/bugzilla/attachment.cgi?id=134236 (ported as https://bugs.freebsd.org/bugzilla/attachment.cgi?id=154041 to 10.1) which were originally attached to the bug. This is before the code got refactored; but still it does not work for my 10.1 system.

@bdrewery
Copy link
Member

@saper Your host is 10.1-RELEASE?

@saper
Copy link
Author

saper commented Mar 31, 2015

10.1-STABLE, r279751

@cpu82
Copy link

cpu82 commented Jul 27, 2015

@bdrewery Same problem here. Also tested on jails 93/amd64, 93/i386

<snip>
pm ERR! FreeBSD 10.1-RELEASE-p15
npm ERR! argv "node" "/usr/local/bin/npm" "install" "--ignore-scripts" "/wrkdirs/usr/ports/deskutils/ladon/work/ladon-1.0.6"
npm ERR! node v0.12.7
npm ERR! npm  v2.13.2
npm ERR! code EAI_FAIL
npm ERR! errno EAI_FAIL
npm ERR! syscall getaddrinfo

npm ERR! network getaddrinfo EAI_FAIL
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR!     /wrkdirs/usr/ports/deskutils/ladon/work/stage/usr/local/lib/npm-debug.log
*** Error code 1

Any thoughts how to handle this?

@bdrewery
Copy link
Member

It's a bug in the kernel, still present. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=178881

@cpu82
Copy link

cpu82 commented Jul 27, 2015

Thanks @bdrewery.

So we can't overcome this problem ATM. Do we have any temporary fix or dirty hack?

@bdrewery
Copy link
Member

Sure, read this issue, there are links.

@cpu82
Copy link

cpu82 commented Aug 8, 2015

@bdrewery have you updated the rtsock.c patch for 10.2-RELEASE? It fails to builkernel using this one:
https://reviews.freebsd.org/file/data/iucxoni7jnciidyijdna/PHID-FILE-7p44cov6huy43mukiye6/sys_net_rtsock.c

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

4 participants