Skip to content

http request error on macOS #277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Reinoal opened this issue Nov 16, 2022 · 5 comments
Closed

http request error on macOS #277

Reinoal opened this issue Nov 16, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@Reinoal
Copy link

Reinoal commented Nov 16, 2022

Describe the bug
Supabase deployed on Linux on the local LAN, real mobile phone requests can normally return data, and macOS requests will report HTTP errors. url like this: 'http://192.168.8.182:8000/'

To Reproduce
this error appears in all http requests

Additional context
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.7, on macOS 12.6 21G115 darwin-x64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.71.1)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

• No issues found!

@Reinoal Reinoal added the bug Something isn't working label Nov 16, 2022
@Vinzent03
Copy link
Collaborator

Hey, now your error message is missing in the issue. May you try normal https requests without the supabase package to your server?

@Reinoal
Copy link
Author

Reinoal commented Nov 17, 2022

Error messages:
http version: 0.13.5
postgrest 1.1.1
Connection failed, StackTrace: #0 IOClient.send (package:http/src/io_client.dart:88:7)

#1 BaseClient._sendUnstreamed (package:http/src/base_client.dart:93:32)

#2 _withClient (package:http/http.dart:164:12)

#3 PostgrestBuilder._execute (package:postgrest/src/postgrest_builder.dart:164:20)

#4 PostgrestBuilder.then (package:postgrest/src/postgrest_builder.dart:397:24)

@Vinzent03
Copy link
Collaborator

Can you access your server in your mac app with any other http request via Dart http package?

@Reinoal
Copy link
Author

Reinoal commented Nov 17, 2022

macOS needs you to request a specific entitlement in order to access the network. To do that open macos/Runner/DebugProfile.entitlements and add the following key-value pair.
com.apple.security.network.client

thanks for https://stackoverflow.com/questions/65458903/socketexception-connection-failed-os-error-operation-not-permitted-errno-1

@Reinoal Reinoal closed this as completed Nov 17, 2022
@Reinoal
Copy link
Author

Reinoal commented Nov 17, 2022

set config macos/Runner/DebugProfile.entitlements
add key-value: key: com.apple.security.network.client, value: true

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

No branches or pull requests

2 participants