We have recently migrated our Ubuntu from 20 to 22, now the problem when using Ubuntu 22 is the Couchb. I have CouchDB 3.3.3 installed on both 20 & 22, but only ubuntu 20 works fine. For ubuntu 22 similar view with javascript code didn’t work.
view-sessions_by_user_ref-map (view file)
function(doc) {
if (doc.type == 'sessionmanagersessiondoc') {
emit(doc.user_ref, {
'user_name': doc.user_name,
'expiry_time': doc.expiry_time,
'last_updated': doc.last_updated,
'comment': doc.comment});
}
}
This is the return.
{
"error": "{undef,[{couch_ejson_compare,get_collator_version,[],[]},n {couch_mrview_util,update_collator_versions,1,n [{file,"src/couch_mrview_util.erl"},{line,1333}]},n {couch_mrview_util,init_state,4,n [{file,"src/couch_mrview_util.erl"},{line,344}]},n {couch_mrview_index,init_and_upgrade_state,4,n [{file,"src/couch_mrview_index.erl"},{line,329}]},n {couch_mrview_index,open,2,n [{file,"src/couch_mrview_index.erl"},{line,135}]},n {couch_index,'-init/1-fun-0-',3,n [{file,"src/couch_index.erl"},{line,78}]},n {couch_util,with_db,2,[{file,"src/couch_util.erl"},{line,572}]},n {couch_index,init,1,[{file,"src/couch_index.erl"},{line,77}]}]}",
"reason": "{gen_server,call,n [index_server_1,n {get_index,n {couch_mrview_index,n {mrst,n <<57,223,102,9,37,185,190,225,163,76,226,3,131,31,109,177>>,n nil,undefined,n <<"shards/80000000-ffffffff/sessionmanager.1715319230">>,n <<"_design/main">>,<<"javascript">>,[],false,n {[]},n [{mrview,0,0,0,n [<<"sessions_by_user_ref">>],n [],n <<"function(doc) {\n if (doc.type == 'sessionmanagerdsessiondoc') {\n emit(doc.user_ref, {\n 'user_name': doc.user_name,\n 'last_updated': doc.last_updated,\n 'comment': doc.comment});\n }\n}">>,n nil,[]},n {mrview,1,0,0,n [<<"sessions_no_expiry">>],n [],n <<"function(doc) {\n if (doc.type == 'sessionmanagersessiondoc' && doc.expiry_time == 0) {\n emit(doc.last_updated, doc.ref);\n }\n}\n">>,n nil,[]},n {mrview,2,0,0,n [<<"sessions_by_expiry_time">>],n [],n <<"function(doc) {\n if (doc.type == 'sessionmanagersessiondoc' && doc.expiry_time > 0) {\n emit(doc.expiry_time, doc.ref);\n }\n}\n">>,n nil,[]}],n nil,0,0,undefined,undefined,undefined,undefined,undefined,n nil,#{}},n <<"shards/80000000-ffffffff/sessionmanager.1715319230">>,n <<57,223,102,9,37,185,190,225,163,76,226,3,131,31,109,177>>}},n infinity]}",
"ref": 352762430 }