hamaluik / nomdebebe

A simple, private tool to help pick a baby name.
Apache License 2.0
266 stars 19 forks source link

Something went wrong sharing your liked names list #2

Closed jcgoette closed 3 years ago

jcgoette commented 3 years ago

Getting the "Something went wrong sharing your liked names list" error.

What can I share to help?

jholtom commented 3 years ago

I pulled a logcat, looked like it failed in DNS resolution of the server on the sharing tab. Pixel 6 Pro - Android 12

11-05 22:06:45.355 29124 29156 E flutter : [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: SocketException: Failed host lookup: 'nomdebebe.hamaluik.dev' (OS Error: No address associated with hostname, errno = 7) 11-05 22:06:45.355 29124 29156 E flutter : #0 _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:677) 11-05 22:06:45.355 29124 29156 E flutter : #1 _RawSocket.startConnect (dart:io-patch/socket_patch.dart:1680) 11-05 22:06:45.355 29124 29156 E flutter : #2 RawSocket.startConnect (dart:io-patch/socket_patch.dart:27) 11-05 22:06:45.355 29124 29156 E flutter : #3 RawSecureSocket.startConnect (dart:io/secure_socket.dart:237) 11-05 22:06:45.355 29124 29156 E flutter : #4 SecureSocket.startConnect (dart:io/secure_socket.dart:60) 11-05 22:06:45.355 29124 29156 E flutter : #5 _ConnectionTarget.connect (dart:_http/http_impl.dart:2437) 11-05 22:06:45.355 29124 29156 E flutter : #6 _HttpClient._getConnection.connect (dart:_http/http_impl.dart:2805) 11-05 22:06:45.355 29124 29156 E flutter : #7 _HttpClient._getConnection (dart:_http/http_impl.dart:2810) 11-05 22:06:45.355 29124 29156 E flutter : #8 _HttpClient._openUrl (dart:_http/http_impl.dart:2694) 11-05 22:06:45.355 29124 29156 E flutter : #9 _HttpClient.openUrl (dart:_http/http_impl.dart:2568) 11-05 22:06:45.355 29124 29156 E flutter : #10 IOClient.send (package:http/src/io_client.dart:30) 11-05 22:06:45.355 29124 29156 E flutter : #11 BaseClient._sendUnstreamed (package:http/src/base_client.dart:93) 11-05 22:06:45.355 29124 29156 E flutter : #12 BaseClient.get (package:http/src/base_client.dart:27) 11-05 22:06:45.355 29124 29156 E flutter : #13 get. (package:http/http.dart:46) 11-05 22:06:45.355 29124 29156 E flutter : #14 _withClient (package:http/http.dart:164) 11-05 22:06:45.355 29124 29156 E flutter : #15 get (package:http/http.dart:46) 11-05 22:06:45.355 29124 29156 E flutter : #16 SharedRepository.myID (package:nomdebebe/repositories/shared_repository.dart:32) 11-05 22:06:45.355 29124 29156 E flutter : #17 SharingBloc.refreshSharing (package:nomdebebe/blocs/sharing/sharing_bloc.dart:16) 11-05 22:06:45.355 29124 29156 E flutter : #18 main. (package:nomdebebe/main.dart:42) 11-05 22:06:45.355 29124 29156 E flutter : #19 _CreateInheritedProviderState.value (package:provider/src/inherited_provider.dart:687) 11-05 22:06:45.355 29124 29156 E flutter : #20 _InheritedProviderScopeElement.value (package:provider/src/inherited_provider.dart:544) 11-05 22:06:45.355 29124 29156 E flutter : #21 Provider.of (package:provider/src/provider.dart:289) 11-05 22:06:45.355 29124 29156 E flutter : #22 BlocProvider.of (package:flutter_bloc/src/bloc_provider.dart:100) 11-05 22:06:45.355 29124 29156 E flutter : #23 ScreenContainerState.build. (package:nomdebebe/main.dart:159) 11-05 22:06:45.355 29124 29156 E flutter : #24 _BottomNavigationBarState._createTiles. (package:flutter/src/material/bottom_navigation_bar.dart:1083) 11-05 22:06:45.355 29124 29156 E flutter : #25 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:989) 11-05 22:06:45.355 29124 29156 E flutter : #26 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:193) 11-05 22:06:45.355 29124 29156 E flutter : #27 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:608) 11-05 22:06:45.355 29124 29156 E flutter : #28 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:296) 11-05 22:06:45.355 29124 29156 E flutter : #29 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:267) 11-05 22:06:45.355 29124 29156 E flutter : #30 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:157) 11-05 22:06:45.355 29124 29156 E flutter : #31 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:444) 11-05 22:06:45.355 29124 29156 E flutter : #32 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:420) 11-05 22:06:45.355 29124 29156 E flutter : #33 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:278) 11-05 22:06:45.355 29124 29156 E flutter : #34 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:374) 11-05 22:06:45.355 29124 29156 E flutter : #35 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:338) 11-05 22:06:45.355 29124 29156 E flutter : #36 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:296) 11-05 22:06:45.355 29124 29156 E flutter : #37 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:279) 11-05 22:06:45.355 29124 29156 E flutter : #38 _rootRunUnary (dart:async/zone.dart:1444) 11-05 22:06:45.355 29124 29156 E flutter : #39 _CustomZone.runUnary (dart:async/zone.dart:1335) 11-05 22:06:45.355 29124 29156 E flutter : #40 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244) 11-05 22:06:45.355 29124 29156 E flutter : #41 _invoke1 (dart:ui/hooks.dart:185) 11-05 22:06:45.355 29124 29156 E flutter : #42 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:293) 11-05 22:06:45.355 29124 29156 E flutter : #43 _dispatchPointerDataPacket (dart:ui/hooks.dart:98) 11-05 22:06:45.355 29124 29156 E flutter : 11-05 22:06:45.365 29124 29156 E flutter : [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: SocketException: Failed host lookup: 'nomdebebe.hamaluik.dev' (OS Error: No address associated with hostname, errno = 7) 11-05 22:06:45.365 29124 29156 E flutter : #0 _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:677) 11-05 22:06:45.365 29124 29156 E flutter : #1 _RawSocket.startConnect (dart:io-patch/socket_patch.dart:1680) 11-05 22:06:45.365 29124 29156 E flutter : #2 RawSocket.startConnect (dart:io-patch/socket_patch.dart:27) 11-05 22:06:45.365 29124 29156 E flutter : #3 RawSecureSocket.startConnect (dart:io/secure_socket.dart:237) 11-05 22:06:45.365 29124 29156 E flutter : #4 SecureSocket.startConnect (dart:io/secure_socket.dart:60) 11-05 22:06:45.365 29124 29156 E flutter : #5 _ConnectionTarget.connect (dart:_http/http_impl.dart:2437) 11-05 22:06:45.365 29124 29156 E flutter : #6 _HttpClient._getConnection.connect (dart:_http/http_impl.dart:2805) 11-05 22:06:45.365 29124 29156 E flutter : #7 _HttpClient._getConnection (dart:_http/http_impl.dart:2810) 11-05 22:06:45.365 29124 29156 E flutter : #8 _HttpClient._openUrl (dart:_http/http_impl.dart:2694) 11-05 22:06:45.365 29124 29156 E flutter : #9 _HttpClient.openUrl (dart:_http/http_impl.dart:2568) 11-05 22:06:45.365 29124 29156 E flutter : #10 IOClient.send (package:http/src/io_client.dart:30) 11-05 22:06:45.365 29124 29156 E flutter : #11 BaseClient._sendUnstreamed (package:http/src/base_client.dart:93) 11-05 22:06:45.365 29124 29156 E flutter : #12 BaseClient.get (package:http/src/base_client.dart:27) 11-05 22:06:45.365 29124 29156 E flutter : #13 get. (package:http/http.dart:46) 11-05 22:06:45.365 29124 29156 E flutter : #14 _withClient (package:http/http.dart:164) 11-05 22:06:45.365 29124 29156 E flutter : #15 get (package:http/http.dart:46) 11-05 22:06:45.365 29124 29156 E flutter : #16 SharedRepository.myID (package:nomdebebe/repositories/shared_repository.dart:32) 11-05 22:06:45.365 29124 29156 E flutter : #17 SharedRepository.setLikedNames (package:nomdebebe/repositories/shared_repository.dart:85) 11-05 22:06:45.365 29124 29156 E flutter : #18 SharingBloc.mapEventToState (package:nomdebebe/blocs/sharing/sharing_bloc.dart:53) 11-05 22:06:45.365 29124 29156 E flutter : 11-05 22:06:45.365 29124 29156 E flutter :

jholtom commented 3 years ago

However, it resolves perfectly fine from an adb shell on device

2|raven:/ $ ping nomdebebe.hamaluik.dev PING nomdebebe.hamaluik.dev (45.33.49.64) 56(84) bytes of data. 64 bytes from li999-64.members.linode.com (45.33.49.64): icmp_seq=1 ttl=55 time=37.5 ms 64 bytes from li999-64.members.linode.com (45.33.49.64): icmp_seq=2 ttl=55 time=103 ms 64 bytes from li999-64.members.linode.com (45.33.49.64): icmp_seq=3 ttl=55 time=44.8 ms ^C --- nomdebebe.hamaluik.dev ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2004ms rtt min/avg/max/mdev = 37.504/61.798/103.088/29.348 ms raven:/ $

Just a little proof that its not my network messing up :) Sharing also works and resolves fine on my wife's iPhone

jholtom commented 3 years ago

Obviously, the next step was to run a server to try and change the error. Got returned an EPERM (Operation not permitted) on trying to connect to my local one I set up.

11-05 22:16:50.344 29923 29954 E flutter : [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: SocketException: Connection failed (OS Error: Operation not permitted, errno = 1), address = 192.168.0.158, port = 8080
11-05 22:16:50.344 29923 29954 E flutter : #0      _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:677)
11-05 22:16:50.344 29923 29954 E flutter : #1      _RawSocket.startConnect (dart:io-patch/socket_patch.dart:1680)
11-05 22:16:50.344 29923 29954 E flutter : #2      RawSocket.startConnect (dart:io-patch/socket_patch.dart:27)
11-05 22:16:50.344 29923 29954 E flutter : #3      Socket._startConnect (dart:io-patch/socket_patch.dart:1891)
11-05 22:16:50.344 29923 29954 E flutter : #4      Socket.startConnect (dart:io/socket.dart:738)
11-05 22:16:50.344 29923 29954 E flutter : #5      _ConnectionTarget.connect (dart:_http/http_impl.dart:2439)
11-05 22:16:50.344 29923 29954 E flutter : #6      _HttpClient._getConnection.connect (dart:_http/http_impl.dart:2805)

This leads me to notice you're (@hamaluik) missing the appropriate permissions for the app to access the network in your AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Edit: I didn't bother to grep, I see the android.permission.INTERNET, but not the ACCESS_NETWORK_STATE? I'm not super familiar with android permissions, so who knows....

jholtom commented 3 years ago

I just built it in debug mode, works fine now on my pixel 6 pro, and in adb shell dumpsys package ca.hamaluik.nomdebebe it shows the INTERNET permission. So I guess somewhere between debug and release mode the INTERNET permission got lost.

hamaluik commented 3 years ago

Well that's embarrasing. Thanks for the detective work folks, just pushed out a release which should fix this on Android.,,