FileManager fails to load more than one file into System.FileDocument

Hello, I am running Mendix 3.1.1 and I find that when inserting the second or later file into my database using FileManager, the Save command fails. This is apparently because the Save command retrieves the current record from the database by selecting fileid=0. Since after the first insert there will be more than one record with fileid=0 (the fileid field is not self-incrementing) we get multiple records returned and the following error gets thrown: Uploading file failed: File document for file id 0 could not be retrieved [User 'admin' with roles 'Administrator'] com.mendix.systemwideinterfaces.MendixRuntimeException: File document for file id 0 could not be retrieved at iE.b(SourceFile:300) at iE.a(SourceFile:163) at iE.a(SourceFile:105) at iE.a(SourceFile:82) at iE.processRequest(SourceFile:75) at iG.a(SourceFile:71) at com.mendix.core.MxRuntime.processRequest(SourceFile:842) at com.mendix.m2ee.server.handler.RuntimeHandler.handle( at org.eclipse.jetty.server.handler.HandlerWrapper.handle( at org.eclipse.jetty.server.Server.handle( at org.eclipse.jetty.server.HttpConnection.handleRequest( at org.eclipse.jetty.server.HttpConnection$RequestHandler.content( at org.eclipse.jetty.http.HttpParser.parseNext( at org.eclipse.jetty.http.HttpParser.parseAvailable( at org.eclipse.jetty.server.HttpConnection.handle( at at org.eclipse.jetty.util.thread.QueuedThreadPool$ at ack and the save operation fails with: Is there any workaround for this problem? Thanks, Michael
2 answers

I suggest filing a ticket with test project at


Thanks for your advice. Just some feedback:

I tried to set up a repro in a new project and could not reproduce the behaviour.

Finally, I tried creating a fresh database from my existing project on another database server and that also didn't have the problem. I then tried dropping and recreating the affected tables in the original database but that also didn't solve the problem.

Eventually I rebuilt a fresh database on my dev server and that solved the problem. Only problem is that I have to now save and restore the existing data for the production db before I deploy, but at least the problem is solved.

My guess is that something went wrong at some stage of database synchronisation.