intersystems-community / WebDAV

WebDAV implementation in InterSystems Caché
MIT License
2 stars 0 forks source link

<STORE> errors #11

Open fwgriffiths opened 3 years ago

fwgriffiths commented 3 years ago

Hi Eduard We have started using your WebDAV word implementation and we have had occurrences of STORE errors. e.g.

  1. "< STORE >zhrefGetSwizzled+1^WebDav.XML.response.1" at 3:40 pm. $I=|TCP|1972|43778378 ($X=0 $Y=3299) $J=43778378 $ZA=24576 $ZB=$c(0) $ZS=262144 ($S=-8904) Comment: Attempting to record more information in next entry (27 Aug 2021) and
  2. "< STORE >%Construct+1^WebDav.XML.prop.1" at 4:08 pm. $I=|TCP|1972|58392946 ($X=0 $Y=10438) $J=58392946 $ZA=24576 $ZB=$c(0) $ZS=2147483647 ($S=2198754775912) Set i%ishidden=0,i%resourcetype=##class(WebDav.XML.resourcetype).%New()

For the first one, no variables were saved at all. I've looked at the variables for the second one and the only thing of any note I could see was a variable SecurityRecord. Do DecomposeStatus^%apiOBJ(SecurityRecord,.err,"-d") For i=1:1:err Write err(i),! ERROR #5034: Invalid status code structure ($lb("",1,0,1,0,16,"","",0,"",0,"","ctstdb-01","System security parameters",90,5,65536,16 ,64,"8.32ANP",0,0,0,0,2047,"DC=ctstdb-01,DC=.co","",24,"unknown","®îÙ°Ü®D"$c(150)"{Ðøc|"$c(131,136)"l","uid=cacheown,ou=People", "cn","description","displayName","intersystems-Namespace","intersystems-Roles","intersystems-Routine",10,5,"","","",0,0,"",0,0,0,"", "","",180,"",0,0,"SHA256","Cache-ctstdb-01-CPLUS","",""))

Any idea what might cause those?

fwgriffiths commented 3 years ago

I now think the problem is originating from the PROPFIND call in WebDAV.REST in this section set multi = ##class(WebDav.XML.multistatus).%New() do multi.response.Insert(..createPROPFIND(href, isCollection, size))

    if isCollection,depth {     
        #dim rs As %ResultSet = ##class(%File).FileSetFunc(path)

        while (rs.%Next()) {
            set path = rs.Name      
            set name = rs.ItemName
            set size =rs.Size
            set createdDate = rs.DateCreated
            set modifiedDate = rs.DateModified
            set type = rs.Type
            set isCollection = $case(type, "F":$$$NO, "D":$$$YES, :$$$NO)

            do multi.response.Insert(..createPROPFIND(href _ $case($e(href,*), "/":"", :"/") _ name, isCollection, size, createdDate, modifiedDate))
        }
    }

I can see on viewing the multi object that there are loads of response elements inside it:

Variable: multi (base stack level = 31) multi = "[6@WebDav.XML.multistatus]" Show object details? ...

| r%response(40516) = "688774@WebDav.XML.response" | r%response(40517) = "688791@WebDav.XML.response" | r%response(40518) = "688808@WebDav.XML.response" | r%response(40519) = "688825@WebDav.XML.response" | r%response(40520) = "688842@WebDav.XML.response" | r%response(40521) = "688859@WebDav.XML.response" | r%response(40522) = "688876@WebDav.XML.response" +-----------------------------------------------------

fwgriffiths commented 3 years ago

Ah, I see, the href being passed into the PROPFIND is a folder path rather than an individual document and there are loads of documents in that folder. Maybe I should put a limit of the amount of results returned?

eduard93 commented 3 years ago

@fwgriffiths Easiest way to solve this is to set Maximum per Process Memory (KB) to 2147483647 and restart InterSystems IRIS instance. Docs.

You can try limiting depth (unless you have one folder with a large number of files).

fwgriffiths commented 3 years ago

Hi Eduard It is just one folder with lots of files, no sub folders. I think we'd be reluctant to change the per process memory in case it caused performance issues. I may just try limiting the number of results returned.