Survey123 feature report error Cannot read property 'width' of undefined

1571
8
05-06-2022 06:02 AM
RobBlash
Occasional Contributor III

I have a survey with ~15 daily users. Most submissions have no issues, but there is one user whose forms randomly cause this error when generating a feature report. My work-around is to download each photo, screen shot it, and replace the attachment with the screen shot. Once that's done I can export the PDF. Obviously, this is less than ideal.

I've inspected the EXIF data for many of these photos and cannot find what the problem is. This person is using a samsungSM-S908U device, most others are using some version of iOS or a windows surface. That's the onlynotable difference I can find.

Anyone else with this issue? 

8 Replies
MichaelBruening
Occasional Contributor

I am having a similar issue with a user that has a samsungSM-G998U device. This occurs when I am attempting to generate a custom report for a point that has a repeat (table) with photos and a few questions within the repeat.

This error occurs when attempting to create a Word Document or PDF file or a Preview of the report.

I have inspected all of the photos as well and they all have an original size of 1280 x 720 and within my custom report I am using size:460:340 for the photo size returned.

All photos were taken in the same orientation of landscape with the "Home" button under the right thumb.

 

MichaelBruening_0-1653405477376.png

 

0 Kudos
RobBlash
Occasional Contributor III

Sorry for the slow reply. I've been working with Esri support and they're looking into it further. For now I'm stuck with the screen shot work-around, which has been a time-consuming effort.

I did look at the EXIF data further (exporting the full data using EXIF tool) and found that the offending photos are typically missing these EXIF params: : ExposureMode, FlashpixVersion, OffsetTime, OffsetTimeOriginal, SceneType, SensingMethod. My guess is the time ones are causing a problem, but I hit a snap trying to fix the EXIF and gave up.

So, if I have a bunch of photos I export them all, chekc ther EXIF data, and can narrow down which need attention to create the report. Hopefully this can be fixed sooner than later!

PeterBrad3
New Contributor II

I've been experiencing this issue lately and it is extremely frustrating. I definitely do not have time for the screen shot method haha.

0 Kudos
DougBrowning
MVP Esteemed Contributor

Same here for me today.  Exif looks ok.  This is only happening on one record in the service.

DougBrowning_0-1660069540276.png

DougBrowning_1-1660069546201.png

DougBrowning_2-1660069968522.png

I did see that file is 5.4 MB - bigger than it should be.  Maybe a limit is being hit?

Anyone figure it out?

thanks

0 Kudos
DerrickWestoby
Occasional Contributor III

I have about 10-20 surveys going through Integromat/Make a day now.  This error (on established surveys and feature report templates that haven't changed in months) is one of the ~10 errors that pops up regularly that's always fixed by re-running the report generation.  If it's not resolved, I'll wait 20 minutes and run it again.  

 

I know that's not exactly a "solution", but I'm just trying to point out that it might be a server side issue that will self resolve.  I added a sleep module between the webhook and report generation hoping the issue would resolve, but that doesn't seem to have changed anything either.  

Long story short - make sure it's not a server side issue before you spend 3 days troubleshooting. 

 

Failed - 

DerrickWestoby_3-1660076168803.png

 

The 10:15 run that threw an error is the screenshot above.  

10:19 was after restarting the scenario.  No changes to report template, feature service, survey submission, etc. 

DerrickWestoby_1-1660075890412.png

successful 

DerrickWestoby_2-1660075971708.png

 

Richard_Purkis
Esri Contributor

@DougBrowning @RobBlash This may not solve your issue, I just thought i would mention I have seen this error a few times in support cases. It is definitely related to the specific photos. In one occasion it was conclusively found to be related to Samsung Galaxy S22 Ultra devices but we were unable to get the device specs from the other customers. In all cases the workaround was to do a screenshot of the photos and replace the corrupted attachment with the screenshot of the photo.

RobBlash
Occasional Contributor III

Thanks, I was able to work with support to get a bug logged on the GS22 Ultra issue:

https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDE0OTk2Mg==

 

@DerrickWestoby I agree with your first approach, when something fails I generally try again an hour later On this specific issue my org has a known user with a known device (Samsung GS22) that causes intermittend issues documented with a bug. So, I just deal with the several surveys a week that come through with the problem.

 

@DougBrowning try extracting the full EXIF data from the offending photo using EXIF tool: place the photos in a folder with exiftool.exe and run this command throuhg a batch file: 

 

exiftool -CSV *.jpg > PhotoExif.csv

 

 

That will dump the full EXIF data to a csv file. I've noticed that the offending photos are missing several EXIF attributes. I've been using "OffsetTimeOriginal" missing as the barometer for which images are causing the issue, and running the screen shot work-around on those has been successful.

 

RobBlash_0-1660138326596.png

 

ddjohnson
New Contributor

I am experiencing a similar issue.  I'm on a Samsung S21+.  In the last month or so, I have been getting error about "Cannot read property 'width' of undefined".  It is random.  Some photos cause report creation errors, some do not.  Examining the EXIF data it appears, as other replies mention, there are fields 'OffsetTime' and 'OffsetTimeOriginal' missing.  This must throw off the expected parsing position of 'width' exif parameter.  And why the error message reads as such. 

I spent a most of a day troubleshooting.  It appears the creation of the 2 'OffsetTime' parameters is random when the photo is taken within Survey123.  Sometimes it is part of the EXIF that is uploaded to the survey.  Sometimes not.  When it's not in the photo, that photo stops report from being created.  However, I discovered that when taking photos with the default camera app, the 'OffsetTime' parameters are always there.  So something is happening with the Samsung camera and Survey123 in the background.  I believe this happened in the last 1 or 2 updates to Survey123. 

The screenshot work around (as offered on another reply) is quite cumbersome and causes loss of georeference location.  Which I was using in my report with pulldata.  To that end I discovered another work around: Take Photos with the default camera app outside of survey123.  Make sure location tagging is turned ON.  Then instead of using the camera within Survey123, I upload the photo using the 'file' button from my gallery.  This way the correct exif metadata are stored in the file.  The image upload must occur before the survey is submitted to the cloud.  Then the geolocation data are recognized by the survey and the photo will be placed correctly in the photo preview map. Its not ideal but at least I'm not dead in the water  or spending hours fixing images with screenshots. 

 

Hope this helps someone.  Hope this bug is fixed in an update, soon.