Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image Upload Filetype Errors #2415

Closed
blechdom opened this issue Aug 9, 2016 · 6 comments
Closed

Image Upload Filetype Errors #2415

blechdom opened this issue Aug 9, 2016 · 6 comments
Labels
✋ bug Confirmed bug
Milestone

Comments

@blechdom
Copy link

blechdom commented Aug 9, 2016

Expected Behavior (or desired behavior if a feature request)

Image uploader catches filetype errors correctly when uploading an Asset Image.
I expected the same errors to be caught on Avatar image upload and model image upload.
I have been testing with a *.bmp file


Actual Behavior

"Whoops...."
File Type errors not caught on Avatar image upload or Model image upload.


Please confirm you have done the following before posting your bug report:


Please provide answers to these questions before posting your bug report:

  • Version of Snipe-IT you're running
  • What OS and web server you're running Snipe-IT on
    Centos 7
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc)
    Manual
  • If you're getting an error in your browser, include that error

Whoops, looks like something went wrong.
NotReadableException in Decoder.php line 40:
Unable to read image type. GD driver is only able to decode JPG, PNG or GIF files.

  • What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error

BREAKS: /hardware/models/create AND /account/profile
WORKS: /hardware/create

  • If a stacktrace is provided in the error, include that too.

in Decoder.php line 40
at Decoder->initFromPath('/tmp/phpntcKmq') in AbstractDecoder.php line 293
at AbstractDecoder->init('/tmp/phpntcKmq') in AbstractDriver.php line 64
at AbstractDriver->init('/tmp/phpntcKmq') in ImageManager.php line 50
at ImageManager->make('/tmp/phpntcKmq') in compiled.php line 6325
at Facade::__callStatic('make', array('/tmp/phpntcKmq')) in ProfileController.php line 60
at ProfileController->postIndex()
at call_user_func_array(array(object(ProfileController), 'postIndex'), array()) in compiled.php line 9419
at Controller->callAction('postIndex', array()) in compiled.php line 9481
at ControllerDispatcher->call(object(ProfileController), object(Route), 'postIndex') in compiled.php line 9461
at ControllerDispatcher->Illuminate\Routing{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in compiled.php line 9938
at Pipeline->then(object(Closure)) in compiled.php line 9462
at ControllerDispatcher->callWithinStack(object(ProfileController), object(Route), object(Request), 'postIndex') in compiled.php line 9449
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\ProfileController', 'postIndex') in compiled.php line 8517
at Route->runController(object(Request)) in compiled.php line 8504
at Route->run(object(Request)) in compiled.php line 8218
at Router->Illuminate\Routing{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing{closure}(object(Request)) in Authenticate.php line 45
at Authenticate->handle(object(Request), object(Closure))
at call_user_func_array(array(object(Authenticate), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9953
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request)) in CheckLocale.php line 40
at CheckLocale->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckLocale), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9953
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request)) in compiled.php line 3225
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9953
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request)) in compiled.php line 13139
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9953
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request)) in compiled.php line 13076
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9953
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in compiled.php line 9938
at Pipeline->then(object(Closure)) in compiled.php line 8219
at Router->runRouteWithinStack(object(Route), object(Request)) in compiled.php line 8210
at Router->dispatchToRoute(object(Request)) in compiled.php line 8200
at Router->dispatch(object(Request)) in compiled.php line 2419
at Kernel->Illuminate\Foundation\Http{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing{closure}(object(Request)) in Debugbar.php line 49
at Debugbar->handle(object(Request), object(Closure))
at call_user_func_array(array(object(Debugbar), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9953
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request)) in TrustProxies.php line 46
at TrustProxies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(TrustProxies), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9953
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request)) in CheckForSetup.php line 22
at CheckForSetup->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForSetup), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9953
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request)) in NosniffGuard.php line 17
at NosniffGuard->handle(object(Request), object(Closure))
at call_user_func_array(array(object(NosniffGuard), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9953
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request)) in XssProtectHeader.php line 17
at XssProtectHeader->handle(object(Request), object(Closure))
at call_user_func_array(array(object(XssProtectHeader), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9953
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request)) in FrameGuard.php line 17
at FrameGuard->handle(object(Request), object(Closure))
at call_user_func_array(array(object(FrameGuard), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9953
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request)) in compiled.php line 13400
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9953
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request)) in compiled.php line 11943
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9953
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request)) in compiled.php line 3286
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9953
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in compiled.php line 9938
at Pipeline->then(object(Closure)) in compiled.php line 2366
at Kernel->sendRequestThroughRouter(object(Request)) in compiled.php line 2350
at Kernel->handle(object(Request)) in index.php line 54

YES

  • Include any additional information you can find in app/storage/logs and your webserver's logs.
  • Include what you've done so far in the installation, and if you got any error messages along the way.
  • Indicate whether or not you've manually edited any data directly in the database
    yes, but I don't think this is a problem.
@blechdom
Copy link
Author

blechdom commented Aug 9, 2016

Snipe-IT v3

@snipe snipe added the ✋ bug Confirmed bug label Aug 20, 2016
@noizo
Copy link

noizo commented Jan 11, 2017

SnipeIT v3.6.3 build 15 (g1bf34d7)
Install manual

Whoops, looks like something went wrong.

1/1
NotReadableException in Decoder.php line 20:
Unable to read image from file (/tmp/phpu3EkDZ).
in Decoder.php line 20
at Decoder->initFromPath('/tmp/phpu3EkDZ') in AbstractDecoder.php line 293
at AbstractDecoder->init('/tmp/phpu3EkDZ') in AbstractDriver.php line 64
at AbstractDriver->init('/tmp/phpu3EkDZ') in ImageManager.php line 50
at ImageManager->make('/tmp/phpu3EkDZ') in compiled.php line 6325
at Facade::__callStatic('make', array('/tmp/phpu3EkDZ')) in SettingsController.php line 311
at SettingsController->postEdit()
at call_user_func_array(array(object(SettingsController), 'postEdit'), array()) in compiled.php line 9424
at Controller->callAction('postEdit', array()) in compiled.php line 9486
at ControllerDispatcher->call(object(SettingsController), object(Route), 'postEdit') in compiled.php line 9466
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in compiled.php line 9948
at Pipeline->then(object(Closure)) in compiled.php line 9467
at ControllerDispatcher->callWithinStack(object(SettingsController), object(Route), object(Request), 'postEdit') in compiled.php line 9454
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\SettingsController', 'postEdit') in compiled.php line 8524
at Route->runController(object(Request)) in compiled.php line 8511
at Route->run(object(Request)) in compiled.php line 8225
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckPermissions.php line 28
at CheckPermissions->handle(object(Request), object(Closure), 'superuser')
at call_user_func_array(array(object(CheckPermissions), 'handle'), array(object(Request), object(Closure), 'superuser')) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Authenticate.php line 45
at Authenticate->handle(object(Request), object(Closure))
at call_user_func_array(array(object(Authenticate), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForTwoFactor.php line 49
at CheckForTwoFactor->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForTwoFactor), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckLocale.php line 42
at CheckLocale->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckLocale), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 3225
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 13213
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 13150
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in compiled.php line 9948
at Pipeline->then(object(Closure)) in compiled.php line 8226
at Router->runRouteWithinStack(object(Route), object(Request)) in compiled.php line 8217
at Router->dispatchToRoute(object(Request)) in compiled.php line 8207
at Router->dispatch(object(Request)) in compiled.php line 2419
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Debugbar.php line 49
at Debugbar->handle(object(Request), object(Closure))
at call_user_func_array(array(object(Debugbar), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForDebug.php line 25
at CheckForDebug->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForDebug), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in TrustProxies.php line 46
at TrustProxies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(TrustProxies), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForSetup.php line 27
at CheckForSetup->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForSetup), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in NosniffGuard.php line 17
at NosniffGuard->handle(object(Request), object(Closure))
at call_user_func_array(array(object(NosniffGuard), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in XssProtectHeader.php line 17
at XssProtectHeader->handle(object(Request), object(Closure))
at call_user_func_array(array(object(XssProtectHeader), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in FrameGuard.php line 17
at FrameGuard->handle(object(Request), object(Closure))
at call_user_func_array(array(object(FrameGuard), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 13474
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 11964
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 145
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9963
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in compiled.php line 9948
at Pipeline->then(object(Closure)) in compiled.php line 2366
at Kernel->sendRequestThroughRouter(object(Request)) in compiled.php line 2350
at Kernel->handle(object(Request)) in index.php line 59

Trying to add SVG logo in settings.

my /tmp dir is chmod 777

@snipe
Copy link
Owner

snipe commented Jan 11, 2017

@noizo are you able to upload an image of a different file type?

@noizo
Copy link

noizo commented Jan 11, 2017

Yep, uploaded jpg successfully.

@Gelob
Copy link
Contributor

Gelob commented Dec 6, 2017

This issue occurs when trying to upload images for Asset Manufacturers as well (as of 4.1.6). I think the file type selector should only show the accepted image types, a note should be placed below the upload box and snipe-it should catch this common exception and display a user visible error.

@noizo
Copy link

noizo commented Dec 6, 2017

@snipe sorry, i'm out of the project for now, so dont have abilities to test or check

@snipe snipe added this to the v4.1.8 milestone Dec 6, 2017
@snipe snipe closed this as completed Dec 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✋ bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

4 participants