Back

[SOLVED] ECONNREFUSED on appwrite function using appwrite cloud

  • 0
  • Functions
ianmont
4 Oct, 2023, 05:08

Im using appwrite cloud and when running a function that i have recently deployed i get this error:

Error: connect ECONNREFUSED 127.0.0.1:80 at Client.call (/usr/local/server/src/function/node_modules/node-appwrite/lib/client.js:180:23) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Databases.listDocuments (/usr/local/server/src/function/node_modules/node-appwrite/lib/services/databases.js:1638:16) at async Module.default (file:///usr/local/server/src/function/index.js:11:27) at async execute (/usr/local/server/src/server.js:141:22) at async /usr/local/server/src/server.js:158:13

what could be happening?

TL;DR
The user was getting an ECONNREFUSED error when running a function on the Appwrite cloud. They realized they may have written the name of a variable incorrectly and tried modifying it. They also shared their code to see if there were any other potential errors. Another user pointed out that the endpoint in the client().setEndpoint function is using "localhost," which is incorrect for Appwrite cloud. It should be changed to the appropriate endpoint for the cloud. Solution: Change the endpoint in the client().setEndpoint function to the correct Appwrite cloud endpoint.
Drake
4 Oct, 2023, 05:31

You seem to be using localhost for the endpoint

ianmont
4 Oct, 2023, 18:07
ianmont
4 Oct, 2023, 18:08

I sent my code to see what the error could be.

In client().setEndpoint I call a .env variable with the endpoint, is it written correctly?

ianmont
4 Oct, 2023, 18:09

ohh

ianmont
4 Oct, 2023, 18:09
ianmont
4 Oct, 2023, 18:10

It seems to me that I wrote the name of the variable wrong, I will try to modify it and see if that is the error.

ianmont
4 Oct, 2023, 18:12

Oh that worked, solved <:appwriterocket:823996226894692403>

ianmont
4 Oct, 2023, 18:12

[SOLVED] ECONNREFUSED on appwrite function using appwrite cloud

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more