From frederic-emmanuel.picca at synchrotron-soleil.fr Wed Nov 21 17:59:50 2018 From: frederic-emmanuel.picca at synchrotron-soleil.fr (PICCA Frederic-Emmanuel) Date: Wed, 21 Nov 2018 17:59:50 +0000 Subject: [Haskell-beginners] how to debug Prelude.read: no parse Message-ID: Hello, I am using the soap package and wrote a StreamParser which use the Consuite Xml system I have this kind of error when I execute my code [picca at process2 autoprocess-exe]$ stack exec autoprocessing-exe -- exec --json \{\"tag\":\"XdsMe\",\"contents\":[39878,[0,0,0,0,22,0],null,\"UnCompressed\"]\} +RTS -xc -Pa response: /omega=280.000125 /phi=0.000020 /uglidex=-1.403875 /phiz=-0.127760 /chi=0.000005 /uglidey=-0.508216 /zoom=646.972000180.00.10.0rectangular100.0100.03987810.0296.8692018-11-21T16:54:18+01:000.025C2-BZ1692_11.27E101.27E10/data4/proxima1-soleil/2018_Run5/2018-11-21/20180897/RAW_DATA/C2/C2-BZ1692C2-BZ1692h50.0180010.00.011.99996PhiData collection successful9999.09999.012018-11-21T16:52:42+01:00Hybrid20.16.46490.9785662044.12291.1241587 *** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace: Data.Conduit.Internal.Conduit.fmap.\, called from Data.Conduit.Internal.Conduit.fmap, called from Network.SOAP.Parsing.Stream.readContent, called from Network.SOAP.Parsing.Stream.readTag, called from ISPyB.Soap.toResponseParser, called from Data.Conduit.Internal.Conduit.pure, called from Data.Conduit.Internal.Conduit.>>=.\.\, called from Data.Conduit.Internal.Conduit.>>=.\, called from Data.Conduit.Internal.Conduit.>>=, called from Text.XML.Stream.Parse.force, called from Network.SOAP.unwrapEnvelopeSink, called from Network.SOAP.runResponseParser, called from Network.SOAP.invokeWS, called from ISPyB.Soap.callISPyBService, called from XdsMe.xdsme, called from JobParser.runJob, called from Main.run, called from Main.main autoprocessing-exe: Prelude.read: no parse CallStack (from -prof): Data.Conduit.Internal.Conduit.fmap.\ (src/Data/Conduit/Internal/Conduit.hs:140:47-58) Data.Conduit.Internal.Conduit.fmap (src/Data/Conduit/Internal/Conduit.hs:140:5-58) Network.SOAP.Parsing.Stream.readContent (src/Network/SOAP/Parsing/Stream.hs:57:1-46) Network.SOAP.Parsing.Stream.readTag (src/Network/SOAP/Parsing/Stream.hs:61:1-33) ISPyB.Soap.toResponseParser (src/ISPyB/Soap.hs:(65,5)-(129,74)) Data.Conduit.Internal.Conduit.pure (src/Data/Conduit/Internal/Conduit.hs:143:5-27) Data.Conduit.Internal.Conduit.>>=.\.\ (src/Data/Conduit/Internal/Conduit.hs:150:51-68) Data.Conduit.Internal.Conduit.>>=.\ (src/Data/Conduit/Internal/Conduit.hs:150:41-68) Data.Conduit.Internal.Conduit.>>= (src/Data/Conduit/Internal/Conduit.hs:150:5-68) Text.XML.Stream.Parse.force (Text/XML/Stream/Parse.hs:873:1-68) Network.SOAP.unwrapEnvelopeSink (src/Network/SOAP.hs:(79,1)-(81,30)) Network.SOAP.runResponseParser (src/Network/SOAP.hs:(61,1)-(76,31)) Network.SOAP.invokeWS (src/Network/SOAP.hs:(55,1)-(58,27)) ISPyB.Soap.callISPyBService (src/ISPyB/Soap.hs:(310,1)-(325,93)) XdsMe.xdsme (src/XdsMe.hs:(176,1)-(179,77)) JobParser.runJob (src/JobParser.hs:(80,1)-(84,57)) Main.run (app/Main.hs:(112,1)-(114,31)) Main.main (app/Main.hs:(118,1)-(123,72)) I generate the stacktrace with RTS. but now I know theat my error is in the roRespondParser whcih is quite long here the code instance a ~ b => ToResponseParser (ToolsForCollectionWebService a) b where toResponseParser (FindDataCollection _) = StreamParser . flaxTag "findDataCollectionResponse" . flaxTag "dataCollection" $ mkSomeDataCollection <$> ( DataCollection <$> flaxContent "actualCenteringPosition" <*> readTag "axisEnd" <*> readTag "axisRange" <*> readTag "axisStart" <*> flaxContent "beamShape" <*> readTag "beamSizeAtSampleX" <*> readTag "beamSizeAtSampleY" <*> laxTag "centeringMethod" readContent <*> (DataCollectionId <$> readTag "dataCollectionId") <*> readTag "dataCollectionNumber" <*> readTag "detector2theta" <*> readTag "detectorDistance" <*> flaxContent "endTime" <*> readTag "exposureTime" <*> flaxContent "fileTemplate" <*> readTag "flux" <*> readTag "flux_end" <*> flaxTag "imageDirectory" parseAbsDir' <*> flaxContent "imagePrefix" <*> laxContent "imageSuffix" <*> readTag "kappaStart" <*> readTag "numberOfImages" <*> readTag "numberOfPasses" <*> laxTag "omegaStart" readContent <*> readTag "overlap" <*> readTag "phiStart" <*> readTag "printableForReport" <*> readTag "resolution" <*> laxTag "resolutionAtCorner" readContent <*> readTag "rotationAxis" <*> flaxContent "runStatus" <*> readTag "slitGapHorizontal" <*> readTag "slitGapVertical" <*> readTag "startImageNumber" <*> readTag "startTime" <*> readTag "synchrotronMode" <*> readTag "transmission" <*> readTag "undulatorGap1" <*> laxTag "undulatorGap2" readContent <*> readTag "wavelength" -- add the unit <*> readTag "xbeam" <*> laxTag "xtalSnapshotFullPath1" parseAbsFile' <*> laxTag "xtalSnapshotFullPath2" parseAbsFile' <*> laxTag "xtalSnapshotFullPath3" parseAbsFile' <*> laxTag "xtalSnapshotFullPath4" parseAbsFile' <*> readTag "ybeam" <*> readTag "dataCollectionGroupId" ) Now I would like to know whcih line is problematic. Is it possible to have more information when debuging ? I really want to know which part of my response is wrong ? thansk for your advices. Frederic From toad3k at gmail.com Wed Nov 21 22:04:30 2018 From: toad3k at gmail.com (David McBride) Date: Wed, 21 Nov 2018 17:04:30 -0500 Subject: [Haskell-beginners] how to debug Prelude.read: no parse In-Reply-To: References: Message-ID: Assuming the read call is in your code, you can use readNote and its variants from the 'safe' package. If it isn't in your code, you may have to modify the library you are using to make use of it in order to find the exact text that is being read unsuccessfully. On Wed, Nov 21, 2018 at 4:40 PM PICCA Frederic-Emmanuel < frederic-emmanuel.picca at synchrotron-soleil.fr> wrote: > Hello, I am using the soap package and wrote a StreamParser which use the > Consuite Xml system > > I have this kind of error when I execute my code > > [picca at process2 autoprocess-exe]$ stack exec autoprocessing-exe -- exec > --json > \{\"tag\":\"XdsMe\",\"contents\":[39878,[0,0,0,0,22,0],null,\"UnCompressed\"]\} > +RTS -xc -Pa > response: xmlns:ns2="http://ispyb.ejb3.webservices.collection"> > /omega=280.000125 /phi=0.000020 /uglidex=-1.403875 /phiz=-0.127760 > /chi=0.000005 /uglidey=-0.508216 > /zoom=646.972000180.00.10.0rectangular100.0100.03987810.0296.8692018-11-21T16:54:18+01:000.025C2-BZ1692_11.27E101.27E10/data4/proxima1-soleil/2018_Run5/2018-11-21/20180897/RAW_DATA/C2/C2-BZ1692C2-BZ1692h50.0180010.00.011.99996PhiData > collection > successful9999.09999.012018-11-21T16:52:42+01:00Hybrid20.16.46490.9785662044.12291.1241587 > *** Exception (reporting due to +RTS -xc): (THUNK_1_0), stack trace: > Data.Conduit.Internal.Conduit.fmap.\, > called from Data.Conduit.Internal.Conduit.fmap, > called from Network.SOAP.Parsing.Stream.readContent, > called from Network.SOAP.Parsing.Stream.readTag, > called from ISPyB.Soap.toResponseParser, > called from Data.Conduit.Internal.Conduit.pure, > called from Data.Conduit.Internal.Conduit.>>=.\.\, > called from Data.Conduit.Internal.Conduit.>>=.\, > called from Data.Conduit.Internal.Conduit.>>=, > called from Text.XML.Stream.Parse.force, > called from Network.SOAP.unwrapEnvelopeSink, > called from Network.SOAP.runResponseParser, > called from Network.SOAP.invokeWS, > called from ISPyB.Soap.callISPyBService, > called from XdsMe.xdsme, > called from JobParser.runJob, > called from Main.run, > called from Main.main > autoprocessing-exe: Prelude.read: no parse > CallStack (from -prof): > Data.Conduit.Internal.Conduit.fmap.\ > (src/Data/Conduit/Internal/Conduit.hs:140:47-58) > Data.Conduit.Internal.Conduit.fmap > (src/Data/Conduit/Internal/Conduit.hs:140:5-58) > Network.SOAP.Parsing.Stream.readContent > (src/Network/SOAP/Parsing/Stream.hs:57:1-46) > Network.SOAP.Parsing.Stream.readTag > (src/Network/SOAP/Parsing/Stream.hs:61:1-33) > ISPyB.Soap.toResponseParser (src/ISPyB/Soap.hs:(65,5)-(129,74)) > Data.Conduit.Internal.Conduit.pure > (src/Data/Conduit/Internal/Conduit.hs:143:5-27) > Data.Conduit.Internal.Conduit.>>=.\.\ > (src/Data/Conduit/Internal/Conduit.hs:150:51-68) > Data.Conduit.Internal.Conduit.>>=.\ > (src/Data/Conduit/Internal/Conduit.hs:150:41-68) > Data.Conduit.Internal.Conduit.>>= > (src/Data/Conduit/Internal/Conduit.hs:150:5-68) > Text.XML.Stream.Parse.force (Text/XML/Stream/Parse.hs:873:1-68) > Network.SOAP.unwrapEnvelopeSink (src/Network/SOAP.hs:(79,1)-(81,30)) > Network.SOAP.runResponseParser (src/Network/SOAP.hs:(61,1)-(76,31)) > Network.SOAP.invokeWS (src/Network/SOAP.hs:(55,1)-(58,27)) > ISPyB.Soap.callISPyBService (src/ISPyB/Soap.hs:(310,1)-(325,93)) > XdsMe.xdsme (src/XdsMe.hs:(176,1)-(179,77)) > JobParser.runJob (src/JobParser.hs:(80,1)-(84,57)) > Main.run (app/Main.hs:(112,1)-(114,31)) > Main.main (app/Main.hs:(118,1)-(123,72)) > > > I generate the stacktrace with RTS. > > but now I know theat my error is in the roRespondParser whcih is quite long > > here the code > > > instance a ~ b => ToResponseParser (ToolsForCollectionWebService a) b where > toResponseParser (FindDataCollection _) = > StreamParser . flaxTag "findDataCollectionResponse" . flaxTag > "dataCollection" $ > mkSomeDataCollection <$> > ( DataCollection > <$> flaxContent "actualCenteringPosition" > <*> readTag "axisEnd" > <*> readTag "axisRange" > <*> readTag "axisStart" > <*> flaxContent "beamShape" > <*> readTag "beamSizeAtSampleX" > <*> readTag "beamSizeAtSampleY" > <*> laxTag "centeringMethod" readContent > <*> (DataCollectionId <$> readTag > "dataCollectionId") > <*> readTag "dataCollectionNumber" > <*> readTag "detector2theta" > <*> readTag "detectorDistance" > <*> flaxContent "endTime" > <*> readTag "exposureTime" > <*> flaxContent "fileTemplate" > <*> readTag "flux" > <*> readTag "flux_end" > <*> flaxTag "imageDirectory" parseAbsDir' > <*> flaxContent "imagePrefix" > <*> laxContent "imageSuffix" > <*> readTag "kappaStart" > <*> readTag "numberOfImages" > <*> readTag "numberOfPasses" > <*> laxTag "omegaStart" readContent > <*> readTag "overlap" > <*> readTag "phiStart" > <*> readTag "printableForReport" > <*> readTag "resolution" > <*> laxTag "resolutionAtCorner" readContent > <*> readTag "rotationAxis" > <*> flaxContent "runStatus" > <*> readTag "slitGapHorizontal" > <*> readTag "slitGapVertical" > <*> readTag "startImageNumber" > <*> readTag "startTime" > <*> readTag "synchrotronMode" > <*> readTag "transmission" > <*> readTag "undulatorGap1" > <*> laxTag "undulatorGap2" readContent > <*> readTag "wavelength" -- add the unit > <*> readTag "xbeam" > <*> laxTag "xtalSnapshotFullPath1" parseAbsFile' > <*> laxTag "xtalSnapshotFullPath2" parseAbsFile' > <*> laxTag "xtalSnapshotFullPath3" parseAbsFile' > <*> laxTag "xtalSnapshotFullPath4" parseAbsFile' > <*> readTag "ybeam" > <*> readTag "dataCollectionGroupId" > ) > > > Now I would like to know whcih line is problematic. Is it possible to have > more information when debuging ? > > I really want to know which part of my response is wrong ? > > thansk for your advices. > > Frederic > _______________________________________________ > Beginners mailing list > Beginners at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners > -------------- next part -------------- An HTML attachment was scrubbed... URL: