Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

npm search fails on private server #269

Open
hurricaneFromMoscow opened this issue May 15, 2017 · 2 comments
Open

npm search fails on private server #269

hurricaneFromMoscow opened this issue May 15, 2017 · 2 comments

Comments

@hurricaneFromMoscow
Copy link

Hello,

I hope this is the right place to ask for the following.
I am running a private server with CouchDB, went successfully through the process of setting up local CouchDB instance. I am able to publish and install package from local DB. But npm search fails stating that there is "invalid value written to input stream".

Here is the corresponding log file:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'search', 'dfp' ]
2 info using [email protected]
3 info using [email protected]
4 silly mapToRegistry name -/v1/search
5 silly mapToRegistry using default registry
6 silly mapToRegistry registry http://localhost:5985/registry/_design/app/_rewrite
7 silly mapToRegistry data Result {
7 silly mapToRegistry raw: '-/v1/search',
7 silly mapToRegistry scope: null,
7 silly mapToRegistry escapedName: null,
7 silly mapToRegistry name: null,
7 silly mapToRegistry rawSpec: '-/v1/search',
7 silly mapToRegistry spec: '-/v1/search',
7 silly mapToRegistry type: 'local' }
8 silly mapToRegistry uri http://localhost:5985/registry/_design/app/_rewrite/-/v1/search
9 verbose esearch creating remote entry stream
10 verbose request uri http://localhost:5985/registry/_design/app/_rewrite/-/v1/search?text=dfp&size=20
11 verbose request no auth needed
12 info attempt registry request try #1 at 10:50:14 AM
13 verbose request id aaf354a8cdfbca5d
14 http request GET http://localhost:5985/registry/_design/app/_rewrite/-/v1/search?text=dfp&size=20
15 silly search searching packages
16 http 404 http://localhost:5985/registry/_design/app/_rewrite/-/v1/search?text=dfp&size=20
17 verbose headers { server: 'CouchDB/1.5.0 (Erlang OTP/R16B03)',
17 verbose headers date: 'Mon, 15 May 2017 08:50:13 GMT',
17 verbose headers 'content-type': 'application/json',
17 verbose headers 'content-length': '41',
17 verbose headers 'cache-control': 'must-revalidate' }
18 warn search fast search endpoint errored. Using old search.
19 silly mapToRegistry name -/all
20 silly mapToRegistry using default registry
21 silly mapToRegistry registry http://localhost:5985/registry/_design/app/_rewrite
22 silly mapToRegistry data Result {
22 silly mapToRegistry raw: '-/all',
22 silly mapToRegistry scope: null,
22 silly mapToRegistry escapedName: null,
22 silly mapToRegistry name: null,
22 silly mapToRegistry rawSpec: '-/all',
22 silly mapToRegistry spec: '-/all',
22 silly mapToRegistry type: 'local' }
23 silly mapToRegistry uri http://localhost:5985/registry/_design/app/_rewrite/-/all
24 verbose all-package-metadata creating entry stream from local cache
25 verbose all-package-metadata /home/nikita_fomin/.npm/localhost_5985/registry/_design/app/_rewrite/-/all/.cache.json
26 silly all-package-metadata extracting latest
27 silly all-package-metadata got first stream entry for cached-entry-stream 1494832272271
28 verbose all-package-metadata creating remote entry stream
29 verbose all-package-metadata Cached data present with timestamp: 1494832272271 requesting partial index update
30 verbose request uri http://localhost:5985/registry/_design/app/_rewrite/-/all/since?stale=update_after&startkey=1494832272271
31 verbose request no auth needed
32 info attempt registry request try #1 at 10:50:14 AM
33 http request GET http://localhost:5985/registry/_design/app/_rewrite/-/all/since?stale=update_after&startkey=1494832272271
34 silly all-package-metadata request stream opened, code: 200
35 silly all-package-metadata entry stream created
36 silly all-package-metadata making sure cache dir exists at /home/nikita_fomin/.npm/localhost_5985/registry/_design/app/_rewrite/-/all
37 verbose correctMkdir /home/nikita_fomin/.npm correctMkdir not in flight; initializing
38 silly all-package-metadata creating output stream
39 silly all-package-metadata output stream created
40 verbose stack Error: invalid value written to input stream
40 verbose stack at DestroyableTransform._transform (/usr/lib/node_modules/npm/lib/search/all-package-metadata.js:274:28)
40 verbose stack at DestroyableTransform.Transform._read (/usr/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_transform.js:159:10)
40 verbose stack at DestroyableTransform.Transform._write (/usr/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_transform.js:147:83)
40 verbose stack at doWrite (/usr/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:347:64)
40 verbose stack at writeOrBuffer (/usr/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:336:5)
40 verbose stack at DestroyableTransform.Writable.write (/usr/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:274:11)
40 verbose stack at Pumpify.Duplexify._write (/usr/lib/node_modules/npm/node_modules/mississippi/node_modules/duplexify/index.js:201:22)
40 verbose stack at doWrite (/usr/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:347:64)
40 verbose stack at writeOrBuffer (/usr/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:336:5)
40 verbose stack at Pumpify.Writable.write (/usr/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:274:11)
41 verbose cwd /home/nikita_fomin/work/npm_test/DFP_packages/DFP_v10
42 error Linux 4.4.0-21-generic
43 error argv "/usr/bin/nodejs" "/usr/bin/npm" "search" "dfp"
44 error node v7.8.0
45 error npm v4.2.0
46 error invalid value written to input stream
47 error If you need help, you may report this error at:
47 error https://github.com/npm/npm/issues
48 verbose exit [ 1, true ]

I would appreciate any help/hints.

@amol-deole
Copy link

We are also getting the same error. When we run npm search for a specific package against private registry, it shows the output along with this error

npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/nodejs',
npm verb cli '/usr/bin/npm',
npm verb cli 'search',
npm verb cli 't-shirt',
npm verb cli '--registry=http://192.168.250.31:8080',
npm verb cli '--verbose' ]
npm info using [email protected]
npm info using [email protected]
npm verb config Skipping project config: /home/lt-31/.npmrc. (matches userconfig)
npm verb esearch creating remote entry stream
npm verb request uri http://192.168.250.31:8080/-/v1/search?text=t-shirt&size=20
npm verb request no auth needed
npm info attempt registry request try #1 at 1:12:32 AM
npm verb request using bearer token for auth
npm verb request id 951685c8e7c9edf5
npm http request GET http://192.168.250.31:8080/-/v1/search?text=t-shirt&size=20
npm http 404 http://192.168.250.31:8080/-/v1/search?text=t-shirt&size=20
npm verb headers { 'x-powered-by': 'Express',
npm verb headers 'content-type': 'application/json',
npm verb headers 'content-length': '52',
npm verb headers date: 'Tue, 11 Jul 2017 19:42:36 GMT',
npm verb headers connection: 'keep-alive' }
npm WARN search fast search endpoint errored. Using old search.
npm verb all-package-metadata creating entry stream from local cache
npm verb all-package-metadata /home/lt-31/.npm/192.168.250.31_8080/-/all/.cache.json
npm verb all-package-metadata creating remote entry stream
npm verb all-package-metadata Cached data present with timestamp: 1499082927346 requesting partial index update
npm verb request uri http://192.168.250.31:8080/-/all/since?stale=update_after&startkey=1499082927346
npm verb request no auth needed
npm info attempt registry request try #1 at 1:12:36 AM
npm verb request using bearer token for auth
npm http request GET http://192.168.250.31:8080/-/all/since?stale=update_after&startkey=1499082927346
npm verb correctMkdir /home/lt-31/.npm correctMkdir not in flight; initializing
npm verb stack Error: invalid value written to input stream
npm verb stack at DestroyableTransform._transform (/usr/lib/node_modules/npm/lib/search/all-package-metadata.js:274:28)
npm verb stack at DestroyableTransform.Transform._read (/usr/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_transform.js:159:10)
npm verb stack at DestroyableTransform.Readable.read (/usr/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_readable.js:365:10)
npm verb stack at flow (/usr/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_readable.js:739:34)
npm verb stack at Stream. (/usr/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_readable.js:610:7)
npm verb stack at emitNone (events.js:86:13)
npm verb stack at Stream.emit (events.js:188:7)
npm verb stack at Stream.stream.resume (/usr/lib/node_modules/npm/node_modules/JSONStream/node_modules/through/index.js:103:14)
npm verb stack at DestroyableTransform.ondrain (internal/streams/legacy.js:26:14)
npm verb stack at emitNone (events.js:86:13)
npm verb stack at DestroyableTransform.emit (events.js:188:7)
npm verb cwd /home/lt-31
npm verb Linux 3.13.0-24-generic
npm verb argv "/usr/bin/nodejs" "/usr/bin/npm" "search" "t-shirt" "--registry=http://192.168.250.31:8080" "--verbose"
npm verb node v7.9.0
npm verb npm v4.4.4
npm ERR! invalid value written to input stream
npm verb exit [ 1, true ]

@alundiak
Copy link

alundiak commented Aug 9, 2018

I also faced with this today. Was playing with Node Versions 6, 8 and 10. And in fact v 8.11.2 was OK, but something changed recently.

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

No branches or pull requests

3 participants