Incomplete submission results download

Created on 9 June 2022, over 2 years ago
Updated 3 September 2024, 3 months ago

Problem

I am not sure if this is an issue on webform or just our setup but downloading the results is inconsistent at times. When downloading results with a limit and redownloading it again with no limit, the file downloaded does not give me the entire results.

Steps to reproduce

Find a web form with over 1700 results. Export the submissions with a limit of 200. Works fine. Export again but leave it on ALL and it doesn't export everything. It exports 500 records.

Other settings were left default (but just in case)
- Export Format: Delimited text
- Delimiter text format: Comma
- Untick generate excel compatible file
- Element Multiple values delimiter: Semicolon
- Column header format: Element titles
- Tick "Include an element's title with all sub elements..."
- Column header label: ":"
- Options single value: Compact
- Options multiple values format: Compact
- Option items format: Option labels
- Column Options set on default
- Download Options:
- First time set a limit via latest and number of submission to a small number like 200.
- untick Starred
- Submission state: Completed and draft submissions.
- click download.

Then do everything above the same but change LIMIT TO to all. Then hit download.

Also, "SAVING SETTINGS" seems to "resolve" the issue but having the values set and hit download should download what you are expecting.

🐛 Bug report
Status

Fixed

Version

6.1

Component

Code

Created by

🇺🇸United States nomisgnos

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇨🇦Canada lindsay.wils

    Hey all.

    I have updated webform module to latest D10 compatible version and am still seeing the exact issues described here.

    Setting limits based on date might work sometimes, and others not, with no real logic to it. Then sometimes export everything and other times not, even with All set.

    Is anyone else still experiencing this issue? Thanks

  • 🇮🇳India Shank115

    I'm encountering the same problem as well. When I attempt to filter submissions based on their created or submitted dates, the output isn't consistent and tends to vary each time.

  • 🇺🇸United States rondog469

    I think I am running into this issue as well. I have 350 submissions. When I download all of them, it downloads them in chunks of 10, skips 10, grabs 10, skips 10 etc so I end up with half. This particular site is on pantheon. It works fine on my local, but once on pantheon it does this behavior. Sometimes it'll grab the opposite half. That may point to a load balancing issue which I have tried remeding by specifying the tmp path but no luck so far. I ended up opening a ticket with pantheon. If I try and grab the latest 30, it only returns 10 for me. If I choose Latest and specify anything <= 10 it returns 0...very strange

  • 🇨🇦Canada mahde Vancouver

    Hey @rondog469 - I am facing the same issue as yours, have you got back from Pantheon? or have you fixed this issue?

  • 🇺🇸United States rondog469

    @mahde unfortunately, no. They weren't very helpful. If it has to do with load balancing, I tried to set the tmp dir using this guide but no luck. https://docs.pantheon.io/guides/filesystem/tmp I linked them to this thread and they told me to ask @jrockowitz because of his comment in #7. The link jrockowitz shared is for acquia, but I think the first one I linked to is trying to achieve the same thing.

  • 🇫🇷France seb_r

    Hi,

    I have the same issue.
    Reducing the batch size didn't fix anything, it just change the missing submissions (but it could be random?).
    On 750 submissions (exported with the linked files, as zip).
    * with batch of 500: I miss the submissions 101 to 200.
    * with batch of 100: I miss 1 to 200.

    A workaround is to export with drush.
    drush webform:export webform_id --archive-type=zip --files=1 --destination=/home/export/

    Have a good day,

    Seb

  • 🇺🇸United States rondog469

    Our team noticed that if we uncheck "Download uploaded files", we do get all the submissions. Our forms have file upload fields and we need them included in the download so unchecking that is not really an option.

  • 🇺🇸United States Mojiferous

    I also have this issue on site on an Acquia production server - I think the problem here is due to how the WebformExporter writes the file to tmp and how a load balanced server handles that during a batch...

    Some findings that helped narrow the issue down and provide the direction for a fix:

    • From a webform with many results (27k+), exports limited to created date of last 10 days.
    • First export, automatically downloaded by the browser: 835 results (matches # shown in the batch)
    • First export, clicked the file download link in the Drupal message: 0 byte file. The file existed and didn't 404, but was empty
    • Second export, automatically downloaded by the browser: 335 results no headers (browser briefly showed an updated message in the batch at "Exported 500 results")
    • Second export, clicked the file download link: 500 results, with a header!

    Combining the second exports into one file and diffing the result with the first auto download resulted in a file with no differences from the first download. So the 500 results in the file in the message were the first part of the file.

    So obviously the second batch completed, just into two similarly-named temp files. I assume this is a weird quirk of a load-balanced server and how the temp directory on Acquia or Pantheon is handled (on Acquia it is /tmp and not a shared symlinked file server like public or private) This might also explain why the local export works 100% of the time. This is also likely why the drush export suggested in #21 works.

    I changed the temporary directory at admin/structure/webform/config/exporters to a sub-directory of private:// and the export works every time now. The help description on the directory does say that it should be persistent directory, so that may confirm why /tmp had problems on Acquia. This is not perfect since the resulting file export will not be automatically removed, but since createExport() in FileHandleTraitWebformExporter.php calls fopen() with the 'w' mode, it will only create one export file and overwrite it every time.

  • 🇺🇸United States Mojiferous

    That was already set as well but didn't seem to help - public and private are nested deeper under the symlink at /mnt/gfs/{$_ENV['AH_SITE_GROUP']}.{$_ENV['AH_SITE_ENVIRONMENT']} on the server as well, so I don't know why it would act differently

Production build 0.71.5 2024