NCEAS / metacatui

MetacatUI: A client-side web interface for DataONE data repositories
https://nceas.github.io/metacatui
Apache License 2.0
42 stars 27 forks source link

Editor shows an error icon in the People section but no message. Never submits. #851

Closed laurenwalker closed 5 years ago

laurenwalker commented 5 years ago

We heard from a user trying to submit to the ADC who encountered an error after clicking submit.

From the user:

I’ve tried two to submit some data for NSF report on two separate occasions now using two different browsers (chrome and safari) and am getting similar results, spinning submission button.

Serialized EML from the user's local memory:

`

ReCAP ice core gas dataToddSowersPenn State UniversitySr. Scientist
2217 EES Bldg, Earth and Environment Systems InstitutePenn State UniversityUniversity ParkPA16802USA
(814) 865 - 3191(814) 865 - 1921tas11@psu.eduHttp://orcid.org/0000-0001-5496-5113
2018-12-05This proposal seeks to drill, analyze, and interpret a new ice core from the Renland Ice Cap on the eastern coast of Greenland. The project is collaborative between US researchers (T. Sowers, Penn State and J. White, Univ. Colorado, this proposal) and researchers in Denmark’s Center for Ice and Climate (led by B. Vinther) and Alfred Wegener Institute in Bremerhaven, Germany (led by S. Kipfsthul). US efforts described here will focus on gas concentrations and gas isotopes (Sowers) and ice isotopes (White).Primary objectives of this proposal are: 1) link the recent, rapid warming seen in Greenland over the past decade to the baseline record of the past few centuries, as well as the broader Holocene record; 2) provide, for the first time, high-quality records of gases and gas isotopes throughout the Holocene from a Greenland core, and test current theories about the evolution of greenhouse gases in the Holocene and the impact of humans on that evolution; 3) provide, for the first time, a record of ice isotopes at their highest possible resolution available in the ice record, which we hope will provide a high resolution record of Holocene sea ice near eastern Greenland, as well as a history of climate in this region going back into the last interglacial period.ReCAP gas dataGCMDThis work is dedicated to the public domain under the Creative Commons Universal 1.0 Public Domain Dedication. To view a copy of this dedication, visit https://creativecommons.org/publicdomain/zero/1.0/.ReCAP Ice Sheet-26.72-26.7271.371.32018-12-05nullhttps://orcid.org/0000-0001-5496-5113We utilized a wet extraction method to remove the trapped gases from --15 g samples of ice [Sowers et al., 1989]. Each ice sample was placed into the extraction vessel and attached to a high vacuum manifold. The vessel was evacuated for 1 hour at a temperature of-20øC. The vessel was then isolated and warmed to 40øC, thereby melting the ice and releasing the trapped air into the head space above the water. The water was then frozen allowing the dry air sample to be quantitatively transferred to a stainless steel sample tube which was immersed in liquid helium. At this point the sample tube with the fossil air was isolated and removed from the liquid helium. The air sample was then either expanded into the sample reservoir of the mass spectrometer or equilibrated into a glass ampoule and sealed for later analysis [Sowers et al., 1991]. The air samples were analyzed using isotope ratio mass spectrometry with a sample of dry compressed air as a reference. The standard deviation about the mean of all replicate •515N measurements was 0.006 permill.Samples are from various depths along the ReCAP main ice coreSamples are cut in a freezer, loaded into a precooled extraction vessel and then attached to the "Spider" extraction device. Laboratory air is evacuated before sealing the vessels. Ice is melted and refrozen to liberate trapped air. Frozen into tubes in liquid He and then analyzed on a mass spectrometer.ReCAP ice core gas dataToddSowersPenn State UniversitySr. ScientistprincipalInvestigatorNSF 1304077Final d18Oatrm ReCAP data 120418.xlsxElemental and isotopic composition of trapped O2 and N2 in ReCAP ice coreDown core gas dataDepthElemental and isotopic composition of trapped gases in ice coremeterrealapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
" ` Screenshot from the user: ![image](https://user-images.githubusercontent.com/6643222/49599187-56926480-f94e-11e8-891e-e798b0b21a65.png)
jagoldstein commented 5 years ago

@laurenwalker I noticed that this EML is not valid due to line 117: <authentication method="MD5">/authentication>.

There is a missing <. Maybe that helps with diagnosing the issue.

jagoldstein commented 5 years ago

actually there are many missing characters and elements. some examples:

<attributeName>dO2/N2/attributeName> (line 187)

otherEntity and dataset not closed at end (~line 217)

laurenwalker commented 5 years ago

The error icon in the people section may be coming from the contact, which was serialized as null:

<contact id="2940906010390095"><individualName><givenName>null</givenName></individualName><userId directory="https://orcid.org">https://orcid.org/0000-0001-5496-5113</userId></contact>

laurenwalker commented 5 years ago

For whatever reason, this person was never registered with a DataONE account when he logged in: https://cn.dataone.org/cn/v2/accounts/http%3A%2F%2Forcid.org%2F0000-0001-5496-5113

This is why there was no name to grab to the contact, so it was serialized as null.

csjx commented 5 years ago

@laurenwalker - Is the issue here that Todd's attribute names have /s in them, and we're not escaping them, so they jack up the XML?

mbjones commented 5 years ago

Could we develop some validation tests that try really hard to break the app using a variety of unusual characters and character sequences -- both valid and invalid -- to be sure the application can serialize those all correctly and not error out? If these included a set of unicode characters, a wide variety of reserved characters in XML (<>/'&";), well-formed and malformed entity references (e.g.,  , &, "e; &foo;, etc.), undefined entity references, and characters from character encodings that are not the current encoding (e.g., Windows-1252 or CP-1252 or ISO-8859-1 characters in a UTF-8 doc), we might be able to prevent some of these surprises from emerging slowly one at a time.

laurenwalker commented 5 years ago

The simplest way to handle the People section bug is to create the creator and contact when the Editor first loads rather than later when the user clicks Submit. We've talked before about doing it this way anyway, so I went ahead with that route. A creator or contact will be created during Submit if the user deletes either of them without adding a replacement party.

screen shot 2018-12-10 at 5 44 51 pm

I'll look into the attributes stuff next. I think developing some tests for these scenarios is a great idea.

laurenwalker commented 5 years ago

Jesse and I discussed the odd serialization errors where there are missing <'s.

From Slack:

trying to decipher his email it sounds like this XML is perhaps where Sowers “…downloaded the meta data from [his] previous submission and cut and pasted in new information for the current submission.” the cut and pasted seems like a probable explanation for the oddly absent <s if that’s true, it’s probably not a helpful GH comment for debugging efforts

I think the <'s may have been erased when he manually edited the plain XML in a text editor. I haven't been able to recreate the missing < bug and I don't see any invalid EML errors in our Google Analytics, which would have happened if the saving process got that far.

I think the People section was the only bug that prevented him from saving. I'll close this issue.