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
706 stars 166 forks source link

_ClientSocketException: Failed host lookup #529

Closed Wizzel1 closed 1 year ago

Wizzel1 commented 1 year ago

Describe the bug I am getting regular

_ClientSocketException
Failed host lookup: 'rhfwwqrwdplqqjxcprww.supabase.co' on my Windows app. 

Any idea why this happens?

????????? supabase_flutter 1.10.6
???   ????????? supabase 1.9.5
???   ???   ????????? functions_client 1.3.2
???   ???   ????????? gotrue 1.9.0
???   ???   ????????? postgrest 1.3.2       
???   ???   ????????? realtime_client 1.1.1 
???   ???   ????????? storage_client 1.5.1  
Vinzent03 commented 1 year ago

It simply means you don't have an internet connection. I suggest you to do quick google searches before creating an issue. This shows something liks this

Wizzel1 commented 1 year ago

If I hadn't done a Google search I wouldn't have created an issue. I have found your linked issue as well but since I am on windows, I don't need to set any permissions

Vinzent03 commented 1 year ago

Can you do other https requests in your flutter app? Or is the issue specific to the supabase client or server?

Wizzel1 commented 1 year ago

Apparently this only happens when I try to upload multiple images at the same time to a storage bucket:

final futures = imageDataList.map((imageData) async {
   return Supabase.instance.client.storage
          .from('my-images')
          .uploadBinary(
            'my/imagepath/image.png',
            imageData,
            fileOptions: const FileOptions(contentType: 'image/png'),
        );
});
await Future.wait(futures);

When I run a for loop it works every time:

for (final imageData in imageDataList) {
    await Supabase.instance.client.storage
        .from('my-images')
        .uploadBinary(
          'my/imagepath/image.png',
          imageData,
          fileOptions: const FileOptions(contentType: 'image/png'),
    );
}
Vinzent03 commented 1 year ago

I don't have a mac device, but I can't reproduce your issue with an online supabase project in the client tests:

final bucketName = 'with-limit-${DateTime.now()}';
await storage.createBucket(bucketName);
final list = List.generate(50, (index) => index);

final futures = list.map((e) => storage.from(bucketName).uploadBinary(
    "$e", file.readAsBytesSync(),
    fileOptions: FileOptions(contentType: 'image/png')));

await Future.wait(futures);
Wizzel1 commented 1 year ago

@Vinzent03 Okay thanks for verifying, I will keep an eye out for this error.

Wizzel1 commented 1 year ago

Couldn't reproduce it so I closed this for now

meulencv commented 1 year ago

Hello, I'm getting the same error Failed host lookup: 'mydbname.supabase.co' error all at once. Do you know what it could be? I have an internet connection and have tried different networks. Thanks

Vinzent03 commented 1 year ago

@meulencv On which platform? Can you query other websites via http package?

meulencv commented 1 year ago

Hello, Right now I get the error on android, it seems to me that on web the error is not shown. Yes, the internet works, in fact, the app loads .json files and photos from the internet. Also, if I disable the errors breakpoints in the debug, the app works correctly.

El dom, 20 ago 2023 a las 12:58, Vinzent @.***>) escribió:

@meulencv https://github.com/meulencv On which platform? Can you query other websites via http package?

— Reply to this email directly, view it on GitHub https://github.com/supabase/supabase-flutter/issues/529#issuecomment-1685254506, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2FNLKI6FIMXLLQ6VFHEKJDXWHUVBANCNFSM6AAAAAAZ4XSRH4 . You are receiving this because you were mentioned.Message ID: @.***>

MattL-NZ commented 1 year ago

I am also getting this error all of a sudden after upgrading Flutter to version 3.13.0 I have tried on both emulators and real devices. If you push through the exception, it still fetches the results from the database without any issues. I have logged a ticket here but happy to close that if this one is to be reopened. https://github.com/supabase/supabase-flutter/issues/595

meulencv commented 1 year ago

I got the error in the same version, I think it's related as you said.

chidera-ugonwa commented 11 months ago

I also get this same error, this mine happens when authenticating a client... it happens on windows, if I push through the exception everything works fine.

thefredo1000 commented 6 months ago

I do get the same error, I'm on Mac running an app on Android, any updates on this?

dshukertjr commented 6 months ago

The cause is most likely not Supabase. Check that you have given internet permission on your app and see if your app can make HTTP requests to other servers.

stanislavlysenko0912 commented 3 months ago

Anybody still has error? I got exception after some request to supabase 🤷‍♂️