Hello! Self hosted, 1.5.5. As title says, I am getting an error when creating the document's relationship attribute. Both collection's permissions are set to "any" on everything.
TypeScript
const sdk = require("node-appwrite");
const { Account, ID, Permission, Role } = require("node-appwrite");
const adminClient = new sdk.Client()
.setEndpoint(process.env.AWENDPOINT)
.setProject(process.env.AWPROJECTID)
.setKey(process.env.AWSECRETKEY);
const importTool = async (file, userId, username, session) => {
// Function code skipped for brevity
const databases = new sdk.Databases(adminClient);
const tool = await databases.createDocument(
process.env.AWDBID, // databaseId
process.env.AWTOOLSCOLLID, // collectionId
ID.unique(), // documentId auto generated
{
userId: userId,
name: name,
description: description,
userScript: userScript,
} /*
[
Permission.read(Role.user(userId)),
Permission.update(Role.user(userId)),
Permission.delete(Role.user(userId)),
] */
);
for (let field of customFields) {
try {
updatedTool = await databases.updateDocument( // This is where the error happens
process.env.AWDBID, // databaseId
process.env.AWTOOLSCOLLID, // collectionId
tool.$id,
{
customFields: {
name: field.name,
type: field.type,
value: field.value,
options: field.options,
parent: field.parent,
toolId: tool.$id,
},
}
);
} catch (error) {
console.error("Error :", error);
}
}
};
TL;DR
Developers are encountering a 'general_unknown' error when creating document relationship attributes. Both collection permissions are set to 'any'. The issue seems to be with the code snippet provided, specifically when updating a document. The solution might involve reviewing the updateDocument method and ensuring proper parameters are passed.Recommended threads
- Unknown column 'sourceSize' in 'field li...
After migrating from 1.6.1 to 1.7.4 I noticed this message in the logs: `appwrite-worker-stats-resources | 2025-10-26T10:32:38.289577112Z Failed: SQLSTATE[...
- Invalid document structure: Missing requ...
After migrating from 1.6.1 to 1.7.4 I noticed this message in the logs: appwrite-worker-audits | 2025-10-26T11:15:24.062537020Z Error processing a...
- New attribute stuck on processing?
I was running out of disk space and after creating an attribute and restarting my appwrite (self hosted) I have an attribute stuck on creation. Any way to remov...