Hi guys
I have an issue with views crashing.
This has occurred on both Linux and Windows distributions of CouchDB 1.0.1
Sometimes the views for a particular database will break. In Futon they
appear unresponsive.
The only way round this that I have seen is to delete and rebuild the
view file for the database in question.
This seems to happen more often on the Windows version but I don't think
it is anything to do with the >4Gb file issue.
Any help you could lend would be invaluable.
Thanks
Rob
I have included the error that was logged in the couchdb log file:
[Fri, 21 Jan 2011 12:18:28 GMT] [debug] [<0.738.0>] Exit from linked
pid: {<0.742.0>,
{timeout,
{gen_server,call,
[couch_query_servers,
{get_proc,<<"javascript">>}]}}}
[Fri, 21 Jan 2011 12:18:28 GMT] [error] [<0.738.0>] ** Generic server
<0.738.0> terminating
** Last message in was {'EXIT',<0.742.0>,
{timeout,
{gen_server,call,
[couch_query_servers,
{get_proc,<<"javascript">>}]}}}
** When Server state == {group_state,undefined,<<"testdb">>,
{"../var/lib/couchdb",<<"testdb">>,
{group,
<<166,184,63,42,190,3,207,140,145,79,103,251,0,220,
240,226>>,
nil,nil,<<"_design/testdb">>,<<"javascript">>,[],
[{view,0,
[<<"recent-items">>],
<<"/** \n * View: recent-items\n * A list of recently added items.\n *
Possibly Obsolete\n */\nfunction(doc) {\n if (doc.created_at) {\n
emit(doc.created_at, doc);\n }\n};">>,
nil,[],[]},
{view,1,
[<<"ReportJobs">>],
<<"/** \r\n * View: ReportJobs\r\n * Reporting function map. \r\n *
Allow basic customer/job/page display\r\n * Changed 7th Dec 2010 - don't
believed this is used\r\n */\r\nfunction(doc)\r\n{\r\n\tvar docType =
doc.type.toLowerCase();\r\n\t\r\n\tif( docType ==
'job'){\r\n\t\temit([doc.customer, doc.jobname, 0, 0],
doc);\t\r\n\t\t\r\n\t} else if ( docType == 'page'){\r\n\t\t\r\n\t\t//
Add order job before page\r\n\t\tvar ji =
doc.jobindex.split('.');\r\n\t\t\r\n\t\t// Convert from strings to
numbers\r\n\t\tfor (i in ji) ji[i] =
parseInt(ji[i]);\r\n\t\t\r\n\t\temit([doc.customer, doc.jobname, ji, 1],
doc);\r\n\t}\r\n}">>,
nil,[],[]},
{view,2,
[<<"archive">>],
<<"/** \r\n * View: archive\r\n * Get all documents of a job name chosen
in the key for archiving and restoring\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() !=
'user'){\r\n\t\t\r\n\t\temit(doc.jobname, doc);\r\n\t}\r\n}">>,
nil,[],[]},
{view,3,
[<<"clear">>],
<<"/** \r\n * View: clear\r\n * Return a list of all things so we can
delete them all\r\n */\r\nfunction(doc)\r\n{\t\r\n\tvar docType =
doc.type.toLowerCase();\r\n\tif(docType == 'job' || docType == 'npc' ||
docType == 'cpc' || docType == 'txt' || docType == 'page' || docType ==
'style' || docType == 'tag')\r\n\t\temit(doc._id, doc._rev);\r\n}">>,
nil,[],[]},
{view,4,
[<<"cpc">>],
<<"/** \r\n * View: cpc\r\n * For all documents of type 'job' and
'page', return all the data ordered by job name and job index.\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'cpc'){\r\n\t\t\r\n\t\t// Split up job index into an array\r\n\t\tvar ji
= doc.jobindex.split('.');\r\n\t\t\r\n\t\t// Convert from strings to
numbers\r\n\t\tfor (i in ji)\r\n\t\t\tji[i] =
parseInt(ji[i]);\r\n\t\t\r\n\t\t// JN: Changed for test but now this can
be extended as required so good change\r\n\t\temit([doc.jobname, ji],
doc);\r\n\t}\r\n}">>,
nil,[],[]},
{view,5,
[<<"document">>],
<<"/** \r\n * View: document\r\n * Return a list of job documents
ordered by the job name\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'job'){\r\n\t\t// JN: Changed for test but now this can be extended as
required so good change\r\n\t\temit(doc.jobname, doc);\r\n\t}\r\n}">>,
nil,[],[]},
{view,6,
[<<"job">>],
<<"/** \r\n * View: joblist\r\n * Check if a document is of type 'job'.
If so, The job and order by job name\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'job')\r\n\t\temit(doc.jobname, doc);\r\n}">>,
nil,[],[]},
{view,7,
[<<"joblist">>],
<<"/** \r\n * View: joblist\r\n * Check if a document is of type 'job'.
If so, return its id and job name\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'job')\r\n\t\temit(doc._id, doc.jobname);\r\n}">>,
nil,[],[]},
{view,8,
[<<"jobrevlevels">>],
<<"/** \r\n * View: jobrevlevels\r\n * Return a list of jobs and their
revision levels\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'job')\r\n\t\temit(doc.jobname, doc.revlevels);\r\n}">>,
nil,[],[]},
{view,9,
[<<"npc">>],
<<"/** \r\n * View: npc\r\n * For all documents of type 'job' and
'page', return all the data ordered by job name and job index.\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'npc'){\r\n\t\t\r\n\t\t// Split up job index into an array\r\n\t\tvar ji
= doc.jobindex.split('.');\r\n\t\t\r\n\t\t// Convert from strings to
numbers\r\n\t\tfor (i in ji)\r\n\t\t\tji[i] =
parseInt(ji[i]);\r\n\t\t\r\n\t\t// JN: Changed for test but now this can
be extended as required so good change\r\n\t\temit([doc.jobname, ji],
doc);\r\n\t}\r\n}">>,
nil,[],[]},
{view,10,
[<<"page">>],
<<"/** \r\n * View: page\r\n * Select all page documents and output them
ordered by the job name and page number\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'page'){\r\n\t\t\r\n\t\t// Split up job index into an array\r\n\t\tvar
ji = doc.jobindex.split('.');\r\n\t\t\r\n\t\t// Convert from strings to
numbers\r\n\t\tfor (i in ji)\r\n\t\t\tji[i] =
parseInt(ji[i]);\r\n\t\t\r\n\t\t\r\n\t\t// JN: Changed for test but now
this can be extended as required so good
change\r\n\t\temit([doc.jobname, ji], doc);\r\n\t}\r\n}">>,
nil,[],[]},
{view,11,
[<<"pagearraylist">>],
<<"/** \r\n * View: pagearraylist\r\n * Select all page documents and
output a summary containing the page number, section ID and status,
ordered by the job name\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() == 'job' ||
doc.type.toLowerCase() == 'page')\r\n\t{\r\n\t\t// JN: Changed for test
but now this can be extended as required so good
change\r\n\t\t\r\n\t\t// Split up job index into an array\r\n\t\tvar ji
= doc.jobindex.split('.');\r\n\t\t\r\n\t\t// Convert from strings to
numbers\r\n\t\tfor (i in ji)\r\n\t\t\tji[i] =
parseInt(ji[i]);\r\n\t\t\r\n\t\t// Split up job index into an
array\r\n\t\temit(doc.jobname, {\"jobindex\" : ji, \"sectionID\" :
doc.sectionID, \"status\" : doc.status });\r\n\t}\r\n}">>,
nil,[],[]},
{view,12,
[<<"pagelist">>],
<<"/** \r\n * View: pagelist\r\n * Return the job index for all
documents of type 'page' that have a specific job name. \r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'page')\r\n\t{\r\n\t\tvar batch = ( doc.batch == undefined ) ? \"NONE\"
: doc.batch;\r\n\t\t\r\n\t\t// JN: Changed for test but now this can be
extended as required so good change\r\n\t\temit(doc.jobname,{
\"jobindex\": doc.jobindex , \"sectionID\" : doc.sectionID , \"status\"
: doc.status , \"batch\" : batch, \"table\" : doc.table});\r\n\t}\r\n}">>,
nil,[],[]},
{view,13,
[<<"pages">>],
<<"/** \r\n * View: pages\r\n * For all documents of type 'job' and
'page', return all the data ordered by job name and job index.\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() == 'job' ||
doc.type.toLowerCase() == 'page')\r\n\t{\r\n\t\t// Split up job index
into an array\r\n\t\tvar ji = doc.jobindex.split('.');\r\n\t\t\r\n\t\t//
Convert from strings to numbers\r\n\t\tfor (i in ji)\r\n\t\t\tji[i] =
parseInt(ji[i]);\r\n\t\t\r\n\t\t// JN: Changed for test but now this can
be extended as required so good change\r\n\t\temit({\"jobname\" :
doc.jobname, \"jobindex\" : ji},{ \"jobindex\": doc.jobindex, \"data\" :
doc.data });\r\n\t}\r\n}">>,
nil,[],[]},
{view,14,
[<<"pagesarray">>],
<<"/** \r\n * View: pagesarray\r\n * Pages map function but converting
page index to an array.\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() == 'job' ||
doc.type.toLowerCase() == 'page')\r\n\t{\r\n\t\t// Split up job index
into an array\r\n\t\tvar ji = doc.jobindex.split('.');\r\n\t\t\r\n\t\t//
Convert from strings to numbers\r\n\t\tfor (i in ji)\r\n\t\t\tji[i] =
parseInt(ji[i]);\r\n\t\t\r\n\t\t// JN: Changed for test but now this can
be extended as required so good change\r\n\t\temit({\"jobname\" :
doc.jobname, \"jobindex\" : ji},{ \"jobindex\": doc.jobindex, \"data\" :
doc.data });\r\n\t}\r\n}">>,
nil,[],[]},
{view,15,
[<<"style">>],
<<"/** \r\n * View: style\r\n * Return the Style doc that have a
specific style name job name. \r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'style')\r\n\t{\r\n\t\t// JN: Changed for test but now this can be
extended as required so good
change\r\n\t\temit(doc.stylename,doc);\r\n\t}\r\n}">>,
nil,[],[]},
{view,16,
[<<"stylelist">>],
<<"/** \r\n * View: stylelist\r\n * Check if a document is of type
'job'. If so, return its id and job name.\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'style')\r\n\t\temit(doc._id, doc.stylename);\r\n}">>,
nil,[],[]},
{view,17,
[<<"tag">>],
<<"/** \r\n * View: tag\r\n * Check if a document is of type 'tag'.
Return the document ordered by the document name\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
\"tag\")\r\n\t{\r\n\t\temit(doc.name, doc);\r\n\t}\r\n};">>,
nil,[],[]},
{view,18,
[<<"txt">>],
<<"/** \r\n * View: txt\r\n * For all documents of type 'job' and
'page', return all the data ordered by job name and job index.\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'txt'){\r\n\t\t\r\n\t\t// Split up job index into an array\r\n\t\tvar ji
= doc.jobindex.split('.');\r\n\t\t\r\n\t\t// Convert from strings to
numbers\r\n\t\tfor (i in ji)\r\n\t\t\tji[i] =
parseInt(ji[i]);\r\n\t\t\r\n\t\t// JN: Changed for test but now this can
be extended as required so good change\r\n\t\temit([doc.jobname, ji],
doc);\r\n\t}\r\n}">>,
nil,[],[]},
{view,19,
[<<"user">>],
<<"/** \r\n * View: txt\r\n * Select all documents of type 'user' and
output the user name, password and user levels ordered by the document
ID.\r\n */\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'user'){\r\n\t\temit(doc._id, {\"username\" : doc.username,
\r\n\t\t\t\t\t \"password\" : doc.password, \r\n\t\t\t\t\t
\"user_level_user\" : doc.user_level_user, \r\n\t\t\t\t\t
\"user_level_dev\" : doc.user_level_dev, \r\n\t\t\t\t\t
\"user_level_admin\" : doc.user_level_admin});\r\n\t}\r\n}">>,
nil,[],[]}],
nil,0,0,nil,nil}},
{group,
<<166,184,63,42,190,3,207,140,145,79,103,251,0,220,
240,226>>,
{db,<0.173.0>,<0.174.0>,nil,<<"1295611751291001">>,
<0.171.0>,<0.176.0>,
{db_header,5,32387,0,
{375680498,{11560,19361}},
{375682738,30921},
{370499732,[]},
0,nil,nil,1000},
32387,
{btree,<0.171.0>,
{375680498,{11560,19361}},
#Fun<couch_db_updater.7.69395062>,
#Fun<couch_db_updater.8.86519079>,
#Fun<couch_btree.5.124754102>,
#Fun<couch_db_updater.9.24674233>},
{btree,<0.171.0>,
{375682738,30921},
#Fun<couch_db_updater.10.90337910>,
#Fun<couch_db_updater.11.13595824>,
#Fun<couch_btree.5.124754102>,
#Fun<couch_db_updater.12.34906778>},
{btree,<0.171.0>,
{370499732,[]},
#Fun<couch_btree.0.83553141>,
#Fun<couch_btree.1.30790806>,
#Fun<couch_btree.2.124754102>,nil},
32387,<<"testdb">>,
"../var/lib/couchdb/testdb.couch",[],[],nil,
{user_ctx,null,[],undefined},
nil,1000,
[before_header,after_header,on_file_open],
false},
<0.740.0>,<<"_design/testdb">>,<<"javascript">>,[],
[{view,0,
[<<"recent-items">>],
<<"/** \n * View: recent-items\n * A list of recently added items.\n *
Possibly Obsolete\n */\nfunction(doc) {\n if (doc.created_at) {\n
emit(doc.created_at, doc);\n }\n};">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,1,
[<<"ReportJobs">>],
<<"/** \r\n * View: ReportJobs\r\n * Reporting function map. \r\n *
Allow basic customer/job/page display\r\n * Changed 7th Dec 2010 - don't
believed this is used\r\n */\r\nfunction(doc)\r\n{\r\n\tvar docType =
doc.type.toLowerCase();\r\n\t\r\n\tif( docType ==
'job'){\r\n\t\temit([doc.customer, doc.jobname, 0, 0],
doc);\t\r\n\t\t\r\n\t} else if ( docType == 'page'){\r\n\t\t\r\n\t\t//
Add order job before page\r\n\t\tvar ji =
doc.jobindex.split('.');\r\n\t\t\r\n\t\t// Convert from strings to
numbers\r\n\t\tfor (i in ji) ji[i] =
parseInt(ji[i]);\r\n\t\t\r\n\t\temit([doc.customer, doc.jobname, ji, 1],
doc);\r\n\t}\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,2,
[<<"archive">>],
<<"/** \r\n * View: archive\r\n * Get all documents of a job name chosen
in the key for archiving and restoring\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() !=
'user'){\r\n\t\t\r\n\t\temit(doc.jobname, doc);\r\n\t}\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,3,
[<<"clear">>],
<<"/** \r\n * View: clear\r\n * Return a list of all things so we can
delete them all\r\n */\r\nfunction(doc)\r\n{\t\r\n\tvar docType =
doc.type.toLowerCase();\r\n\tif(docType == 'job' || docType == 'npc' ||
docType == 'cpc' || docType == 'txt' || docType == 'page' || docType ==
'style' || docType == 'tag')\r\n\t\temit(doc._id, doc._rev);\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,4,
[<<"cpc">>],
<<"/** \r\n * View: cpc\r\n * For all documents of type 'job' and
'page', return all the data ordered by job name and job index.\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'cpc'){\r\n\t\t\r\n\t\t// Split up job index into an array\r\n\t\tvar ji
= doc.jobindex.split('.');\r\n\t\t\r\n\t\t// Convert from strings to
numbers\r\n\t\tfor (i in ji)\r\n\t\t\tji[i] =
parseInt(ji[i]);\r\n\t\t\r\n\t\t// JN: Changed for test but now this can
be extended as required so good change\r\n\t\temit([doc.jobname, ji],
doc);\r\n\t}\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,5,
[<<"document">>],
<<"/** \r\n * View: document\r\n * Return a list of job documents
ordered by the job name\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'job'){\r\n\t\t// JN: Changed for test but now this can be extended as
required so good change\r\n\t\temit(doc.jobname, doc);\r\n\t}\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,6,
[<<"job">>],
<<"/** \r\n * View: joblist\r\n * Check if a document is of type 'job'.
If so, The job and order by job name\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'job')\r\n\t\temit(doc.jobname, doc);\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,7,
[<<"joblist">>],
<<"/** \r\n * View: joblist\r\n * Check if a document is of type 'job'.
If so, return its id and job name\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'job')\r\n\t\temit(doc._id, doc.jobname);\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,8,
[<<"jobrevlevels">>],
<<"/** \r\n * View: jobrevlevels\r\n * Return a list of jobs and their
revision levels\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'job')\r\n\t\temit(doc.jobname, doc.revlevels);\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,9,
[<<"npc">>],
<<"/** \r\n * View: npc\r\n * For all documents of type 'job' and
'page', return all the data ordered by job name and job index.\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'npc'){\r\n\t\t\r\n\t\t// Split up job index into an array\r\n\t\tvar ji
= doc.jobindex.split('.');\r\n\t\t\r\n\t\t// Convert from strings to
numbers\r\n\t\tfor (i in ji)\r\n\t\t\tji[i] =
parseInt(ji[i]);\r\n\t\t\r\n\t\t// JN: Changed for test but now this can
be extended as required so good change\r\n\t\temit([doc.jobname, ji],
doc);\r\n\t}\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,10,
[<<"page">>],
<<"/** \r\n * View: page\r\n * Select all page documents and output them
ordered by the job name and page number\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'page'){\r\n\t\t\r\n\t\t// Split up job index into an array\r\n\t\tvar
ji = doc.jobindex.split('.');\r\n\t\t\r\n\t\t// Convert from strings to
numbers\r\n\t\tfor (i in ji)\r\n\t\t\tji[i] =
parseInt(ji[i]);\r\n\t\t\r\n\t\t\r\n\t\t// JN: Changed for test but now
this can be extended as required so good
change\r\n\t\temit([doc.jobname, ji], doc);\r\n\t}\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,11,
[<<"pagearraylist">>],
<<"/** \r\n * View: pagearraylist\r\n * Select all page documents and
output a summary containing the page number, section ID and status,
ordered by the job name\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() == 'job' ||
doc.type.toLowerCase() == 'page')\r\n\t{\r\n\t\t// JN: Changed for test
but now this can be extended as required so good
change\r\n\t\t\r\n\t\t// Split up job index into an array\r\n\t\tvar ji
= doc.jobindex.split('.');\r\n\t\t\r\n\t\t// Convert from strings to
numbers\r\n\t\tfor (i in ji)\r\n\t\t\tji[i] =
parseInt(ji[i]);\r\n\t\t\r\n\t\t// Split up job index into an
array\r\n\t\temit(doc.jobname, {\"jobindex\" : ji, \"sectionID\" :
doc.sectionID, \"status\" : doc.status });\r\n\t}\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,12,
[<<"pagelist">>],
<<"/** \r\n * View: pagelist\r\n * Return the job index for all
documents of type 'page' that have a specific job name. \r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'page')\r\n\t{\r\n\t\tvar batch = ( doc.batch == undefined ) ? \"NONE\"
: doc.batch;\r\n\t\t\r\n\t\t// JN: Changed for test but now this can be
extended as required so good change\r\n\t\temit(doc.jobname,{
\"jobindex\": doc.jobindex , \"sectionID\" : doc.sectionID , \"status\"
: doc.status , \"batch\" : batch, \"table\" : doc.table});\r\n\t}\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,13,
[<<"pages">>],
<<"/** \r\n * View: pages\r\n * For all documents of type 'job' and
'page', return all the data ordered by job name and job index.\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() == 'job' ||
doc.type.toLowerCase() == 'page')\r\n\t{\r\n\t\t// Split up job index
into an array\r\n\t\tvar ji = doc.jobindex.split('.');\r\n\t\t\r\n\t\t//
Convert from strings to numbers\r\n\t\tfor (i in ji)\r\n\t\t\tji[i] =
parseInt(ji[i]);\r\n\t\t\r\n\t\t// JN: Changed for test but now this can
be extended as required so good change\r\n\t\temit({\"jobname\" :
doc.jobname, \"jobindex\" : ji},{ \"jobindex\": doc.jobindex, \"data\" :
doc.data });\r\n\t}\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,14,
[<<"pagesarray">>],
<<"/** \r\n * View: pagesarray\r\n * Pages map function but converting
page index to an array.\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() == 'job' ||
doc.type.toLowerCase() == 'page')\r\n\t{\r\n\t\t// Split up job index
into an array\r\n\t\tvar ji = doc.jobindex.split('.');\r\n\t\t\r\n\t\t//
Convert from strings to numbers\r\n\t\tfor (i in ji)\r\n\t\t\tji[i] =
parseInt(ji[i]);\r\n\t\t\r\n\t\t// JN: Changed for test but now this can
be extended as required so good change\r\n\t\temit({\"jobname\" :
doc.jobname, \"jobindex\" : ji},{ \"jobindex\": doc.jobindex, \"data\" :
doc.data });\r\n\t}\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,15,
[<<"style">>],
<<"/** \r\n * View: style\r\n * Return the Style doc that have a
specific style name job name. \r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'style')\r\n\t{\r\n\t\t// JN: Changed for test but now this can be
extended as required so good
change\r\n\t\temit(doc.stylename,doc);\r\n\t}\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,16,
[<<"stylelist">>],
<<"/** \r\n * View: stylelist\r\n * Check if a document is of type
'job'. If so, return its id and job name.\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'style')\r\n\t\temit(doc._id, doc.stylename);\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,17,
[<<"tag">>],
<<"/** \r\n * View: tag\r\n * Check if a document is of type 'tag'.
Return the document ordered by the document name\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
\"tag\")\r\n\t{\r\n\t\temit(doc.name, doc);\r\n\t}\r\n};">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,18,
[<<"txt">>],
<<"/** \r\n * View: txt\r\n * For all documents of type 'job' and
'page', return all the data ordered by job name and job index.\r\n
*/\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'txt'){\r\n\t\t\r\n\t\t// Split up job index into an array\r\n\t\tvar ji
= doc.jobindex.split('.');\r\n\t\t\r\n\t\t// Convert from strings to
numbers\r\n\t\tfor (i in ji)\r\n\t\t\tji[i] =
parseInt(ji[i]);\r\n\t\t\r\n\t\t// JN: Changed for test but now this can
be extended as required so good change\r\n\t\temit([doc.jobname, ji],
doc);\r\n\t}\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]},
{view,19,
[<<"user">>],
<<"/** \r\n * View: txt\r\n * Select all documents of type 'user' and
output the user name, password and user levels ordered by the document
ID.\r\n */\r\nfunction(doc)\r\n{\r\n\tif(doc.type.toLowerCase() ==
'user'){\r\n\t\temit(doc._id, {\"username\" : doc.username,
\r\n\t\t\t\t\t \"password\" : doc.password, \r\n\t\t\t\t\t
\"user_level_user\" : doc.user_level_user, \r\n\t\t\t\t\t
\"user_level_dev\" : doc.user_level_dev, \r\n\t\t\t\t\t
\"user_level_admin\" : doc.user_level_admin});\r\n\t}\r\n}">>,
{btree,<0.740.0>,nil,
#Fun<couch_btree.3.83553141>,
#Fun<couch_btree.4.30790806>,
#Fun<couch_view.less_json_ids.2>,
#Fun<couch_view_group.10.120246376>},
[],[]}],
{btree,<0.740.0>,nil,#Fun<couch_btree.0.83553141>,
#Fun<couch_btree.1.30790806>,
#Fun<couch_btree.2.124754102>,nil},
0,0,nil,nil},
<0.742.0>,nil,false,
[{{<0.728.0>,#Ref<0.0.0.60542>},32387}],
<0.743.0>}
** Reason for termination ==
** {timeout,{gen_server,call,
[couch_query_servers,{get_proc,<<"javascript">>}]}}
[Fri, 21 Jan 2011 12:18:28 GMT] [error] [<0.738.0>] {error_report,<0.33.0>,
{<0.738.0>,crash_report,
[[{initial_call,{couch_view_group,init,['Argument__1']}},
{pid,<0.738.0>},
{registered_name,[]},
{error_info,
{exit,
{timeout,
{gen_server,call,
[couch_query_servers,{get_proc,<<"javascript">>}]}},
[{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}},
{ancestors,
[couch_view,couch_secondary_services,couch_server_sup,<0.34.0>]},
{messages,[]},
{links,[<0.740.0>,<0.103.0>]},
{dictionary,[]},
{trap_exit,true},
{status,running},
{heap_size,2584},
{stack_size,24},
{reductions,855}],
[]]}}
[Fri, 21 Jan 2011 12:18:28 GMT] [debug] [<0.728.0>] request_group Error
{timeout,
{gen_server,call,
[couch_query_servers,
{get_proc,<<"javascript">>}]}}
[Fri, 21 Jan 2011 12:18:28 GMT] [error] [<0.740.0>] ** Generic server
<0.740.0> terminating
** Last message in was {'EXIT',<0.738.0>,
{timeout,
{gen_server,call,
[couch_query_servers,
{get_proc,<<"javascript">>}]}}}
** When Server state ==
{file,{file_descriptor,prim_file,{#Port<0.4047>,596}},
0,51}
** Reason for termination ==
** {timeout,{gen_server,call,
[couch_query_servers,{get_proc,<<"javascript">>}]}}
[Fri, 21 Jan 2011 12:18:28 GMT] [error] [<0.740.0>] {error_report,<0.33.0>,
{<0.740.0>,crash_report,
[[{initial_call,{couch_file,init,['Argument__1']}},
{pid,<0.740.0>},
{registered_name,[]},
{error_info,
{exit,
{timeout,
{gen_server,call,
[couch_query_servers,{get_proc,<<"javascript">>}]}},
[{gen_server,terminate,6},{proc_lib,init_p_do_apply,3}]}},
{ancestors,
[<0.738.0>,couch_view,couch_secondary_services,couch_server_sup,
<0.34.0>]},
{messages,[]},
{links,[#Port<0.4047>,<0.743.0>]},
{dictionary,[]},
{trap_exit,true},
{status,running},
{heap_size,610},
{stack_size,24},
{reductions,1435}],
[{neighbour,
[{pid,<0.743.0>},
{registered_name,[]},
{initial_call,{couch_ref_counter,init,['Argument__1']}},
{current_function,{gen_server,loop,6}},
{ancestors,
[<0.738.0>,couch_view,couch_secondary_services,
couch_server_sup,<0.34.0>]},
{messages,
[{'DOWN',#Ref<0.0.0.60538>,process,<0.738.0>,
{timeout,
{gen_server,call,
[couch_query_servers,
{get_proc,<<"javascript">>}]}}}]},
{links,[<0.740.0>]},
{dictionary,[]},
{trap_exit,false},
{status,runnable},
{heap_size,233},
{stack_size,9},
{reductions,47}]}]]}}