SQLiteCore fails to write database on linux with I/O Error - CREATE TABLE statement

Hello,
this works fine on windows, but not on linux.
I open a new database with flags ReadWriteCreate, works fine - database is there.
The next step of executing a CREATE TABLE statement fails with return code 10 ( I/O ERROR ).
The permissions are correct (777 / 755), i can use sqlite3 to manually create a db and create tables in there, so i don’t think it’s an OS setup issue?

	FSQLitePreparedStatement saveStatement;
	FString saveQuery;
	
	// Characters
	saveQuery = TEXT("CREATE TABLE Characters ( id INTEGER PRIMARY KEY );");

	saveStatement.Create(*Database, *saveQuery);
	bool success = saveStatement.Execute();
	UE_LOG(LogTemp, Log, TEXT("UTKDatabaseSubsystem::FreshInitializeDatabase Result Characters: %d %s"), success, *Database->GetLastError());
	saveStatement.Destroy();

Works fine on windows but will fail with I/O error on linux. Anybody knows why?

Also happens when i provide a premade db with the tables existing, then the next write statement will fail.

What i tried so far:

  • Checked privileges of containing folder (saved) and database file
  • Tried with -SaveToUserDir
  • Replaced PreparedStatement with direct Database.Execute
  • Changed umask for new created files
  • Tried as normal user and root
  • Tried installation in /home/ folder and /root/ folder

Ubuntu 18.04

Hi, getting the same error with sqlite and linux.

For me, writing to the db works in the editor on linux, but built games fail with return code 10 when writing to a db.

It also works fine on windows, seems to be linux specific.

Haven’t been able to figure it out so far from debugging a build of the engine, but I’m hoping the fact it works in the editor is a lead.

Ok, it appears when a db needs to become larger it fails due to a ‘cached file’ feature in the engine having different seek behaviour from the normal unix file handling.

A workaround seems to be removing the following code from IPlatformFileCachedWrapper.h

|| NewPosition > FileSize

Also to get debugging working I needed to apply a workaround from 5.3 unable to load plugin in debug