Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Unhandled exception:type 'Null' is not a subtype of type 'FutureOr<Response>' #22

Closed
MartinGao opened this issue Jun 5, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@MartinGao
Copy link

MartinGao commented Jun 5, 2021

Hi

13:53:49 - Sent harvester report to server
Retrying in 10 minutes
Unhandled exception:
type 'Null' is not a subtype of type 'FutureOr<Response>'
#0 _FutureListener.handleError (dart:async/future_impl.dart:172)
#1 Future._propagateToListeners.handleError (dart:async/future_impl.dart:719)
#2 Future._propagateToListeners (dart:async/future_impl.dart:740)
#3 Future._completeError (dart:async/future_impl.dart:550)
#4 _completeOnAsyncError (dart:async-patch/async_patch.dart:274)
#5 _withClient (package:http/http.dart)
<asynchronous suspension>

After upgrading to version 1.3.x, I am experiencing this bug frequently. I mainly use harvester.sh
I was using 1.2.7 before and 1.2.7 did not have this issue.

Also, this bug is not always there. Like I am able to run harvester.sh, and in the first 30 to 40 mins, harvester.sh reports as expected. harvester.sh crashes after making several reports.

@gilnobrega
Copy link
Owner

From what I can see that seems to be a bug with http package. (https://pub.dev/packages/http)
I made chiabot's code null safe in 1.3.0 and that meant having to update its dependencies.
That being said, this issue could be happening if you are running/compiling it from source and did not update its libraries.
If you are compiling it from source run dart pub get to update them.
Let me know if you are not.

@gilnobrega
Copy link
Owner

Oh also, check log.txt when that happens.

@gilnobrega
Copy link
Owner

OK so another user has reported the same issue (on Linux as well).
With the following log:

2021-06-06 12:02:56.920410 Client: Server timeout.
2021-06-06 12:02:56.920562 Client: SocketException: OS Error: Connection reset by peer, errno = 104, address = chiabot.znc.sh, port = 36642
2021-06-06 12:02:56.920762 Client: 

Seems like it could be an issue with the server/cloudflare refusing some connections.
Nevertheless, the client should have handled that error.
I have built a pre-release which should handle these errors better,
Let me know if it works for you. Here's the link to the pre-release:
https://github.com/joaquimguimaraes/chiabot/releases/tag/v1.3.4-dev

@gilnobrega gilnobrega added the bug Something isn't working label Jun 6, 2021
@MartinGao
Copy link
Author

Thanks for the new version.

I tried 1.3.4-dev and harvester.sh has been running for about 6 hrs without any crash.
I think the bug is gone.

@gilnobrega
Copy link
Owner

Ok, I'm gonna release it then.

@gilnobrega
Copy link
Owner

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants