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

replicating https://skimdb.npmjs.com/registry fails with bad match #215

Open
chongj615 opened this issue Dec 12, 2014 · 6 comments
Open

Comments

@chongj615
Copy link

Hi,

We had been replicating https://skimdb.npmjs.com/registry for a while now, but around Nov 24th, 2014, we start getting the error below, any idea what? I check that we can connect skimdb.npmjs.com via curl
curl https://skimdb.npmjs.com/registry/
{"db_name":"registry","doc_count":118081,"doc_del_count":378,"update_seq":691122,"purge_seq":0,"compact_running":false,"disk_size":1016000635,"data_size":425905206,"instance_start_time":"1417565593480626","disk_format_version":6,"committed_update_seq":691122}

error from coucdb log

** Reason for termination =
** {{badmatch,
{error,
{asn1,
{'Type not compatible with table constraint',
{{component,'Type'},
{value,{5,<<>>}},
{unique_name_and_value,id,{1,2,840,113549,1,1,11}}}}}}},
[{public_key,pkix_decode_cert,2},
{ssl_certificate,trusted_cert_and_path,3},
{ssl_handshake,certify,7},
{ssl_connection,certify,2},
{ssl_connection,next_state,3},
{gen_fsm,handle_msg,7},
{proc_lib,init_p_do_apply,3}]}

[Mon, 08 Dec 2014 21:58:19 GMT] [error] [<0.154.0>] {error_report,<0.62.0>,
{<0.154.0>,crash_report,
[[{initial_call,{ssl_connection,init,['Argument__1']}},
{pid,<0.154.0>},
{registered_name,[]},
{error_info,
{exit,
{{badmatch,
{error,
{asn1,
{'Type not compatible with table constraint',
{{component,'Type'},
{value,{5,<<>>}},
{unique_name_and_value,id,
{1,2,840,113549,1,1,11}}}}}}},
[{public_key,pkix_decode_cert,2},
{ssl_certificate,trusted_cert_and_path,3},
{ssl_handshake,certify,7},
{ssl_connection,certify,2},
{ssl_connection,next_state,3},
{gen_fsm,handle_msg,7},
{proc_lib,init_p_do_apply,3}]},
[{gen_fsm,terminate,7},
{proc_lib,init_p_do_apply,3}]}},
{ancestors,[ssl_connection_sup,ssl_sup,<0.63.0>]},
{messages,[]},
{links,[<0.67.0>]},
{dictionary,[]},
{trap_exit,false},
{status,running},
{heap_size,1597},
{stack_size,24},
{reductions,981}],
[]]}}
[Mon, 08 Dec 2014 21:58:19 GMT] [error] [<0.67.0>] {error_report,<0.62.0>,
{<0.67.0>,supervisor_report,
[{supervisor,{local,ssl_connection_sup}},
{errorContext,child_terminated},
{reason,
{{badmatch,
{error,
{asn1,
{'Type not compatible with table constraint',
{{component,'Type'},
{value,{5,<<>>}},
{1,2,840,113549,1,1,11}}}}}}},
[{public_key,pkix_decode_cert,2},
{ssl_certificate,trusted_cert_and_path,3},
{ssl_handshake,certify,7},
{ssl_connection,certify,2},
{ssl_connection,next_state,3},
{gen_fsm,handle_msg,7},
{proc_lib,init_p_do_apply,3}]}},
{offender,
[{pid,<0.154.0>},
{name,undefined},
{mfargs,{ssl_connection,start_link,undefined}},
{restart_type,temporary},
{shutdown,4000},
{child_type,worker}]}]}}
[Mon, 08 Dec 2014 21:58:19 GMT] [error] [<0.130.0>] ** Generic server <0.130.0> terminating
** Last message in was {send_req,
{{url,"https://skimdb.npmjs.com/registry/",
"skimdb.npmjs.com",443,undefined,undefined,
"/registry/",https,hostname},
[{"Accept","application/json"},
{"User-Agent","CouchDB/1.5.0"}],
head,<<>>,
[{response_format,binary},
{inactivity_timeout,30000},
{is_ssl,true},
{socket_options,
[{keepalive,true},{nodelay,false}]},
{ssl_options,[{depth,3},{verify,verify_none}]}],
infinity}}
** When Server state == {state,"skimdb.npmjs.com",443,undefined,
#Ref<0.0.0.229>,false,undefined,[],true,
undefined,false,[],
{[],[]},
undefined,idle,undefined,<<>>,0,0,[],undefined,
undefined,undefined,undefined,false,undefined,
undefined,<<>>,undefined,false,undefined,0,
undefined}

@chongj615
Copy link
Author

Here's more log before the bad match error:
[Mon, 08 Dec 2014 21:58:18 GMT] [info] [<0.115.0>] Attempting to start replication b132c5a2140303ee1d1532b01af9f143+continuous (document npmjs_repl).
[Mon, 08 Dec 2014 21:58:18 GMT] [info] [<0.32.0>] Apache CouchDB has started on http://0.0.0.0:5984/
[Mon, 08 Dec 2014 21:58:19 GMT] [error] [<0.154.0>] ** State machine <0.154.0> terminating
** Last message in was {tcp,#Port<0.3208>,
<<111,84,114,117,115,116,32,73,110,99,46,49,32,48,
30,6,3,85,4,3,19,23,82,97,112,105,100,83,83,76,
32,83,72,65,50,53,54,32,67,65,32,45,32,71,51,48,
...
...
180,43,216,110,227,65,184,58,63,62,220,61,30,18,
17,41,182,255,228,150,159,22,3,1,0,4,14,0,0,0>>}
** When State == certify
** Data == {state,client,
{#Ref<0.0.0.280>,<0.130.0>},
gen_tcp,tcp,tcp_closed,tcp_error,"skimdb.npmjs.com",443,
#Port<0.3208>,
{ssl_options,[],verify_none,
{#Fun<ssl.1.24582685>,[]},
false,false,undefined,3,[],undefined,[],undefined,
undefined,undefined,[],undefined,undefined,
[<<0,57>>,
<<0,56>>,
<<0,53>>,
<<0,22>>,
<<0,19>>,
<<0,10>>,
<<0,51>>,
<<0,50>>,
<<0,47>>,
<<0,5>>,
<<0,4>>,
<<0,21>>,
<<0,9>>],
#Fun<ssl.0.123982462>,true,18446744073709551900,
false,[],undefined},
{socket_options,binary,0,0,0,false},
{connection_states,
{connection_state,
{security_parameters,
<<0,0>>,
1,0,0,0,0,0,0,0,0,0,undefined,undefined,
undefined,undefined},
undefined,undefined,undefined,1,true,undefined,
undefined},
{connection_state,
{security_parameters,
<<0,57>>,
1,7,1,16,256,32,unknown,2,20,0,undefined,
<<84,134,30,250,183,88,73,163,218,32,175,47,
57,172,205,196,106,37,142,250,157,164,201,
251,28,86,189,120,233,125,97,186>>,
<<83,246,199,50,157,221,186,170,119,56,125,
195,98,178,12,73,165,184,56,10,248,61,0,121,
111,41,182,4,51,64,250,92>>,
undefined},
undefined,undefined,undefined,undefined,true,
111,41,182,4,51,64,250,92>>,
undefined},
undefined,undefined,undefined,undefined,true,
undefined,undefined},
{connection_state,
{security_parameters,
<<0,0>>,
1,0,0,0,0,0,0,0,0,0,undefined,undefined,
undefined,undefined},
undefined,undefined,undefined,1,true,undefined,
undefined},
{connection_state,
{security_parameters,
<<0,57>>,
1,7,1,16,256,32,unknown,2,20,0,undefined,
<<84,134,30,250,183,88,73,163,218,32,175,47,
57,172,205,196,106,37,142,250,157,164,201,
251,28,86,189,120,233,125,97,186>>,
<<83,246,199,50,157,221,186,170,119,56,125,
195,98,178,12,73,165,184,56,10,248,61,0,121,
111,41,182,4,51,64,250,92>>,
undefined},
undefined,undefined,undefined,undefined,true,
undefined,undefined}},
[],
<<22,3,1,8,225,11,0,8,221,0,8,218,0,4,171,48,130,4,167,48,
130,3,143,160,3,2,1,2,2,3,0,184,232,48,13,6,9,42,134,72,
...
...
<<>>,
{{<<42,230,147,211,64,82,247,167,135,250,158,226,11,210,
127,55,192,4,0,0,0,0,0,0,224,162,144,223,205,199,5,
234,103,243,88,241,138,134,0,57,0,0,5,255,1,0,1,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,24,0,0,0>>,
<<202,61,251,115,244,157,40,164,79,204,162,60,152,120,
41,166,227,186,65,241,192,4,0,0,0,0,0,0,224,162,144,
223,205,199,5,234,103,243,88,241,138,134,0,57,0,0,5,
255,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0>>},
{<<245,144,229,46,196,207,25,40,148,41,201,180,146,220,
209,215,56,2,0,0,0,0,0,0,4,0,21,0,9,1,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0>>,
<<70,178,185,181,190,249,58,228,159,49,245,75,41,39,
80,136,8,162,209,129,56,2,0,0,0,0,0,0,4,0,21,0,9,1,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,7,0,0,0>>}},
[],12306,
{session,
<<251,139,237,31,93,75,145,208,29,161,230,192,225,160,
130,201,219,232,224,162,144,223,205,199,5,234,103,
243,88,241,138,134>>,
undefined,undefined,0,
<<0,57>>,
undefined,false,undefined},
24597,ssl_session_cache,
{3,1},
undefined,false,dhe_rsa,undefined,undefined,undefined,
undefined,undefined,#Ref<0.0.0.283>,
{<0.130.0>,#Ref<0.0.0.284>},
0,<<>>,true,
{false,first},
false,
{[],[]},
false}
** Reason for termination =
** {{badmatch,
{error,
{asn1,

@dylang
Copy link
Contributor

dylang commented Dec 16, 2014

I'm having similar replication problems since Nov 24. I created a separate ticket, #216, in case the issues not related.

@semmypurewal
Copy link

We've discovered this issue with Erlang that we think may be the root cause.

http://blog.towo.eu/bugwatch-erlang-and-sha256/

We don't have an easy path for updating Erlang on our machine, but we're working on it. If it fixes the issue, we'll report back here.

@seldo
Copy link

seldo commented Dec 19, 2014

Thanks very much! This seems a very likely culprit as the change we made on Nov. 24th was replacing our (expiring) older certificate with a new SHA256 cert.

@chongj615
Copy link
Author

I can confirm that our npm replication is now working again after upgrading erlang to 1:16.b.3-dfsg-1ubuntu2.1 on ubuntu 14.04.
The replication was failing on ubuntu 12.04 using 1:14.b.4-dfsg-1ubuntu1 erlang

@gilShin
Copy link

gilShin commented Jan 6, 2015

@chongj615

Upgraded and replication completed successfully but can't install packages using:
npm --registry http://localhost:5984/registry/_design/app/_rewrite install grunt

I get the insecure rewrites error message (configured secure_rewrites = false in all available _.ini files and restarted couchdb):
npm ERR! Error: insecure_rewrite_rule too many ../.. segments: registry/_design/app/_rewrite/grunt
npm ERR! at RegClient. (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:308:14)
npm ERR! at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:246:65)
npm ERR! at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:236:22)
npm ERR! at Request.emit (events.js:98:17)
npm ERR! at Request. (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1142:14)
npm ERR! at Request.emit (events.js:117:20)
npm ERR! at IncomingMessage. (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1096:12)
npm ERR! at IncomingMessage.emit (events.js:117:20)
npm ERR! at _stream_readable.js:944:16
npm ERR! at process.tickCallback (node.js:442:13)
npm ERR! If you need help, you may report this *entire
log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 3.13.0-43-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "--registry" "http://localhost:5984/registry/_design/app/_rewrite" "install" "grunt"
npm ERR! cwd /tmp/gridfs
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/gridfs/npm-debug.log
npm ERR! not ok code 0

Any help?

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

5 participants