Skip to content

non-existant image from AWS results in fatal error #90

Open

Description

@dwenaus

when trying to attach an image that does not exist, (ie. http://prod.retreat.guru.s3-us-west-2.amazonaws.com/no-image.jpg). I get a fatal error. I'm guessing this is because AWS returns an XML error rather than a 404 error. So Stapler thinks it's a valid image and 'downloads' it. but then MimeTypeGuesser fails.

here is the error:
ERROR: exception 'Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException' with message 'The file "/tmp/291239.jpg" does not exist' in /vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeGuesser.php:115
Stack trace:
#0 /vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php(87): Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser->guess('/var/folders/49...')
#1 /vendor/codesleeve/stapler/src/Codesleeve/Stapler/File/File.php(32): Symfony\Component\HttpFoundation\File\File->getMimeType()
#2 /vendor/codesleeve/stapler/src/Codesleeve/Stapler/Attachment.php(512): Codesleeve\Stapler\File\File->isImage()
#3 /vendor/codesleeve/stapler/src/Codesleeve/Stapler/Attachment.php(478): Codesleeve\Stapler\Attachment->flushWrites()
#4 /vendor/codesleeve/stapler/src/Codesleeve/Stapler/Attachment.php(417): Codesleeve\Stapler\Attachment->save()
#5 /vendor/codesleeve/stapler/src/Codesleeve/Stapler/ORM/EloquentTrait.php(58): Codesleeve\Stapler\Attachment->afterSave(Object(RetreatGuru\Teacher))
#6 [internal function]: RetreatGuru\Teacher::Codesleeve\Stapler\ORM{closure}(Object(RetreatGuru\Teacher))
#7 /vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(199): call_user_func_array(Object(Closure), Array)
#8 /vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1564): Illuminate\Events\Dispatcher->fire('eloquent.saved:...', Object(RetreatGuru\Teacher))
#9 /vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1411): Illuminate\Database\Eloquent\Model->fireModelEvent('saved', false)
#10 /vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1398): Illuminate\Database\Eloquent\Model->finishSave(Array)
#11 /app/commands/ImportCommand.php(265): Illuminate\Database\Eloquent\Model->save()

Activity

  1. tabennett commented on Nov 12, 2014

    @tabennett
    Contributor

    Are you still having this issue? I don't quite understand what you mean when you say 'Trying to attach an image that doesn't exist.'. Are you attempting to grab an existing image from an S3 bucket and re-upload it?

  2. dwenaus commented on Nov 18, 2014

    @dwenaus
    Author

    no, I no longer have this issue. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions