Closed shehzan10 closed 3 years ago
terminating with uncaught exception of type std::runtime_error: unable to open database file
This sounds like #245. If it is, there's no further action for this issue, right?
This sounds like #245. If it is, there's no further action for this issue, right?
Not entirely sure as I was running a single process. Its possible that it could be solved by the same changes, but the occurrence is different.
You were presumably running the Editor, and then launched the packaged version of the game, right? So that is two instances. If you closed the editor first, then it's not #245 and there's apparently some other issue.
@kring I ran it again, this time making sure not to run editor. It still fails to run. But now it errors with terminating with uncaught exception of type std::runtime_error: disk I/O error
Is this WSL? If so, is it stored in the true Linux file system, or is it at /mnt/c or somesuch?
@kring - No, running fully native hardware and OS.
Thanks for answering all my silly questions, @shehzan10. :)
So I tried it myself, and it worked fine, no DB locking error. I did a couple of small things differently from your instructions:
CesiumForUnreal/Source/CesiumRuntime/CesiumRuntime.Build.cs
. It didn't seem to be necessary.I did the package from a Windows machine, and then copied it to a local path on my Linux machine (Ubuntu 20.10). And when I ran either the executable or the .sh file in the root directory, it started up just fine.
On my system, the cache sqlite file is stored at ~/.config/Epic/UnrealEngine/4.26/cesium-request-cache.sqlite
. Is there anything unusual about the file system on your system at that location? The sqlite DB is using WAL mode, so network shares and unusual file systems might not work properly.
The Development build works fine too, same as Shipping.
- I didn't edit
CesiumForUnreal/Source/CesiumRuntime/CesiumRuntime.Build.cs
. It didn't seem to be necessary.
Oh interesting, cross compilation definitely went into Unknown
for me (confirmed by looking in the log).
I did try both development and shipping builds and those ran into errors.
On my system, the cache sqlite file is stored at
~/.config/Epic/UnrealEngine/4.26/cesium-request-cache.sqlite
. Is there anything unusual about the file system on your system at that location? The sqlite DB is using WAL mode, so network shares and unusual file systems might not work properly.
Nothing unusual - using local disk etc. I'll confirm the location of the Sqlite Cache file later today. I might just delete it and start clean.
I also ran into the issue:
terminate called after throwing an instance of 'std::runtime_error'
what(): unable to open database file
Packaged under Ubuntu 20.04.
This is a custom project which works fine in the editor. Packaging works as well, but when I start the packaged project I get the above error.
(Note: I am not cross-compiling but have a 100% linux setup)
@petergerten we've seen that issue when running a packaged build and the editor simultaneously, because both try to write to the Cesium for Unreal tile cache and one of them fails. When the shipping build fails, it causes an immediate program termination because exceptions are disabled in shipping builds. See #245.
@kring I am running this in a dedicated docker container (https://github.com/adamrehn/ue4-docker) - there is no Editor (or other instance) running in parallel.
What would be the default path of the tile cache?
In Cesium3DTileset.cpp I can see that the path seems to be constructed by:
FString baseDirectory = FPaths::EngineUserDir();
FString filename = FPaths::Combine(baseDirectory, TEXT("cesium-request-cache.sqlite"));
Is that the tile cache?
I can't find where the particular error message unable to open database file
comes from though.
Yes, that's the tile cache. The error probably comes from SQLite itself, via this line: https://github.com/CesiumGS/cesium-native/blob/4267f658ae4b9bf64e099f028380ad8e6f35d1b8/CesiumAsync/src/SqliteCache.cpp#L119
FYI, currently there is a work-on-progress change on SqliteCache class to drop all exceptions via SqliteCache::create() static method. It will fallback to UnrealAssetAccessor if no database is connected
@kring I don't know how this works - where would EgnineUserDir() point to in a a packaged project? I don't have any .sqlite file with my packaged project. But I guess the tile cache would have to start from scratch anyway and create the file?
On my Linux system it ends up being ~/.config/Epic/UnrealEngine/4.26/cesium-request-cache.sqlite
. And yes, it will be created from scratch the first time it's opened.
While I do have a ~/.config
directory, I don't have a ~/.config/Epic
dir.
This is how I build and package the project, if that makes any difference:
/home/ue4/UnrealEngine/Engine/Build/BatchFiles/Linux/GenerateProjectFiles.sh -project="/home/ue4/project/CesiumTest/CesiumTest.uproject" -game -engine
/home/ue4/UnrealEngine/Engine/Build/BatchFiles/RunUAT.sh BuildCookRun -project="/home/ue4/project/CesiumTest/CesiumTest.uproject" --no-sandbox -platform=Linux -clientconfig=Development -cook -allmaps -build -stage -pak -archive -archivedirectory="/home/ue4/out"
As I don't seem to have cesium-request-cache.sqlite
anywhere, I assume the error can also happen when there is no permission to create it?
Answering my own question: for me it indeed turned out to be a permission issue! The original error disappeared :-) Thanks for the pointers!
This seems to be working well and there is nothing additional to do here.
Copied from https://github.com/CesiumGS/cesium-unreal/pull/377#issuecomment-827294409 and https://github.com/CesiumGS/cesium-unreal/pull/377#issuecomment-827298083
Steps for Linux Cross Compilation of Cesium for Unreal Samples from Windows
4.26 | -v17 clang-10.0.1-based
toolchain from https://docs.unrealengine.com/en-US/SharingAndReleasing/Linux/GettingStarted/index.html%LINUX_MULTIARCH_ROOT%x86_64-unknown-linux-gnu\bin\clang++ -v
. Match the output to https://docs.unrealengine.com/en-US/SharingAndReleasing/Linux/GettingStarted/#troubleshooting.CesiumForUnreal/Source/CesiumRuntime/CesiumRuntime.Build.cs
and change theUnknown
target variables for libraries to match theLinux
target.Linux
target.File -> Package Project -> Linux -> Linux
.chmod +x CesiumForUnrealSamples/LinuxNoEditor/CesiumForUnrealSamples.sh
.CesiumForUnrealSamples/LinuxNoEditor/CesiumForUnrealSamples.sh
Fixes Required
This is however running into errors as described below. Even though Linux exe builds, it doesn't run because I think we're hardcoding/ using environment variables in some places which is causing errors like
I assume this has to do with our cache database, but not sure cuz I didn't dig. In any case, I think we can deal with this separately.
Full log (shipping build):
Full Log (development build):