mardi 31 mars 2015

npm ssh error doesn't replicate from shell

When trying npm install, I get error:



1206 error node v0.12.0
1207 error npm v2.7.4
1208 error code 128
1209 error Command failed: git clone --template=/root/.npm/_git-remotes/_templates --mirror ssh://git@git.spindle.factfiber.com/schematist-postgres.git /root/.npm/_git-remotes/ssh-git-git-spindle-factfiber-com-schematist-postgres-git-8e4b2071
1209 error ssh: Could not resolve hostname git.spindle.factfiber.com: Name or service not known


However, when I try the very command reported from the shell:



git clone --template=/root/.npm/_git-remotes/_templates --mirror ssh://git@git.spindle.factfiber.com/schematist-postgres.git /root/.npm/_git-remotes/ssh-git-git-spindle-factfiber-com-schematist-postgres-git-8e4b2071


It works:



Cloning into bare repository '/root/.npm/_git-remotes/ssh-git-git-spindle-factfiber-com-schematist-postgres-git-8e4b2071'...
remote: Counting objects: 47, done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 47 (delta 20), reused 0 (delta 0)
Receiving objects: 100% (47/47), 13.05 KiB, done.
Resolving deltas: 100% (20/20), done.


I tried this a couple times in case it was a temp dns glitch. Does anyone know what could be happening?


UPDATE: when I create a new repo and



npm install git+http://sshgit@git.spindle.factfiber.com:schematist-postgres.git


Then once it failed, 2nd time succeeded. Either way npm takes a really long time (20-30 secs?), while shell git succeeds in just a second.


This is a docker image, btw. I decided to throw in some command-line tools to an image (screen, jove) and rebuild -- before it was building fine, but still taking a really long time. So I don't think that just including those packages was the problem. The problem might be some DNS misconfiguration? But if so why is it npm specific?


UPDATE -- Dockerfile. This is being built on mac/yosemite



FROM debian:wheezy
RUN DEBIAN_FRONTEND=noninteractive apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y curl wget \
openssh-client build-essential unicode-data screen jove

# ------------------------------------------------
# node
RUN curl -sL http://ift.tt/1BMRHvi | bash -
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs
RUN npm install -g coffee-script && npm -g install npm@latest

# ------------------------------------------------
# git
# setup keys so we can pull from github
# mounted "sw-pull-rsa" contains key

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y git
ADD ./sw-pull-rsa /root/.ssh/id_rsa
ADD ./sw-pull-rsa.pub /root/.ssh/id_rsa.pub
RUN chmod 0600 /root/.ssh/id_rsa
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
RUN ssh-keyscan git.spindle.factfiber.com >> /root/.ssh/known_hosts

# ------------------------------------------------

RUN npm install -g npm
RUN npm install -g npm-cache

RUN mkdir -p /tmp/common
COPY ./common/package.json /tmp/common/
RUN cd /tmp/common && npm install

Aucun commentaire:

Enregistrer un commentaire