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
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- apple exchange code to token
hello guys, im new here 🙂 I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...
- Our Appwrite organization is suspended
Please give support regarding this , no app is working now , please solve my issue and give support , no one is replying in message section or email.