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
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...
- Migrate from cloud to localhost
Hello everyone. I need to migrate my test project from cloud to localhost, however it seems that this is possible only if a self-hosted appwrite instance it's h...