I have a loop appending futures of create document and then waiting until they all complete. The first one always completes. For the 2nd through 4th, I may get one or two, but never all three. I get a generic server error 500. Here is my code
Future<List<dynamic>> SaveFacility() async {
Map<String, dynamic> ourData = {
'facility_name': facilityName,
'facility_building': facilityBuilding,
'facility_room': facilityRoom,
'grid_height': gridHeight,
'grid_width': gridWidth,
};
List<Future> theFutureList = [];
theFutureList.add(
_manageSession.createDocument(ourData, "63eefc630814627ea850"));
for (int theIndex = 0; theIndex < rackList.length; theIndex++) {
Map<String, dynamic> theRackMap = {
'relative_position': rackList[theIndex].relativePosition,
'absolute_position': rackList[theIndex].absolutePosition,
'facility_name': facilityName,
};
theFutureList.add(
_manageSession.createDocument(theRackMap, "63ef152596e8de3a0033"));
}
return Future.wait(theFutureList);
}
I think I got this working. I enclosed the futurelist.add inside a future delayed command. If this is indeed the case, it implies there is some limit to how quickly one can send commands to the server. If that is the case, the error should be more informative.
When you get a 500 error, you'll have to check the docker logs for the appwrite container to see the underlying error
You mean the docker.log on the host or are there specific docker logs for each container, also on the host or contained within the container itself?
There are logs for each container. I was referring to the logs for the appwrite container
Which container would be the one returning this error? There are more than a dozen.
appwrite
[SOLVED] What might be causing a generic server error?
Recommended threads
- hi guys! my site is not accesible in my ...
- MongoDb Database Breaks integer[] & bigi...
I've got a table with the below column created. When I try to insert the value `[-3408048000]` into it, the dart sdk cloud function call is successful (no error...
- Delete on cascade from Cloud Function
I'm writing a Python function that deletes a user's main row from a table in my database. This row has relationships with other tables that use cascade deletion...