Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bug Report: "Connection refused" error on dart function #6945

Closed
2 tasks done
FabiKel opened this issue Oct 18, 2023 · 5 comments
Closed
2 tasks done

馃悰 Bug Report: "Connection refused" error on dart function #6945

FabiKel opened this issue Oct 18, 2023 · 5 comments
Assignees
Labels
bug Something isn't working product / functions Fixes and upgrades for the Appwrite Functions.

Comments

@FabiKel
Copy link

FabiKel commented Oct 18, 2023

馃憻 Reproduction steps

When I try to get any information from my database I get an AppwriteException: null, Connection refused (0).

I tried it with dart runtime 2.17, 2.18 and 3.0. I tried in developement and production mode.
I deployed the functions with CLI 4.1.0

final client = Client()
      .setEndpoint('http:https://myEndpoint/v1')
      .setProject("myProjektID")
      .setKey(Platform.environment["API_KEY"])
      .setSelfSined();
      
final Databases databases = Databases(client);
await databases.get(databaseId: "myDatabaseID"); // error here

To test it, i gave the key every scope, but the error persists. I upgraded from 1.3.6 to 1.4.3 to 1.4.5. The error exists since the upgrade from 1.3 to 1.4.

馃憤 Expected behavior

Get the required data.

馃憥 Actual Behavior

Throws AppwriteException: null, Connection refused (0)

AppwriteException: null, Connection refused (0)
#0      ClientIO.call (package:dart_appwrite/src/client_io.dart:231)
<asynchronous suspension>
#1      Databases.get (package:dart_appwrite/services/databases.dart:71)
<asynchronous suspension>
#2      main (package:starter_template/main.dart:13)
<asynchronous suspension>
#3      Future.any.onValue (dart:async/future.dart:612)
<asynchronous suspension>

馃幉 Appwrite version

Version 1.4.x

馃捇 Operating system

Linux

馃П Your Environment

  • tested with Appwrite 1.4.3 and 1.4.5
  • tested with Dart Appwrite SDK 8.0.0 and 10.0.0
  • tested with Dart runtime 2.17, 2.18, 3.0

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@FabiKel FabiKel added the bug Something isn't working label Oct 18, 2023
@adarsh-jha-dev
Copy link

Hey @FabiKel , i request you to please assign this to me

@stnguyen90 stnguyen90 self-assigned this Oct 18, 2023
@stnguyen90 stnguyen90 added the product / functions Fixes and upgrades for the Appwrite Functions. label Oct 18, 2023
@stnguyen90
Copy link
Contributor

@FabiKel, thanks for creating this issue! 馃檹馃徏 Where is your Appwrite instance deployed and are you using localhost for the endpoint? What is the endpoint?

@FabiKel
Copy link
Author

FabiKel commented Oct 19, 2023

The instance is on a server (vm) in the local network only.

_APP_ENV=development
_APP_DOMAIN=[HOSTNAME]
_APP_DOMAIN_FUNCTIONS=functions.localhost
_APP_DOMAIN_TARGET=[HOSTNAME]

In version 1.3 the same function was working. Since 1.4 it's not working anymore. Are there some other (new) variables I have to check?

@stnguyen90
Copy link
Contributor

stnguyen90 commented Oct 19, 2023

@FabiKel,

In version 1.3 the same function was working. Since 1.4 it's not working anymore.

Perhaps the hostname or IP address you're using here changed:

setEndpoint('http:https://myEndpoint/v1')

Are there some other (new) variables I have to check?

No, there are no other variables to check

@FabiKel
Copy link
Author

FabiKel commented Oct 23, 2023

I have found the error.
Host name and IP address have not changed, then the client applications would also no longer work.
But at the same time as updating from 1.3.6 to 1.4.3, I also brought Ubuntu up to the latest version.
In the old setup, the host name as .env variable in the function was resolved to the private IP address of the server. In the current version, the host name is converted to 127.0.1.1. This caused the error. And I think this is caused by Ubuntu not Appwrite.

Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / functions Fixes and upgrades for the Appwrite Functions.
Projects
None yet
Development

No branches or pull requests

3 participants