hiddify / hiddify-next

Multi-platform auto-proxy client, supporting Sing-box, X-ray, TUIC, Hysteria, Reality, Trojan, SSH etc. It’s an open-source, secure and ad-free.
https://hiddify.com
Other
15.61k stars 1.44k forks source link

Adding a configuration file on the macos platform will throw the following exception:The connection errored: Bad file descriptor This indicates an error which most likely cannot be solved by the library. #1259

Open Milory opened 3 weeks ago

Milory commented 3 weeks ago

Search first

What Happened?

When I add a configuration file on the macOS platform(version: Sonoma 14.6.1), the following exception is thrown: The connection errored: Bad file descriptor This indicates an error which most likely cannot be solved by the library.

Then I opened the app.log file in the working directory and found the following detailed exception:

21:45:30.831925 - [D] bootstrap: [logs repository] initialized in 0ms 21:45:30.831935 - [I] bootstrap: initializing [logger controller] 21:45:30.831964 - [I] bootstrap: Hiddify v2.2.0 (20200) [prod] general release macos [Version 14.6.1 (Build 23G93)] 21:45:30.831976 - [I] bootstrap: initializing [profile repository] 21:45:30.832396 - [I] bootstrap: initializing [active profile] 21:45:30.838776 - [I] bootstrap: initializing [deep link service] 21:45:30.839264 - [I] bootstrap: initializing [sing-box] 21:45:30.839308 - [I] bootstrap: initializing [system tray] 21:45:30.839512 - [I] ConnectionNotifier: connection status: DISCONNECTED 21:45:31.841668 - [E] bootstrap: [system tray] error initializing TimeoutException after 0:00:01.000000: Future not completed

21:45:31.842187 - [I] bootstrap: bootstrap took [1037ms] 21:45:53.070713 - [W] ProfileRepositoryImpl: error adding profile by url DioException [connection error]: The connection errored: Bad file descriptor This indicates an error which most likely cannot be solved by the library. Error: SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = mojie0201.xn--8stx8olrwkucjq3b.com, port = 63801

0 DioMixin.fetch (package:dio/src/dio_mixin.dart:519)

#1 DioForNative.download (package:dio/src/dio/dio_for_native.dart:46) #2 ProfileRepositoryImpl.fetch. (package:hiddify/features/profile/data/profile_repository.dart:401) #3 TaskEither.flatMap.. (package:fpdart/src/task_either.dart:61) #4 ExceptionHandler.exceptionHandler. (package:hiddify/core/utils/exception_handler.dart:13) #5 TaskEither.match. (package:fpdart/src/task_either.dart:168) #6 AsyncValue.guard (package:riverpod/src/common.dart:177) #7 AddProfile.add (package:hiddify/features/profile/notifier/profile_notifier.dart:64) 21:45:53.071029 - [W] AddProfile: failed to add profile ProfileFailure.unexpected(error: DioException [connection error]: The connection errored: Bad file descriptor This indicates an error which most likely cannot be solved by the library. Error: SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = mojie0201.xn--8stx8olrwkucjq3b.com, port = 63801, stackTrace: #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:519) #1 DioForNative.download (package:dio/src/dio/dio_for_native.dart:46) #2 ProfileRepositoryImpl.fetch. (package:hiddify/features/profile/data/profile_repository.dart:401) #3 TaskEither.flatMap.. (package:fpdart/src/task_either.dart:61) #4 ExceptionHandler.exceptionHandler. (package:hiddify/core/utils/exception_handler.dart:13) #5 TaskEither.match. (package:fpdart/src/task_either.dart:168) #6 AsyncValue.guard (package:riverpod/src/common.dart:177) #7 AddProfile.add (package:hiddify/features/profile/notifier/profile_notifier.dart:64) ) 21:47:00.199945 - [W] ProfileRepositoryImpl: error adding profile by url DioException [connection error]: The connection errored: Bad file descriptor This indicates an error which most likely cannot be solved by the library. Error: SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = dy2.smjc.top, port = 63828 #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:519) #1 DioForNative.download (package:dio/src/dio/dio_for_native.dart:46) #2 ProfileRepositoryImpl.fetch. (package:hiddify/features/profile/data/profile_repository.dart:401) #3 TaskEither.flatMap.. (package:fpdart/src/task_either.dart:61) #4 ExceptionHandler.exceptionHandler. (package:hiddify/core/utils/exception_handler.dart:13) #5 TaskEither.match. (package:fpdart/src/task_either.dart:168) #6 AsyncValue.guard (package:riverpod/src/common.dart:177) #7 AddProfile.add (package:hiddify/features/profile/notifier/profile_notifier.dart:64) ### Minimal Reproducible Example (MRE) 1、Install the app 2、Add a new profile ### Expected Behavior Successfully imported the configuration file ### Version V2.2.0 ### Platform/OS macOS ### Additional Context image ### Application Config Options ```shell Newly installed apps have no configuration information ``` ### Relevant log output ```shell 21:45:30.831925 - [D] bootstrap: [logs repository] initialized in 0ms 21:45:30.831935 - [I] bootstrap: initializing [logger controller] 21:45:30.831964 - [I] bootstrap: Hiddify v2.2.0 (20200) [prod] general release macos [Version 14.6.1 (Build 23G93)] 21:45:30.831976 - [I] bootstrap: initializing [profile repository] 21:45:30.832396 - [I] bootstrap: initializing [active profile] 21:45:30.838776 - [I] bootstrap: initializing [deep link service] 21:45:30.839264 - [I] bootstrap: initializing [sing-box] 21:45:30.839308 - [I] bootstrap: initializing [system tray] 21:45:30.839512 - [I] ConnectionNotifier: connection status: DISCONNECTED 21:45:31.841668 - [E] bootstrap: [system tray] error initializing TimeoutException after 0:00:01.000000: Future not completed 21:45:31.842187 - [I] bootstrap: bootstrap took [1037ms] 21:45:53.070713 - [W] ProfileRepositoryImpl: error adding profile by url DioException [connection error]: The connection errored: Bad file descriptor This indicates an error which most likely cannot be solved by the library. Error: SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = mojie0201.xn--8stx8olrwkucjq3b.com, port = 63801 #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:519) #1 DioForNative.download (package:dio/src/dio/dio_for_native.dart:46) #2 ProfileRepositoryImpl.fetch. (package:hiddify/features/profile/data/profile_repository.dart:401) #3 TaskEither.flatMap.. (package:fpdart/src/task_either.dart:61) #4 ExceptionHandler.exceptionHandler. (package:hiddify/core/utils/exception_handler.dart:13) #5 TaskEither.match. (package:fpdart/src/task_either.dart:168) #6 AsyncValue.guard (package:riverpod/src/common.dart:177) #7 AddProfile.add (package:hiddify/features/profile/notifier/profile_notifier.dart:64) 21:45:53.071029 - [W] AddProfile: failed to add profile ProfileFailure.unexpected(error: DioException [connection error]: The connection errored: Bad file descriptor This indicates an error which most likely cannot be solved by the library. Error: SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = mojie0201.xn--8stx8olrwkucjq3b.com, port = 63801, stackTrace: #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:519) #1 DioForNative.download (package:dio/src/dio/dio_for_native.dart:46) #2 ProfileRepositoryImpl.fetch. (package:hiddify/features/profile/data/profile_repository.dart:401) #3 TaskEither.flatMap.. (package:fpdart/src/task_either.dart:61) #4 ExceptionHandler.exceptionHandler. (package:hiddify/core/utils/exception_handler.dart:13) #5 TaskEither.match. (package:fpdart/src/task_either.dart:168) #6 AsyncValue.guard (package:riverpod/src/common.dart:177) #7 AddProfile.add (package:hiddify/features/profile/notifier/profile_notifier.dart:64) ) 21:47:00.199945 - [W] ProfileRepositoryImpl: error adding profile by url DioException [connection error]: The connection errored: Bad file descriptor This indicates an error which most likely cannot be solved by the library. Error: SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = dy2.smjc.top, port = 63828 #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:519) #1 DioForNative.download (package:dio/src/dio/dio_for_native.dart:46) #2 ProfileRepositoryImpl.fetch. (package:hiddify/features/profile/data/profile_repository.dart:401) #3 TaskEither.flatMap.. (package:fpdart/src/task_either.dart:61) #4 ExceptionHandler.exceptionHandler. (package:hiddify/core/utils/exception_handler.dart:13) #5 TaskEither.match. (package:fpdart/src/task_either.dart:168) #6 AsyncValue.guard (package:riverpod/src/common.dart:177) #7 AddProfile.add (package:hiddify/features/profile/notifier/profile_notifier.dart:64) 21:47:00.200181 - [W] AddProfile: failed to add profile ProfileFailure.unexpected(error: DioException [connection error]: The connection errored: Bad file descriptor This indicates an error which most likely cannot be solved by the library. Error: SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = dy2.smjc.top, port = 63828, stackTrace: #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:519) #1 DioForNative.download (package:dio/src/dio/dio_for_native.dart:46) #2 ProfileRepositoryImpl.fetch. (package:hiddify/features/profile/data/profile_repository.dart:401) #3 TaskEither.flatMap.. (package:fpdart/src/task_either.dart:61) #4 ExceptionHandler.exceptionHandler. (package:hiddify/core/utils/exception_handler.dart:13) #5 TaskEither.match. (package:fpdart/src/task_either.dart:168) #6 AsyncValue.guard (package:riverpod/src/common.dart:177) #7 AddProfile.add (package:hiddify/features/profile/notifier/profile_notifier.dart:64) ) 21:51:57.698787 - [I] ProxiesSortNotifier: sort proxies by: [delay] 21:52:14.929226 - [W] ProfileRepositoryImpl: error adding profile by url DioException [connection error]: The connection errored: Bad file descriptor This indicates an error which most likely cannot be solved by the library. Error: SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = mojie0201.xn--8stx8olrwkucjq3b.com, port = 63907 #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:519) #1 DioForNative.download (package:dio/src/dio/dio_for_native.dart:46) #2 ProfileRepositoryImpl.fetch. (package:hiddify/features/profile/data/profile_repository.dart:401) #3 TaskEither.flatMap.. (package:fpdart/src/task_either.dart:61) #4 ExceptionHandler.exceptionHandler. (package:hiddify/core/utils/exception_handler.dart:13) #5 TaskEither.match. (package:fpdart/src/task_either.dart:168) #6 AsyncValue.guard (package:riverpod/src/common.dart:177) #7 AddProfile.add (package:hiddify/features/profile/notifier/profile_notifier.dart:64) 21:52:14.929510 - [W] AddProfile: failed to add profile ProfileFailure.unexpected(error: DioException [connection error]: The connection errored: Bad file descriptor This indicates an error which most likely cannot be solved by the library. Error: SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = mojie0201.xn--8stx8olrwkucjq3b.com, port = 63907, stackTrace: #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:519) #1 DioForNative.download (package:dio/src/dio/dio_for_native.dart:46) #2 ProfileRepositoryImpl.fetch. (package:hiddify/features/profile/data/profile_repository.dart:401) #3 TaskEither.flatMap.. (package:fpdart/src/task_either.dart:61) #4 ExceptionHandler.exceptionHandler. (package:hiddify/core/utils/exception_handler.dart:13) #5 TaskEither.match. (package:fpdart/src/task_either.dart:168) #6 AsyncValue.guard (package:riverpod/src/common.dart:177) #7 AddProfile.add (package:hiddify/features/profile/notifier/profile_notifier.dart:64) ) 21:58:38.239621 - [W] ProfileRepositoryImpl: error adding profile by url DioException [connection error]: The connection errored: Bad file descriptor This indicates an error which most likely cannot be solved by the library. Error: SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = mojie0201.xn--8stx8olrwkucjq3b.com, port = 64109 #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:519) #1 DioForNative.download (package:dio/src/dio/dio_for_native.dart:46) #2 ProfileRepositoryImpl.fetch. (package:hiddify/features/profile/data/profile_repository.dart:401) #3 TaskEither.flatMap.. (package:fpdart/src/task_either.dart:61) #4 ExceptionHandler.exceptionHandler. (package:hiddify/core/utils/exception_handler.dart:13) #5 TaskEither.match. (package:fpdart/src/task_either.dart:168) #6 AsyncValue.guard (package:riverpod/src/common.dart:177) #7 AddProfile.add (package:hiddify/features/profile/notifier/profile_notifier.dart:64) 21:58:38.239922 - [W] AddProfile: failed to add profile ProfileFailure.unexpected(error: DioException [connection error]: The connection errored: Bad file descriptor This indicates an error which most likely cannot be solved by the library. Error: SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = mojie0201.xn--8stx8olrwkucjq3b.com, port = 64109, stackTrace: #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:519) #1 DioForNative.download (package:dio/src/dio/dio_for_native.dart:46) #2 ProfileRepositoryImpl.fetch. (package:hiddify/features/profile/data/profile_repository.dart:401) #3 TaskEither.flatMap.. (package:fpdart/src/task_either.dart:61) #4 ExceptionHandler.exceptionHandler. (package:hiddify/core/utils/exception_handler.dart:13) #5 TaskEither.match. (package:fpdart/src/task_either.dart:168) #6 AsyncValue.guard (package:riverpod/src/common.dart:177) #7 AddProfile.add (package:hiddify/features/profile/notifier/profile_notifier.dart:64) ) 22:07:44.691711 - [W] ProfileRepositoryImpl: error adding profile by url DioException [connection error]: The connection errored: Bad file descriptor This indicates an error which most likely cannot be solved by the library. Error: SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = dy2.smjc.top, port = 64286 #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:519) #1 DioForNative.download (package:dio/src/dio/dio_for_native.dart:46) #2 ProfileRepositoryImpl.fetch. (package:hiddify/features/profile/data/profile_repository.dart:401) #3 TaskEither.flatMap.. (package:fpdart/src/task_either.dart:61) #4 ExceptionHandler.exceptionHandler. (package:hiddify/core/utils/exception_handler.dart:13) #5 TaskEither.match. (package:fpdart/src/task_either.dart:168) #6 AsyncValue.guard (package:riverpod/src/common.dart:177) #7 AddProfile.add (package:hiddify/features/profile/notifier/profile_notifier.dart:64) 22:07:44.691951 - [W] AddProfile: failed to add profile ProfileFailure.unexpected(error: DioException [connection error]: The connection errored: Bad file descriptor This indicates an error which most likely cannot be solved by the library. Error: SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = dy2.smjc.top, port = 64286, stackTrace: #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:519) #1 DioForNative.download (package:dio/src/dio/dio_for_native.dart:46) #2 ProfileRepositoryImpl.fetch. (package:hiddify/features/profile/data/profile_repository.dart:401) #3 TaskEither.flatMap.. (package:fpdart/src/task_either.dart:61) #4 ExceptionHandler.exceptionHandler. (package:hiddify/core/utils/exception_handler.dart:13) #5 TaskEither.match. (package:fpdart/src/task_either.dart:168) #6 AsyncValue.guard (package:riverpod/src/common.dart:177) #7 AddProfile.add (package:hiddify/features/profile/notifier/profile_notifier.dart:64) ) ``` ### Are you willing to submit a PR? If you know how to fix the bug. - [X] I'm willing to submit a PR (Thank you!)
Sheldontao commented 2 weeks ago

as long as i change a bit in profile text, it will crash out .

image