supabase / supabase-flutter

Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.
https://supabase.com/
MIT License
662 stars 155 forks source link

SocketException with "No address associated with hostname" error message when launching the app without `force_staggered_ipv6_lookup` flag #814

Closed bangzaka closed 4 months ago

bangzaka commented 5 months ago

Exception has occurred. SocketException (SocketException: Failed host lookup: 'xxxxxxxxxxxxx.supabase.co' (OS Error: No address associated with hostname, errno = 7))

when running vscode debugging, but when using the command:

flutter run --dart-define=dart.library.io.force_staggered_ipv6_lookup=true

This is working normally, can anyone explain, how to deal with this problem.

Vinzent03 commented 5 months ago

Do you have the same issue when starting the app in debug mode via flutter run, so without vscode?

bangzaka commented 5 months ago

I have tried various ways, here are some of my notes:

  1. When run start debug an exception will appear.
  2. When running without debug the exception does not appear.
  3. When the profile mode exception does not appear (cannot hot reload).
  4. When the release mode does not appear.

I've added it <uses-permission android:name="android.permission.INTERNET"/> in debug mode, profile and others.

I've tried flutter clean. but the exception still appears when running debug.

dshukertjr commented 5 months ago

@bangzaka Would you be able to open a support ticket from supabase.help about this issue?

Vinzent03 commented 5 months ago

I guess it's because of the debug breakpoint setting in vscode. From what I understand the api url no longer resolves to ipv4 but ipv6 so it first tries ipv4, but fails causing an exception which I think gets caught. What happens if you turn uncheck both boxes. Are your queries working then?

image

bangzaka commented 5 months ago

thanks man, WTF problem solved, just by unchecking the exception. maybe I'm being too paranoid because supabase uses ipv6 image

dshukertjr commented 5 months ago

Hmm, you should be able to connect to your Supabase API via IPv4 though.

dshukertjr commented 4 months ago

@bangzaka Although the cause is unknown, it seems like you aren't having trouble running your app, so I'm going to close this issue. Feel free to re-open it if you run into the same issue in the future.