Skip to content
Back

Appwrite isn't accepting the api from server

  • 0
  • Flutter
safeer
18 Oct, 2025, 15:29

Error creating user: AppwriteException: Server Error type: 'general_unknown', response: '{"message":"Server Error","code":500,"type":"general_unknown","version":"1.8.0"}' }

TL;DR
Appwrite isn't accepting the API from the server. The developers were passing an incorrect number of parameters to the endpoint causing an error. The correct version of the code was provided with the necessary adjustments. The issue was resolved by ensuring that the correct number of parameters was passed to the Appwrite API call.
Axistro
18 Oct, 2025, 15:30

can you provide the code ?

safeer
18 Oct, 2025, 15:32

app.post("/api/auth/register", async (req, res) => { // Added 'async' try { const { email, password } = req.body;

TypeScript
// 1. Create a unique ID for the new user
const userId = nanoid();

// 2. Call Appwrite to create the user
// Appwrite Users.create signature is (userId, email, password, name?)
const newUser = await users.create(
  userId,
  email,
  null, // name (optional)
  password,
  null
);

console.log("Successfully created user:", newUser);

// 3. Send a success response back to Flutter
res.status(201).json({
  message: "User registered successfully!",
  userId: newUser.$id,
});

} catch (error) { console.error("Error creating user:", error); // Keep logging the full error to the console res.status(500).json({ message: "Failed to register user", // NEW: Send back the full error details as a string error: JSON.stringify(error, Object.getOwnPropertyNames(error)), }); } });

Axistro
18 Oct, 2025, 15:36
TypeScript
 const newUser = await users.create(
      userId,
      email,
      null, // name (optional)
      password,
      null
    );

Are you passing 5 params ? the endpoint accepts 4

TypeScript
const result = await account.create({
    userId: '<USER_ID>',
    email: 'email@example.com',
    password: '',
    name: '<NAME>' // optional
});

this should be the correct version

safeer
18 Oct, 2025, 15:45

oh my god bro it worked .. thank you soo much . i literally spend more than two hours in this error you are life saver

Axistro
18 Oct, 2025, 15:46

its better to ask here instead of using ai remember for future occurence

safeer
18 Oct, 2025, 15:49

yeah thanks bro

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