The following steps end up in an error page:

1. Open admin/config/development/import
2. Choose a file that is not a *.tar file.
3. Hit upload.

The following error is thrown:

Exception: Invalid checksum for file "somefile.txt" : 24385 calculated, 262720 expected in Drupal\Component\Archiver\ArchiveTar->_error() (line 637 of /home/juampy/projects/drupal8/core/lib/Drupal/Component/Archiver/ArchiveTar.php).
The website has encountered an error. Please try again later.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

juampynr’s picture

Here is a patch that adds a test but fails and another one which catches the exception and sets an error in the form.

Anonymous’s picture

nice! more of my sloppy being cleaned up.

perhaps we should unlink the file either way? otherwise, this looks ready.

Anonymous’s picture

hmmm, ignore #2, we don't copy the file anywhere permanent, so no need to mess with the unlink. juampy++

juampynr’s picture

Reviewed the logic again. Unlinking the file even when there is an exception makes total sense. Thanks @beejeebus.

Status: Needs review » Needs work
Anonymous’s picture

Status: Needs work » Reviewed & tested by the community

ok, this looks ready to go.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 7b3bf57 and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.