# Getting error 500 when loading docs

**URL:** <https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976>\
**Category:** Technical Support\
**Created:** [July 5, 2022, 11:41am UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976 "2022-07-05T11:41:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![melema](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@melema](https://forum.communityhealthtoolkit.org/u/melema)\
**Post date:** [July 5, 2022, 11:41am UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/1 "2022-07-05T11:41:51Z")

</div>

I have some users who are logging in for the first time and when the docs start to load, the randomly get 500.

 ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/1/15c0e53de70f3094b1f7b837d9eaed815fd32480.jpeg)

**Medic API logs:-**

[2022-07-04 10:09:56] 2022-07-04 10:09:56 INFO: 56d31ab2-a94e-4754-8a92-a4ec791a55af Error while requesting ‘normal’ changes feed [2022-07-04 10:09:56] 2022-07-04 10:09:56 INFO: {​​​​​​badmatch,{​​​​​​’EXIT’,noproc}​​​​​​,[2022-07-04 10:09:56] [{​​​​​​couch\_file,pread\_binary,2,[2022-07-04 10:09:56] [{​​​​​​file,“src/couch\_file.erl”}​​​​​​,{​​​​​​line,169}​​​​​​]}​​​​​​,[2022-07-04 10:09:56] {​​​​​​couch\_file,pread\_term,2,[{​​​​​​file,“src/couch\_file.erl”}​​​​​​,{​​​​​​line,157}​​​​​​]}​​​​​​,[2022-07-04 10:09:56] {​​​​​​couch\_btree,get\_node,2,[{​​​​​​file,“src/couch\_btree.erl”}​​​​​​,{​​​​​​line,434}​​​​​​]}​​​​​​,[2022-07-04 10:09:56] {​​​​​​couch\_btree,lookup,3,[{​​​​​​file,“src/couch\_btree.erl”}​​​​​​,{​​​​​​line,284}​​​​​​]}​​​​​​,[2022-07-04 10:09:56] {​​​​​​couch\_btree,lookup\_kpnode,5,[2022-07-04 10:09:56] [{​​​​​​file,“src/couch\_btree.erl”}​​​​​​,{​​​​​​line,304}​​​​​​]}​​​​​​,[2022-07-04 10:09:56] {​​​​​​couch\_btree,lookup,2,[{​​​​​​file,“src/couch\_btree.erl”}​​​​​​,{​​​​​​line,274}​​​​​​]}​​​​​​,[2022-07-04 10:09:56] {​​​​​​couch\_bt\_engine,open\_docs,2,[2022-07-04 10:09:56] [{​​​​​​file,“src/couch\_bt\_engine.erl”}​​​​​​,{​​​​​​line,327}​​​​​​]}​​​​​​,[2022-07-04 10:09:56] {​​​​​​couch\_changes,send\_changes\_doc\_ids,6,[2022-07-04 10:09:56] [{​​​​​​file,“src/couch\_changes.erl”}​​​​​​,{​​​​​​line,583}​​​​​​]}​​​​​​]}​​​​​​ [2022-07-04 10:09:56] 2022-07-04 10:09:56 INFO: c6620af5-ba32-40b9-afeb-b662274fdab6 Error while requesting ‘normal’ changes feed [2022-07-04 10:09:56] 2022-07-04 10:09:56 INFO: {​​​​​​badmatch,{​​​​​​’EXIT’,noproc}​​​​​​,[2022-07-04 10:09:56] [{​​​​​​couch\_file,pread\_binary,2,[2022-07-04 10:09:56] [{​​​​​​file,“src/couch\_file.erl”}​​​​​​,{​​​​​​line,169}​​​​​​]}​​​​​​,[2022-07-04 10:09:56] {​​​​​​couch\_file,pread\_term,2,[{​​​​​​file,“src/couch\_file.erl”}​​​​​​,{​​​​​​line,157}​​​​​​]}​​​​​​,[2022-07-04 10:09:56] {​​​​​​couch\_btree,get\_node,2,[{​​​​​​file,“src/couch\_btree.erl”}​​​​​​,{​​​​​​line,434}​​​​​​]}​​​​​​,[2022-07-04 10:09:56] {​​​​​​couch\_btree,lookup,3,[{​​​​​​file,“src/couch\_btree.erl”}​​​​​​,{​​​​​​line,284}​​​​​​]}​​​​​​,[2022-07-04 10:09:56] {​​​​​​couch\_btree,lookup\_kpnode,5,[2022-07-04 10:09:56] [{​​​​​​file,“src/couch\_btree.erl”}​​​​​​,{​​​​​​line,304}​​​​​​]}​​​​​​,[2022-07-04 10:09:56] {​​​​​​couch\_btree,lookup,2,[{​​​​​​file,“src/couch\_btree.erl”}​​​​​​,{​​​​​​line,274}​​​​​​]}​​​​​​,[2022-07-04 10:09:56] {​​​​​​couch\_bt\_engine,open\_docs,2,[2022-07-04 10:09:56] [{​​​​​​file,“src/couch\_bt\_engine.erl”}​​​​​​,{​​​​​​line,327}​​​​​​]}​​​​​​,[2022-07-04 10:09:56] {​​​​​​couch\_changes,send\_changes\_doc\_ids,6,[2022-07-04 10:09:56] [{​​​​​​file,“src/couch\_changes.erl”}​​​​​​,{​​​​​​line,583}​​​​​​]}​​​​​​]}​​​​​​

[2022-07-04 10:09:56] RES 56d31ab2-a94e-4754-8a92-a4ec791a55af 105.160.99.227 - GET /medic/\_changes?timeout=600000&style=all\_docs&heartbeat=10000&since=5366995-g1AAAAJ7eJyd0EsKwjAQBuBgBcWdC9d6Akk0SaMbvYMH0M4kpRQfK1cu9CZ6EdGTqIdwKzUmpasitAQmkGE-\_smaENJOAk26uNtjomHORuGQ2sPWttWICPSzLEuTAEhH9jb2rQWKUwRZNvNHgoGtMCswqh0mEajQqio2\_2HLAguvDoulMHEoqmKrH3YssPHBYZpPDJq4IrZt2kpO9rLe2YPTjwNRKSPQ1AIvHrzl6z4cKKTgqOslvHvwmSd8O5BFqGFSL-HLg\_kfmoUDI6Y4o7xsNP0CbhWnJA&limit=100 HTTP/1.0 500 - 4479.850 ms

**CouchDB logs:-**

[error] 2022-07-04T10:13:23.968735Z [couchdb@127.0.0.1](mailto:couchdb@127.0.0.1) \<0.26306.2494\> -------- CRASH REPORT Process (\<0.26306.2494\>) with 0 neighbors exited with reason: no function clause matching couch\_db\_updater:maybe\_tag\_doc({​​​​​​doc,\<\<“ba1e817b-4d1f-4708-a41e-8753c86f757b”\>\>,{​​​​​​0,[]}​​​​​​,[\<\<128,0,0,25\>\>,\<\<233,240,209,55,27,174,…\>\>,…],…}​​​​​​)(line:267) at couch\_db\_updater:‘-sort\_and\_tag\_grouped\_docs/2-lc$^0/1-0-’/2(line:264) \<= lists:map/2(line:1239) \<= couch\_db\_updater:handle\_info/2(line:165) \<= gen\_server:try\_dispatch/4(line:601) \<= gen\_server:handle\_msg/5(line:667) \<= couch\_db\_updater:init/1(line:45) \<= proc\_lib:init\_p\_do\_apply/3(line:247) at gen\_server:terminate/7(line:812) \<= couch\_db\_updater:init/1(line:45) \<= proc\_lib:init\_p\_do\_apply/3(line:247); initial\_call: {​​​​​​couch\_db\_updater,init,[‘Argument\_\_1’]}​​​​​​, ancestors: [\<0.6536.2502\>], messages: [], links: [\<0.218.0\>], dictionary: [{​​​​​​idle\_limit,61000}​​​​​​,{​​​​​​io\_priority,{​​​​​​db\_update,\<\<“shards/00000000-1fffffff/me…”\>\>}​​​​​​}​​​​​​], trap\_exit: false, status: running, heap\_size: 6772, stack\_size: 27, reductions: 1335

[info] 2022-07-04T10:13:23.993714Z [couchdb@127.0.0.1](mailto:couchdb@127.0.0.1) \<0.218.0\> -------- db shards/00000000-1fffffff/medic.1632510268 died with reason {​​​​​​function\_clause,[{​​​​​​couch\_db\_updater,maybe\_tag\_doc,[{​​​​​​doc,\<\<“6197b8f4-2650-45e6-ab3e-b7e755e59560”\>\>,{​​​​​​0,[]}​​​​​​,[\<\<128,0,0,25\>\>,\<\<233,240,209,55,27,174,216,56,116,74,41,142,69,49,20,211\>\>,\<\<131,104,2,109,0,0,0,7,1,4,12,131,104,1,106,109,0,0,0,5,1,2,4,131,106\>\>],[],false,[{​​​​​​comp\_body,\<\<1,4,12,131,104,1,106\>\>}​​​​​​,{​​​​​​size\_info,[]}​​​​​​,{​​​​​​atts\_stream,nil}​​​​​​,{​​​​​​ejson\_size,4}​​​​​​,{​​​​​​ref,#Ref\<0.0.1248067591.73865\>}​​​​​​]}​​​​​​],[{​​​​​​file,“src/couch\_db\_updater.erl”}​​​​​​,{​​​​​​line,267}​​​​​​]}​​​​​​,{​​​​​​couch\_db\_updater,‘-sort\_and\_tag\_grouped\_docs/2-lc$^0/1-0-’,2,[{​​​​​​file,“src/couch\_db\_updater.erl”}​​​​​​,{​​​​​​line,264}​​​​​​]}​​​​​​,{​​​​​​lists,map,2,[{​​​​​​file,“lists.erl”}​​​​​​,{​​​​​​line,1239}​​​​​​]}​​​​​​,{​​​​​​couch\_db\_updater,handle\_info,2,[{​​​​​​file,“src/couch\_db\_updater.erl”}​​​​​​,{​​​​​​line,165}​​​​​​]}​​​​​​,{​​​​​​gen\_server,try\_dispatch,4,[{​​​​​​file,“gen\_server.erl”}​​​​​​,{​​​​​​line,601}​​​​​​]}​​​​​​,{​​​​​​gen\_server,handle\_msg,5,[{​​​​​​file,“gen\_server.erl”}​​​​​​,{​​​​​​line,667}​​​​​​]}​​​​​​,{​​​​​​couch\_db\_updater,init,1,[{​​​​​​file,“src/couch\_db\_updater.erl”}​​​​​​,{​​​​​​line,45}​​​​​​]}​​​​​​,{​​​​​​proc\_lib,init\_p\_do\_apply,3,[{​​​​​​file,“proc\_lib.erl”}​​​​​​,{​​​​​​line,247}​​​​​​]}​​​​​​]}​​​​​​

[error] 2022-07-04T10:13:23.993778Z [couchdb@127.0.0.1](mailto:couchdb@127.0.0.1) \<0.24805.2509\> -------- rexi\_server: from: [couchdb@127.0.0.1](mailto:couchdb@127.0.0.1)(\<0.12614.2498\>) mfa: fabric\_rpc:update\_docs/3 exit:{​​​​​​function\_clause,[{​​​​​​couch\_db\_updater,maybe\_tag\_doc,[{​​​​​​doc,\<\<“6197b8f4-2650-45e6-ab3e-b7e755e59560”\>\>,{​​​​​​0,[]}​​​​​​,[\<\<128,0,0,25\>\>,\<\<233,240,209,55,27,174,216,56,116,74,41,142,69,49,20,211\>\>,\<\<131,104,2,109,0,0,0,7,1,4,12,131,104,1,106,109,0,0,0,5,1,2,4,131,106\>\>],[],false,[{​​​​​​comp\_body,\<\<1,4,12,131,104,1,106\>\>}​​​​​​,{​​​​​​size\_info,[]}​​​​​​,{​​​​​​atts\_stream,nil}​​​​​​,{​​​​​​ejson\_size,4}​​​​​​,{​​​​​​ref,#Ref\<0.0.1248067591.73865\>}​​​​​​]}​​​​​​],[{​​​​​​file,“src/couch\_db\_updater.erl”}​​​​​​,{​​​​​​line,267}​​​​​​]}​​​​​​,{​​​​​​couch\_db\_updater,‘-sort\_and\_tag\_grouped\_docs/2-lc$^0/1-0-’,2,[{​​​​​​file,“src/couch\_db\_updater.erl”}​​​​​​,{​​​​​​line,264}​​​​​​]}​​​​​​,{​​​​​​lists,map,2,[{​​​​​​file,“lists.erl”}​​​​​​,{​​​​​​line,1239}​​​​​​]}​​​​​​,{​​​​​​couch\_db\_updater,handle\_info,2,[{​​​​​​file,“src/couch\_db\_updater.erl”}​​​​​​,{​​​​​​line,165}​​​​​​]}​​​​​​,{​​​​​​gen\_server,try\_dispatch,4,[{​​​​​​file,“gen\_server.erl”}​​​​​​,{​​​​​​line,601}​​​​​​]}​​​​​​,{​​​​​​gen\_server,handle\_msg,5,[{​​​​​​file,“gen\_server.erl”}​​​​​​,{​​​​​​line,667}​​​​​​]}​​​​​​,{​​​​​​couch\_db\_updater,init,1,[{​​​​​​file,“src/couch\_db\_updater.erl”}​​​​​​,{​​​​​​line,45}​​​​​​]}​​​​​​,{​​​​​​proc\_lib,init\_p\_do\_apply,3,[{​​​​​​file,“proc\_lib.erl”}​​​​​​,{​​​​​​line,247}​​​​​​]}​​​​​​]}​​​​​​ [{​​​​​​couch\_db,collect\_results,3,[{​​​​​​file,“src/couch\_db.erl”}​​​​​​,{​​​​​​line,1251}​​​​​​]}​​​​​​,{​​​​​​couch\_db,collect\_results\_with\_metrics,3,[{​​​​​​file,“src/couch\_db.erl”}​​​​​​,{​​​​​​line,1233}​​​​​​]}​​​​​​,{​​​​​​couch\_db,write\_and\_commit,4,[{​​​​​​file,“src/couch\_db.erl”}​​​​​​,{​​​​​​line,1263}​​​​​​]}​​​​​​,{​​​​​​couch\_db,update\_docs,4,[{​​​​​​file,“src/couch\_db.erl”}​​​​​​,{​​​​​​line,1155}​​​​​​]}​​​​​​,{​​​​​​fabric\_rpc,with\_db,3,[{​​​​​​file,“src/fabric\_rpc.erl”}​​​​​​,{​​​​​​line,334}​​​​​​]}​​​​​​,{​​​​​​rexi\_server,init\_p,3,[{​​​​​​file,“src/rexi\_server.erl”}​​​​​​,{​​​​​​line,140}​​​​​​]}​​​​​​]

[notice] 2022-07-04T10:13:23.994029Z [couchdb@127.0.0.1](mailto:couchdb@127.0.0.1) \<0.22169.2508\> b56fc793d3 [echis-production-go-ke.lg-apps.com](http://echis-production-go-ke.lg-apps.com) 44.199.169.171 medic-replication PUT /medic/6197b8f4-2650-45e6-ab3e-b7e755e59560?new\_edits=false 500 ok 5

[error] 2022-07-04T10:13:23.994399Z [couchdb@127.0.0.1](mailto:couchdb@127.0.0.1) \<0.19969.2513\> -------- gen\_server \<0.19969.2513\> terminated with reason: no function clause matching couch\_db\_updater:maybe\_tag\_doc({​​​​​​doc,\<\<“6197b8f4-2650-45e6-ab3e-b7e755e59560”\>\>,{​​​​​​0,[]}​​​​​​,[\<\<128,0,0,25\>\>,\<\<233,240,209,55,27,174,…\>\>,…],…}​​​​​​)(line:267) at couch\_db\_updater:‘-sort\_and\_tag\_grouped\_docs/2-lc$^0/1-0-’/2(line:264) \<= lists:map/2(line:1239) \<= couch\_db\_updater:handle\_info/2(line:165) \<= gen\_server:try\_dispatch/4(line:601) \<= gen\_server:handle\_msg/5(line:667) \<= couch\_db\_updater:init/1(line:45) \<= proc\_lib:init\_p\_do\_apply/3(line:247)

last msg: {​​​​​​update\_docs,\<0.24805.2509\>,[[{​​​​​​doc,\<\<“6197b8f4-2650-45e6-ab3e-b7e755e59560”\>\>,{​​​​​​0,[]}​​​​​​,[\<\<128,0,0,25\>\>,\<\<233,240,209,55,27,174,216,56,116,74,41,142,69,49,20,211\>\>,\<\<131,104,2,109,0,0,0,7,1,4,12,131,104,1,106,109,0,0,0,5,1,2,4,131,106\>\>],[],false,[{​​​​​​comp\_body,\<\<1,4,12,131,104,1,106\>\>}​​​​​​,{​​​​​​size\_info,[]}​​​​​​,{​​​​​​atts\_stream,nil}​​​​​​,{​​​​​​ejson\_size,4}​​​​​​,{​​​​​​ref,#Ref\<0.0.1248067591.73865\>}​​​​​​]}​​​​​​]],[],true,true}​​​​​​

state: {​​​​​​db,1,\<\<“shards/00000000-1fffffff/medic.1632510268”\>\>,“./data/shards/00000000-1fffffff/medic.1632510268.couch”,{​​​​​​couch\_bt\_engine,{​​​​​​st,“./data/shards/00000000-1fffffff/medic.1632510268.couch”,\<0.8843.2497\>,#Ref\<0.0.2030829571.125105\>,[before\_header,after\_header,on\_file\_open],{​​​​​​db\_header,7,669219,0,{​​​​​​2081313823,{​​​​​​651687,29,{​​​​​​size\_info,1440362789,2117074764}​​​​​​}​​​​​​,85345309}​​​​​​,{​​​​​​2081315376,651716,76980604}​​​​​​,{​​​​​​2081283354,[],583836}​​​​​​,nil,nil,1398582393,1000,\<\<“b840cb641fe249b112168718c85ac066”\>\>,[{​​​​​​’couchdb@127.0.0.1’,0}​​​​​​],567723,1000}​​​​​​,false,{​​​​​​btree,\<0.8843.2497\>,{​​​​​​2081313823,{​​​​​​651687,29,{​​​​​​size\_info,1440362789,2117074764}​​​​​​}​​​​​​,85345309}​​​​​​,#Fun\<couch\_bt\_engine.id\_tree\_split.1\>,#Fun\<couch\_bt\_engine.id\_tree\_join.2\>,undefined,#Fun\<couch\_bt\_engine.id\_tree\_reduce.2\>,snappy}​​​​​​,{​​​​​​btree,\<0.8843.2497\>,{​​​​​​2081315376,651716,76980604}​​​​​​,#Fun\<couch\_bt\_engine.seq\_tree\_split.1\>,#Fun\<couch\_bt\_engine.seq\_tree\_join.2\>,undefined,#Fun\<couch\_bt\_engine.seq\_tree\_reduce.2\>,snappy}​​​​​​,{​​​​​​btree,\<0.8843.2497\>,{​​​​​​2081283354,[],583836}​​​​​​,#Fun\<couch\_bt\_engine.local\_tree\_split.1\>,#Fun\<couch\_bt\_engine.local\_tree\_join.2\>,undefined,nil,snappy}​​​​​​,snappy,{​​​​​​btree,\<0.8843.2497\>,nil,#Fun\<couch\_bt\_engine.purge\_tree\_split.1\>,#Fun\<couch\_bt\_engine.purge\_tree\_join.2\>,undefined,#Fun\<couch\_bt\_engine.purge\_tree\_reduce.2\>,snappy}​​​​​​,{​​​​​​btree,\<0.8843.2497\>,nil,#Fun\<couch\_bt\_engine.purge\_seq\_tree\_split.1\>,#Fun\<couch\_bt\_engine.purge\_seq\_tree\_join.2\>,undefined,#Fun\<couch\_bt\_engine.purge\_tree\_reduce.2\>,snappy}​​​​​​}​​​​​​}​​​​​​,\<0.19969.2513\>,nil,669219,\<\<“1656929603990655”\>\>,{​​​​​​user\_ctx,null,[],undefined}​​​​​​,[{​​​​​​\<\<“admins”\>\>,{​​​​​​[{​​​​​​\<\<“names”\>\>,[]}​​​​​​,{​​​​​​\<\<“roles”\>\>,[\<\<“national\_admin”\>\>]}​​​​​​]}​​​​​​}​​​​​​],[#Fun\<couch\_doc.7.79513450\>,#Fun\<couch\_doc.7.79513450\>],nil,nil,nil,[{​​​​​​default\_security\_object,[]}​​​​​​,{​​​​​​timeout,100}​​​​​​,{​​​​​​create\_if\_missing,true}​​​​​​,{​​​​​​user\_ctx,{​​​​​​user\_ctx,\<\<“medic-replication”\>\>,[\<\<“\_admin”\>\>],\<\<“cookie”\>\>}​​​​​​}​​​​​​],undefined}​​​​​​

extra: []

[error] 2022-07-04T10:13:23.994643Z [couchdb@127.0.0.1](mailto:couchdb@127.0.0.1) \<0.19969.2513\> -------- CRASH REPORT Process (\<0.19969.2513\>) with 0 neighbors exited with reason: no function clause matching couch\_db\_updater:maybe\_tag\_doc({​​​​​​doc,\<\<“6197b8f4-2650-45e6-ab3e-b7e755e59560”\>\>,{​​​​​​0,[]}​​​​​​,[\<\<128,0,0,25\>\>,\<\<233,240,209,55,27,174,…\>\>,…],…}​​​​​​)(line:267) at couch\_db\_updater:‘-sort\_and\_tag\_grouped\_docs/2-lc$^0/1-0-’/2(line:264) \<= lists:map/2(line:1239) \<= couch\_db\_updater:handle\_info/2(line:165) \<= gen\_server:try\_dispatch/4(line:601) \<= gen\_server:handle\_msg/5(line:667) \<= couch\_db\_updater:init/1(line:45) \<= proc\_lib:init\_p\_do\_apply/3(line:247) at gen\_server:terminate/7(line:812) \<= couch\_db\_updater:init/1(line:45) \<= proc\_lib:init\_p\_do\_apply/3(line:247); initial\_call: {​​​​​​couch\_db\_updater,init,[‘Argument\_\_1’]}​​​​​​, ancestors: [\<0.26577.2514\>], messages: [], links: [\<0.218.0\>], dictionary: [{​​​​​​idle\_limit,61000}​​​​​​,{​​​​​​io\_priority,{​​​​​​db\_update,\<\<“shards/00000000-1fffffff/me…”\>\>}​​​​​​}​​​​​​], trap\_exit: false, status: running, heap\_size: 6772, stack\_size: 27, reductions: 1336

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [July 5, 2022, 12:17pm UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/2 "2022-07-05T12:17:10Z")

</div>

Hi @melema

Thank you for reporting. It looks like CouchDb is the root cause of your replication error.  
Could you please provide some details about:

1. How many docs does your whole server have
2. Server load at the time of the failure
3. If this is happening consistently with _some_ users and working fine for others.
4. How you are running CHT-Core: for example are you using docker?
5. Which version of CHT-Core and CouchDb you are using.

Thank you!

---

<div class="post-metadata">

**Author:** ![melema](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@melema](https://forum.communityhealthtoolkit.org/u/melema)\
**Post date:** [July 5, 2022, 2:36pm UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/3 "2022-07-05T14:36:57Z")

</div>

> [@diana](#):
>
> Thank you for reporting. It looks like CouchDb is the root cause of your replication error.  
> Could you please provide some details about:
> 
> 1. How many docs does your whole server have
> 2. Server load at the time of the failure
> 3. If this is happening consistently with _some_ users and working fine for others.
> 4. How you are running CHT-Core: for example are you using docker?
> 5. Which version of CHT-Core and CouchDb you are using.
> 
> Thank you!

1. 5252733 docs on medic database
2. cpu usage was less than 50% and memory usage was low
3. This is happening consistently with some users and working fine for most users.
4. We are using docker
5. CHT-Core 3.13

---

<div class="post-metadata">

**Author:** ![melema](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@melema](https://forum.communityhealthtoolkit.org/u/melema)\
**Post date:** [July 6, 2022, 2:41am UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/4 "2022-07-06T02:41:59Z")

</div>

@diana any update on this?

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [July 6, 2022, 6:16am UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/5 "2022-07-06T06:16:57Z")

</div>

Can you please also share storage drive usage?  
I’m going to ask our Site Reliability Engineers about this.

---

<div class="post-metadata">

**Author:** ![melema](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@melema](https://forum.communityhealthtoolkit.org/u/melema)\
**Post date:** [July 6, 2022, 7:01am UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/6 "2022-07-06T07:01:29Z")

</div>

Disk usage is at 40%. There is more than enough space.

---

<div class="post-metadata">

**Author:** ![hareet](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/hareet/32/3676_2.png) [@hareet](https://forum.communityhealthtoolkit.org/u/hareet)\
**Post date:** [July 7, 2022, 1:52am UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/7 "2022-07-07T01:52:31Z")

</div>

Hm, we haven’t seen this issue before. After some quick searching, lets verify your disk iops. Can you find out that information and monitor that metric during load?

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [July 7, 2022, 4:28am UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/8 "2022-07-07T04:28:07Z")

</div>

The logs also mention specific docs, `ba1e817b-4d1f-4708-a41e-8753c86f757b` and `6197b8f4-2650-45e6-ab3e-b7e755e59560`. Can you try accessing those docs with curl or with fauxton and see if you get any errors?

---

<div class="post-metadata">

**Author:** ![melema](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@melema](https://forum.communityhealthtoolkit.org/u/melema)\
**Post date:** [July 7, 2022, 11:55am UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/9 "2022-07-07T11:55:41Z")

</div>

These two docs are not available when we searched

---

<div class="post-metadata">

**Author:** ![melema](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@melema](https://forum.communityhealthtoolkit.org/u/melema)\
**Post date:** [July 7, 2022, 12:01pm UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/10 "2022-07-07T12:01:06Z")

</div>

> [@hareet](#):
>
> Hm, we haven’t seen this issue before. After some quick searching, lets verify your disk iops. Can you find out that information and monitor that metric during load?

Disk IOPS is from AWS shows 3000

---

<div class="post-metadata">

**Author:** ![melema](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@melema](https://forum.communityhealthtoolkit.org/u/melema)\
**Post date:** [July 8, 2022, 6:42am UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/11 "2022-07-08T06:42:07Z")

</div>

@diana any update on this issue?

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [July 8, 2022, 3:14pm UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/12 "2022-07-08T15:14:29Z")

</div>

> [@melema](#):
>
> These two docs are not available when we searched

Can you please elaborate? What did you try and what happened exactly?

---

<div class="post-metadata">

**Author:** ![melema](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@melema](https://forum.communityhealthtoolkit.org/u/melema)\
**Post date:** [July 8, 2022, 7:06pm UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/13 "2022-07-08T19:06:09Z")

</div>

@diana I tried searching with fauxton as shown below:-

 ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/6/65fa2ee7a53afdaa598d624ac44f2c0948d61ba9.jpeg)

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [July 8, 2022, 7:40pm UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/14 "2022-07-08T19:40:26Z")

</div>

Can you try with curl please? Pls share the result of the curl request.

---

<div class="post-metadata">

**Author:** ![melema](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@melema](https://forum.communityhealthtoolkit.org/u/melema)\
**Post date:** [July 10, 2022, 11:38pm UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/15 "2022-07-10T23:38:41Z")

</div>

Can you share the curl command?

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [July 11, 2022, 4:38am UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/16 "2022-07-11T04:38:12Z")

</div>

```auto
curl <your instance url with authorization>/medic/<document id>

```

---

<div class="post-metadata">

**Author:** ![melema](https://communityhealthtoolkit.b-cdn.net/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@melema](https://forum.communityhealthtoolkit.org/u/melema)\
**Post date:** [July 12, 2022, 3:27pm UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/17 "2022-07-12T15:27:41Z")

</div>

@diana  
I am getting this:-

{  
“error”: “not\_found”,  
“reason”: “missing”  
}

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [July 12, 2022, 9:04pm UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/18 "2022-07-12T21:04:42Z")

</div>

@melema  
are you getting the same for both documents?

---

<div class="post-metadata">

**Author:** ![ocornel](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/ocornel/32/1017_2.png) [@ocornel](https://forum.communityhealthtoolkit.org/u/ocornel)\
**Post date:** [July 13, 2022, 8:09am UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/19 "2022-07-13T08:09:46Z")

</div>

Yes @diana , we get the same for both documents uuids…  
{  
“error”: “not\_found”,  
“reason”: “missing”  
}

For existing document uuids (that we pick from the instance as a sample), we get the document as a response.

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [July 13, 2022, 8:50am UTC](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976/20 "2022-07-13T08:50:19Z")

</div>

Looking at the couchdb logs, it seems that a put is crashing the shard?

```auto
[notice] 2022-07-04T10:13:23.994029Z couchdb@127.0.0.1 <0.22169.2508> b56fc793d3 echis-production-go-ke.lg-apps.com 44.199.169.171 medic-replication PUT /medic/6197b8f4-2650-45e6-ab3e-b7e755e59560?new_edits=false 500 ok 5

```

So `medic-replication` tries to write `6197b8f4-2650-45e6-ab3e-b7e755e59560` to the database.  
And then, immediately the shard crashes.  
What is `medic-replication`? Is it the user you were trying to log in with? Or is it some other user that pushes data into your DB?

[Next page](https://forum.communityhealthtoolkit.org/t/getting-error-500-when-loading-docs/1976.md?page=2)
