usdoj / foia.gov

Front-end for the National FOIA Portal
https://www.foia.gov
Other
45 stars 34 forks source link

Intermittent file entity duplication on upload #481

Open ba66e77 opened 6 years ago

ba66e77 commented 6 years ago

[Description of defect] Intermittently when uploading files on a request, subsequent checks of the files entity table (/admin/content/files) will show that a file exists separately as both a Temporary and Permanent file status.

In the screenshot below, two files were uploaded on the submitted request but one of them (smokejumper.png) has been duplicated in Drupal.

files___national_foia_portal

Thus far I have not been able to isolate a pattern for when the behavior occurs but have made the following observations

  1. The problem does not seem to be related to the file's extension/mime type
  2. Problem has been seen both with files flagged as viruses and those flagged as clean

Steps to reproduce the behavior

  1. Submit a FOIA request and attach one or more files
  2. Check the file table in Drupal
  3. NOTE: issue is intermittent so you may have to repeat the process multiple times for the failure to occur.
ba66e77 commented 6 years ago

I've been able to replicate the problem on local using the develop branch. It looks like an _sid_ directory is being created in the file system which holds the duplicated files

vagrant@local:/var/www/dojfoia/files-private/webform/test_form$ find .
.
./227
./227/empty.txt
./227/eicar.txt
./227/notEicar.txt
./_sid_
./_sid_/eicar_0.txt