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

Unhandled Exception: HttpException: No valid statuscode. Statuscode was 404 #144

Closed
anjrew opened this issue Mar 11, 2019 · 32 comments
Closed

Comments

@anjrew
Copy link

anjrew commented Mar 11, 2019

E/flutter (18499): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: HttpException: No valid statuscode. Statuscode was 404
E/flutter (18499): #0 BaseCacheManager.getFile
package:flutter_cache_manager/src/cache_manager.dart:120
E/flutter (18499):
E/flutter (18499): #1 CachedNetworkImageState._animatedWidget
package:cached_network_image/src/cached_image_widget.dart:261
E/flutter (18499): #2 CachedNetworkImageState.build
package:cached_network_image/src/cached_image_widget.dart:194
E/flutter (18499): #3 StatefulElement.build
package:flutter/…/widgets/framework.dart:3825
E/flutter (18499): #4 ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:3736
E/flutter (18499): #5 Element.rebuild
package:flutter/…/widgets/framework.dart:3559
E/flutter (18499): #6 ComponentElement._firstBuild
package:flutter/…/widgets/framework.dart:3716
E/flutter (18499): #7 StatefulElement._firstBuild
package:flutter/…/widgets/framework.dart:3864
E/flutter (18499): #8 ComponentElement.mount
package:flutter/…/widgets/framework.dart:3711
E/flutter (18499): #9 Element.inflateWidget
package:flutter/…/widgets/framework.dart:2956
E/flutter (18499): #10 Element.updateChild
package:flutter/…/widgets/framework.dart:2759
E/flutter (18499): #11 SingleChildRenderObjectElement.mount
package:flutter/…/widgets/framework.dart:4876
E/flutter (18499): #12 Element.inflateWidget
package:flutter/…/widgets/framework.dart:2956
E/flutter (18499): #13 Element.updateChild
package:flutter/…/widgets/framework.dart:2759
E/flutter (18499): #14 SingleChildRenderObjectElement.mount
package:flutter/…/widgets/framework.dart:4876
E/flutter (18499): #15 Element.inflateWidget
package:flutter/…/widgets/framework.dart:2956
E/flutter (18499): #16 Element.updateChild
package:flutter/…/widgets/framework.dart:2759
E/flutter (18499): #17 SingleChildRenderObjectElement.mount
package:flutter/…/widgets/framework.dart:4876
E/flutter (18499): #18 Element.inflateWidget
package:flutter/…/widgets/framework.dart:2956
E/flutter (18499): #19 Element.updateChild
package:flutter/…/widgets/framework.dart:2759
E/flutter (18499): #20 ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:3747
E/flutter (18499): #21 Element.rebuild
package:flutter/…/widgets/framework.dart:3559
E/flutter (18499): #22 ComponentElement._firstBuild
package:flutter/…/widgets/framework.dart:3716
E/flutter (18499): #23 ComponentElement.mount
package:flutter/…/widgets/framework.dart:3711
E/flutter (18499): #24 Element.inflateWidget
package:flutter/…/widgets/framework.dart:2956
E/flutter (18499): #25 Element.updateChild
package:flutter/…/widgets/framework.dart:2759
E/flutter (18499): #26 ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:3747
E/flutter (18499): #27 Element.rebuild
package:flutter/…/widgets/framework.dart:3559
E/flutter (18499): #28 ComponentElement._firstBuild
package:flutter/…/widgets/framework.dart:3716
E/flutter (18499): #29 ComponentElement.mount
package:flutter/…/widgets/framework.dart:3711
E/flutter (18499): #30 Element.inflateWidget
package:flutter/…/widgets/framework.dart:2956
E/flutter (18499): #31 Element.updateChild
package:flutter/…/widgets/framework.dart:2759
E/flutter (18499): #32 ComponentElement.performRebuild
package:flutter/…/widgets/framework.dart:3747
E/flutter (18499): #33 Element.rebuild
package:flutter/…/widgets/framework.dart:3559
E/flutter (18499): #34 ComponentElement._firstBuild
package:flutter/…/widgets/framework.dart:3716
E/flutter (18499): #35 ComponentElement.mount
package:flutter/…/widgets/framework.dart:3711
E/flutter (18499): #36 Element.inflateWidget
package:flutter/…/widgets/framework.dart:2956
E/flutter (18499): #37 Element.updateChild
package:flutter/…/widgets/framework.dart:2759
E/flutter (18499): #38 ComponentElement.performRebuild

@markgrancapal
Copy link

I have the same error. It only throws this error when I tried to load an image from a url whose response is 404. Is there some way to Catch this exception so that it will not throw an error on the console?

@kunit1
Copy link

kunit1 commented Mar 27, 2019

In debug mode it seems to freeze the app.

@VladimirCourse
Copy link

The same problem. It's very strange to throw exceptions when image is not available without ability to catch it. Why just not add callback if any error?

@skysukai
Copy link

Emmm. I met the same error which response was 531

@shpy2001
Copy link

shpy2001 commented May 7, 2019

I have the same problem when call to a url return 404.

[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: HttpException: No valid statuscode. Statuscode was 404

@fer-ri
Copy link

fer-ri commented May 27, 2019

I've set up with this

errorWidget: (context, url, error) => Icon(Icons.error),

but still, the app crashed when the image is 404.

so what's the point of errorWidget option?

@cosinus84
Copy link

cosinus84 commented May 30, 2019

The error comes from visual code debugger (or somewhere around), if you use flutter run from console then all works as it should. It happened to me with my own code and I posted an issue.
flutter/flutter#33427

@bassel
Copy link

bassel commented May 30, 2019

@cosinus84 I tried running it using flutter run in the console and it still threw this exception. In my code, it's a large list of items with an image for each item. The weird thing is that when they get loaded for the first time no exceptions are thrown, it normally displays the error widget as it should. However, if I start scrolling the list, the exceptions start getting thrown for images with 404 response. I'm not sure what's causing that, but I'll take a look as soon as I'm done with my finals.

@rmarau
Copy link

rmarau commented May 31, 2019

#144 #190 might fix this. @basselch, can you test it?

  cached_network_image:
    git:
      url: git://github.com/rmarau/flutter_cached_network_image.git
      ref: fix-getFile_multiplecalls

@bassel
Copy link

bassel commented May 31, 2019

@rmarau I tested it on my app and your fix works. No exceptions are thrown while scrolling

@jonataslaw
Copy link

I have the same problem. Any solution for that?

@renefloor
Copy link
Collaborator

Fixed in 1.1.0

@lijy91
Copy link

lijy91 commented Jul 15, 2019

@renefloor I upgrade to 1.1.0, But got a new error.

[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: type 'HttpException' is not a subtype of type 'FileInfo'    
#0      BaseCacheManager.getFile (package:flutter_cache_manager/src/cache_manager.dart:120:11)                     
<asynchronous suspension>                                                                                          
#1      CachedNetworkImageState._animatedWidget (package:cached_network_image/src/cached_image_widget.dart:270:12) 
#2      CachedNetworkImageState.build (package:cached_network_image/src/cached_image_widget.dart:196:12)           
#3      StatefulElement.build (package:flutter/src/widgets/framework.dart:4012:27)                                 
#4      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3924:15)                       
#5      Element.rebuild (package:flutter/src/widgets/framework.dart:3721:5)                                        
#6      StatefulElement.update (package:flutter/src/widgets/framework.dart:4085:5)                                 
#7      Element.updateChild (package:flutter/src/widgets/framework.dart:2876:15)                                   
#8      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3935:16)                       
#9      Element.rebuild (package:flutter/src/widgets/<…>              

@VyMajoris
Copy link

I'm using version 1.1.0 and I still get the console error dump when I recieve a 403 status code when providing an errorWidget.

@sujit-pasalkar
Copy link

@renefloor same error.

@nuvoPoint
Copy link

We are also getting this error, but for 403

@larssn
Copy link

larssn commented Jul 26, 2019

I think we're running into flutter/flutter#33427 which seems to be related to a VM problem.

@flutterbest
Copy link

@renefloor

@yxwandroid
Copy link

Same question

@flutterbest
Copy link

Same question

我还以为作者回复我了呢。。

@tzvc
Copy link

tzvc commented Aug 28, 2019

Also still have the error with 1.1.1. Only on android tho

@gateshibill
Copy link

i meet the same problem,i found change Icons.error to icons.outlin,it is ok when change back.

@babang1da
Copy link

same error 1.1.1 fix please

@VickySalunkhe
Copy link

@renefloor facing the same issue in V 1.1.1

@pdefuns
Copy link

pdefuns commented Oct 2, 2019

Why is this issue closed? Still facing this issue with v1.1.1

@larssn
Copy link

larssn commented Oct 3, 2019

If you're using VSCode, then this is probably a false positive from the Dart code plugin. Try and turn off the "Uncaught Exceptions" breakpoint on the debug screen.

Why this happens can be found here: flutter/flutter#33427
It boils down to the crude way in which the dart plugin scans for errors. As I take it, it doesn't use the dart compiler to understand the code, it simply scans your code, and looks for try catch handlers (etc.), and then tries to decide if something is uncaught or not.

@tzvc
Copy link

tzvc commented Oct 9, 2019

Still facing the issue as well

@Klabauterman
Copy link

Does some1 know if it is fixed in 1.1.2? I still had it in 1.1.1

@bes89
Copy link

bes89 commented Feb 8, 2020

Just updated to 1.1.2 and it shows me the error as INFO and not as ERROR:

I/flutter (19879): HttpException: No valid statuscode. Statuscode was 404
I/flutter (19879): CacheManager: Failed to download file from https://............. with error:

@expilu expilu mentioned this issue Jul 23, 2020
2 tasks
@leonidlist
Copy link

Still facing this issue

@wisp-x
Copy link

wisp-x commented Mar 3, 2021

Same question

@kreasindomediapratama
Copy link

same question 😵‍💫

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests