
AppwriteException {
name: 'AppwriteException',
code: 500,
type: 'general_unknown',
response: {
message: 'Server Error',
code: 500,
type: 'general_unknown',
version: '0.11.4'
},
stack: 'AppwriteException: Server Error\n' +
' at Client.eval (webpack-internal:///(app-client)/./node_modules/appwrite/dist/esm/sdk.js:410:27)\n' +
' at Generator.next (<anonymous>)\n' +
' at fulfilled (webpack-internal:///(app-client)/./node_modules/appwrite/dist/esm/sdk.js:41:58)',
message: 'Server Error'
}
getting this error when creating a new document. was working fine till now.
Function that creates the trip defined in zustand store
createTrip: async (trip) => {
try {
let file: Image | undefined;
if (trip.image) {
const fileUploaded = await uploadImage(trip.image, process.env.NEXT_PUBLIC_TRIP_BANNER_IMAGE_BUCKET_ID!);
if (fileUploaded) {
file = {
bucketId: fileUploaded.bucketId,
fileId: fileUploaded.$id,
};
}
}
const response = await databases.createDocument(
process.env.NEXT_PUBLIC_TRIPARCHITECT_DATABASE_ID!,
process.env.NEXT_PUBLIC_TRIPS_COLLECTION_ID!,
ID.unique(),
{
name: trip.name,
startDate: trip.startDate,
endDate: trip.endDate,
creator: trip.creator,
...(file && { image: JSON.stringify(file) }),
}
);
return response as Models.Document;
} catch (error) {
console.log(error);
} finally {
set(() => ({
isOpen: false,
imageFile: null,
tripName: "",
tripStartDate: "",
tripEndDate: "",
}));
}
},

what's your project ID?

Same Problem by me with self hosted. All other collections work.

Funny thing, REST works for this collection but not the Web SDK.

@Ali Memon did you add a relation to your collection. After I removed the relation it works again. I added One Way and Two Way relations. Even if I not use them in the create process because they are not required it works. But as soon I want to touch them I get a 500 error. @Steven What kind of logs should I create for an Issue about this, that would help you to check this?

exact reproducible steps and, if you're self hosting, docker logs from the appwrite container for the related API call

same issue on cloud

/v1/account fail also with 500

can you explain a bit more? @WuGGu

6475c7f6bc7e095dae62

I have a collection called projects and have relations to the collection data and sessions. Now I added a collection called mapping which has a relation to projects but also data and session. After I removed the data and session relation out of mapping it works again. as soon I add the relation and want to use them by creating a relation with ID with the Web SDK I get a 500 Error.
data --> projects <-- session | projects <--mapping | data --> mapping <-- session | The last relation kills it.

In my case, I have a single collection called trips that's it. There are no relations

did you used to?

are you still having this problem?

Server Error Creating a document

No The databases structure was not modified It was working fine till the previous week

Yes, In my case when creating a trip I am doing two things 1. Create a storage file and get the file Id 2. Create a new document in trips collection

Did you change your schema at all?

No

something seems screwed up with your collection...can you recreate it?

Ok I will try doing that
Recommended threads
- Network error when attempting to fetch r...
Hi, I am trying to modify some database data in the console for testing but keep getting this error. I am on the appwrite cloud and have already tried clearing ...
- Having errors migrating to cloud
Project will not migrate compeltely
- Appwrite realtime stopped working all of...
In our production environment, Appwrite Realtime suddenly stopped working and no updates are coming through , can you confirm if there are any known issues?
