
Hi π
After deploy a function, got this error: Could not resolve host: appwrite-executor with status code 0.

Where you getting this error exactly?

In dashboard...


π

Can you share this part of your code
const client = new Client()
.setEndpoint('https://cloud.appwrite.io/v1')

OK

Hmm..

import * as sdk from "node-appwrite";
type AppwriteVariables =
| "APPWRITE_FUNCTION_ENDPOINT"
| "APPWRITE_FUNCTION_API_KEY"
| "APPWRITE_FUNCTION_ID"
| "APPWRITE_FUNCTION_PROJECT_ID"
| "APPWRITE_FUNCTION_API_KEY";
type AppwriteRequest = {
headers: { [name: string]: string };
payload: string;
variables: { [key in AppwriteVariables]: string };
};
interface AppwriteResponse {
send: (data: string, status?: number) => {};
json: (data: object, status?: number) => {};
}
module.exports = async function (req: AppwriteRequest, res: AppwriteResponse) {
const client = new sdk.Client();
const users = new sdk.Users(client);
if (
!req.variables["APPWRITE_FUNCTION_ENDPOINT"] ||
!req.variables["APPWRITE_FUNCTION_API_KEY"]
) {
throw Error(
"Environment variables are not set. Function cannot use Appwrite SDK."
);
} else {
client
.setEndpoint(req.variables["APPWRITE_FUNCTION_ENDPOINT"])
.setProject(req.variables["APPWRITE_FUNCTION_PROJECT_ID"])
.setKey(req.variables["APPWRITE_FUNCTION_API_KEY"])
.setSelfSigned(true);
}
const getAllUsers = await users.list();
res.json({ message: getAllUsers.users });
};

I have set variables in functions settings (dashboad)

That seems good

And what value you've put inside this variable? APPWRITE_FUNCTION_ENDPOINT


When try activate i got this error


Is this a self-hosted Appwrite?

Yes

Can you run
docker ps -a
And share the results?

ok


Up 2 minutes ago beacuse updated .env file, added a dart runtimes

Okay so it seems like the appwrite-executor
has just been created
Can you try to execute your function now

It seems like it should work

Donβt work

Before this didnβt work, I changed the .env file because I had forgotten to add the runtime, but I tell you that it was no longer working.
Recommended threads
- CSV Import not working
I am running 1.7.4, trying the sample book csv import. I get a pop up saying import started and then a quick follow up saying completed. Nothing ever appears ...
- β[Help] Function stuck in "waiting" stat...
Hi Appwrite team π I'm trying to contribute to Appwrite and followed the official setup instructions from the CONTRIBUTING.md guide to run the platform locall...
- 1.7.0 Self Hosted Upgrade
Hi, I've tried a fresh install on 1.7.0 and I've also done a fresh install on 1.6.2. 1.6.2 is working fine fresh, update to 1.7.0 and migrate fails Fresh inst...
