-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Firestore does not allow two instances of project to run at the same time on the same computer #885
Comments
Hi @Olof-IL, Thanks for bringing this to our attention. This behavior you're facing may be similar to this issue in the quickstart repository. In order to confirm this, could you try disabling persistence as a workaround and see if it makes a difference? To do so, you simply declare the following:
|
I can confirm setting this option stops unity from crashing, and enables us to run two instances. It should be an acceptable workaround for our case, thanks! |
Glad to hear this, @Olof-IL. That said, I'll be closing this for now. Let me know if an issue arises. |
Drive-by comment: If you want to use persistence in your production app but don't care about persistence during development, you can put db = FirebaseFirestore.DefaultInstance;
#if UNITY_EDITOR
db.Settings.PersistenceEnabled = false;
#endif |
[REQUIRED] Please fill in the following fields:
[REQUIRED] Please describe the issue here:
It seems it is impossible to run two instances of the same Unity project that use Firestore, on the same computer
Being able to do this is vital for us for developing and debugging multiplayer.
The problem is both instances try to create local database files at the same location.
The path the files are created at is this:
/Users/[user]/Library/Application Support/firestore/__FIRAPP_DEFAULT/[firebase-project-id]/main/LOCK
Since this file is already created by the first instance, the second instance crashes (and crash entire Unity Editor with it)
It would be much better if these files were created in [Unity-Project-Folder]/Temp instead, then it should work fine to run multiple instances of the project
Steps to reproduce:
Create a simple Unity App using Firebase Unity SDK, using Firestore.
Install ParrelSync in project for easily running multiple copies of the project, or simply copy it to a second folder/check out a second copy.
Try start both at the same time.
Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)?
Haven't tried but it should have the same issue if it uses Firestore
What's the issue repro rate? (eg 100%, 1/5 etc)
100%
What happened? How can we make the problem occur?
This could be a description, log/console output, etc.
When launching player in the second editor instance, Unity crashes. This can be found in log:
libc abi: terminating with uncaught exception of type firebase::firestore::FirestoreInternalError: FIRESTORE INTERNAL ASSERTION FAILED: /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/macos_unity/arm64/bin/external/src/firestore/Firestore/core/src/core/firestore_client.cc(217) void firebase::firestore::core::FirestoreClient::Initialize(const firebase::firestore::credentials::User &, const firebase::firestore::api::Settings &): Failed to open DB: Internal: Failed to open LevelDB database at /Users/olle/Library/Application Support/firestore/__FIRAPP_DEFAULT/touchgrind-x-test/main: LevelDB error: IO error: lock '/Users/olle/Library/Application Support/firestore/__FIRAPP_DEFAULT/touchgrind-x-test/main/LOCK: Resource temporarily unavailable (expected created.ok())
ERROR: FIRESTORE INTERNAL ASSERTION FAILED: /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/macos_unity/arm64/bin/external/src/firestore/Firestore/core/src/core/firestore_client.cc(217) void firebase::firestore::core::FirestoreClient::Initialize(const firebase::firestore::credentials::User &, const firebase::firestore::api::Settings &): Failed to open DB: Internal:
Failed to open LevelDB database at /Users/olle/Library/Application Support/firestore/__FIRAPP_DEFAULT/touchgrind-x-test/main: LevelDB error: IO error: lock /Users/olle/Library/Application Support/firestore/__FIRAPP_DEFAULT/touchgrind-x-test/main/LOCK: Resource temporarily unavailable (expected created.ok())
The text was updated successfully, but these errors were encountered: