Open gabetoth-alder opened 2 years ago
Update:
I managed to reproduce the crash with a vanilla empty project with just firebase auth added to it and a MonoBehaviour with just the dependency checking
Update:
I ticked Load on startup for the .so files in editor and after that I got some more logs:
Plugins: Couldn't open /home/ec2-user/linuxserver/server_Data/Plugins/FirebaseCppApp-8_9_0.so, error: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /home/ec2-user/linuxserver/server_Data/Plugins/FirebaseCppApp-8_9_0.so)
#0 GetStacktrace(int)
#1 DebugStringToFile(DebugStringToFileData const&)
#2 LoadPluginExecutable(char const*, bool)
#3 FindAndLoadUnityPlugin(char const*, void**, bool)
#4 PluginsInitializePreloadedPlugins()
#5 CallbackArray::Invoke()
#6 PlayerInitEngineNoGraphics(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> > const&)
#7 PlayerMain(int, char**)
#8 __libc_start_main
#9 _start
Plugins: Couldn't open /home/ec2-user/linuxserver/server_Data/Plugins/FirebaseCppAuth.so, error: libc++.so: cannot open shared object file: No such file or directory
#0 GetStacktrace(int)
#1 DebugStringToFile(DebugStringToFileData const&)
#2 LoadPluginExecutable(char const*, bool)
#3 FindAndLoadUnityPlugin(char const*, void**, bool)
#4 PluginsInitializePreloadedPlugins()
#5 CallbackArray::Invoke()
#6 PlayerInitEngineNoGraphics(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> > const&)
#7 PlayerMain(int, char**)
#8 __libc_start_main
#9 _start
/lib64/libm.so.6
exist, but the version is mismatching, AL2 is using 2.26 and some other components have dependencies for it
libc++.so
doesn't even exists anywhere, my guess if I fix the first one it might fix this one to.
We build the server with Target Platform set to linux and Server Build ticked on the Build Settings window in Unity Editor on Windows.
? Are you build the instance on Linux and run it on Windows?Thanks, Shawn
Hey @gabetoth-alder. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
- Did it start to happen after you upgrade or this just happen after you add Firebase into your server project?
- Could you elaborate what you mean by
We build the server with Target Platform set to linux and Server Build ticked on the Build Settings window in Unity Editor on Windows.
? Are you build the instance on Linux and run it on Windows?- Could you detailed the reproduction steps and let us know in which environment that it works and which not?
Thanks, Shawn
I'm also seeing this issue, seems whenever File -> Build Settings is set to Dedicated Server under Platform, the needed files are packaged but can't load when the application tries to run.
I setup an anonymous login project and still see the issue.
Source code (attached to the Light):
// Start is called before the first frame update
void Start()
{
Firebase.Auth.FirebaseAuth auth = Firebase.Auth.FirebaseAuth.DefaultInstance;
auth.SignInAnonymouslyAsync().ContinueWith(task => {
if (task.IsCanceled) {
Debug.LogError("SignInAnonymouslyAsync was canceled.");
return;
}
if (task.IsFaulted) {
Debug.LogError("SignInAnonymouslyAsync encountered an error: " + task.Exception);
return;
}
Firebase.Auth.FirebaseUser newUser = task.Result;
Debug.LogFormat("User signed in successfully: {0} ({1})",
newUser.DisplayName, newUser.UserId);
});
}
Error log when run on Linux Server. Windows server outputs very similar errors:
Begin MonoManager ReloadAssembly
- Completed reload, in 0.085 seconds ERROR: Shader Sprites/Default shader is not supported on this GPU (none of subshaders/fallbacks are suitable) ERROR: Shader Sprites/Mask shader is not supported on this GPU (none of subshaders/fallbacks are suitable) UnloadTime: 0.613160 ms Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/FirebaseCppApp-9_4_0 Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0.so Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0.so Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/FirebaseCppApp-9_4_0 Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0 Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0.so Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0.so Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0 Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/FirebaseCppApp-9_4_0 Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0.so Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0.so Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/FirebaseCppApp-9_4_0 Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0 Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0.so Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0.so Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0 Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/FirebaseCppApp-9_4_0 Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0.so Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0.so Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/FirebaseCppApp-9_4_0 Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0 Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0.so Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0.so Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0 Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/FirebaseCppApp-9_4_0 Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0.so Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0.so Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/FirebaseCppApp-9_4_0 Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0 Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0.so Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0.so Fallback handler could not load library /home/chad/FirebaseTest_Data/MonoBleedingEdge/x86_64/libFirebaseCppApp-9_4_0 DllNotFoundException: FirebaseCppApp-9_4_0 assembly:
type: member:(null) at (wrapper managed-to-native) Firebase.AppUtilPINVOKE+SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_AppUtil(Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate) at Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () [0x000ef] in :0 Rethrow as TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception. at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr) at Firebase.AppUtilPINVOKE..cctor () [0x00000] in :0 Rethrow as TypeInitializationException: The type initializer for 'Firebase.AppUtilPINVOKE' threw an exception. at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00001] in :0 at Firebase.LogUtil..ctor () [0x0000f] in :0 at Firebase.LogUtil..cctor () [0x00011] in :0 Rethrow as TypeInitializationException: The type initializer for 'Firebase.LogUtil' threw an exception. at Firebase.FirebaseApp..cctor () [0x0004b] in :0 Rethrow as TypeInitializationException: The type initializer for 'Firebase.FirebaseApp' threw an exception. at Firebase.Auth.FirebaseAuth.get_DefaultInstance () [0x00001] in <8f5fac01dc2245278fcb9acf081ab3cc>:0 at LightFirebase.Start () [0x00000] in <3bf8aacd454f4e3aaadc3eaa51e662ef>:0
@gabetoth-alder Were you able to find a resolution?
@gabetoth-alder @chkuang-g I don't know why our Windows tests of this same Dedicated Server build were failing, but I found a fix for Linux dedicated servers.
They need sudo apt-get install libsecret-1-dev
to be installed.
After this I was able to proof of concept anonymous authorization followed by reading a Firestore document.
@chadrockey
Were you able to find a resolution?
Not yet. I managed to have my server run firebase-free, since only game logic runs on it, but for later it would be nice to make it work.
I don't know why our Windows tests of this same Dedicated Server build were failing, but I found a fix for Linux dedicated servers. They need
sudo apt-get install libsecret-1-dev
to be installed. After this I was able to proof of concept anonymous authorization followed by reading a Firestore document.
Sounds great! I will test it this week hopefully, I'm working on other things right now!
Hi! Just to say I have the same issue on my side. sudo apt-get install libsecret-1-dev
did not work for me.
I'm running automated tests with GameCI on a GitHub Actions Ubuntu free instance.
@chadrockey
Thank you for finding the solution by running sudo apt-get install libsecret-1-dev
on the dedicated server. Let me talk to the team and see if this is expected on Linux and to update the document.
@gabetoth-alder Please let us know if this solution works for you.
@dev-cmurphy For game.ci related discussion, please use this thread https://github.com/firebase/firebase-unity-sdk/issues/449. Let's separate them until we can verify if they are the same issue. Thank you :)
Hey @gabetoth-alder. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Please do not mark as stale, would really like an official resolution for running with dedicated server builds
Hey @gabetoth-alder. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Sorry for my late update, I got the following results:
For AWS GameLift we have an install.sh script:
sudo yum -y update
sudo yum -y install libsecret-1-dev
The update
runs as expected, but the install libsecret-1-dev
fails:
No package libsecret-1-dev available.
Error: Nothing to do
I had my servers working on ubuntu instances without any problem, but GameLift uses 'AMAZON_LINUX_2' inhouse OS.
Is this a case of the libsecret package having a different name on different OS? I found this page which suggests that libsecret-devel is available on Amazon Linux 2 http://213.146.141.13/package/details/OracleLinux7/x86_64/x86-64/libsecret/0.18.6
Hey @gabetoth-alder. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Is this a case of the libsecret package having a different name on different OS? I found this page which suggests that libsecret-devel is available on Amazon Linux 2 http://213.146.141.13/package/details/OracleLinux7/x86_64/x86-64/libsecret/0.18.6
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
libsecret-devel x86_64 0.18.5-2.amzn2.0.2 amzn2-core 93 k
Installing for dependencies:
glib2-devel x86_64 2.56.1-9.amzn2.0.2 amzn2-core 453 k
libsecret x86_64 0.18.5-2.amzn2.0.2 amzn2-core 153 k
pcre-devel x86_64 8.32-17.amzn2.0.2 amzn2-core 480 k
Transaction Summary
================================================================================
Install 1 Package (+3 Dependent packages)
Total download size: 1.2 M
Installed size: 6.0 M
Downloading packages:
--------------------------------------------------------------------------------
Total 4.9 MB/s | 1.2 MB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : pcre-devel-8.32-17.amzn2.0.2.x86_64 1/4
Installing : glib2-devel-2.56.1-9.amzn2.0.2.x86_64 2/4
Installing : libsecret-0.18.5-2.amzn2.0.2.x86_64 3/4
Installing : libsecret-devel-0.18.5-2.amzn2.0.2.x86_64 4/4
Verifying : libsecret-0.18.5-2.amzn2.0.2.x86_64 1/4
Verifying : libsecret-devel-0.18.5-2.amzn2.0.2.x86_64 2/4
Verifying : pcre-devel-8.32-17.amzn2.0.2.x86_64 3/4
Verifying : glib2-devel-2.56.1-9.amzn2.0.2.x86_64 4/4
Installed:
libsecret-devel.x86_64 0:0.18.5-2.amzn2.0.2
Dependency Installed:
glib2-devel.x86_64 0:2.56.1-9.amzn2.0.2 libsecret.x86_64 0:0.18.5-2.amzn2.0.2
pcre-devel.x86_64 0:8.32-17.amzn2.0.2
Complete!
I confirm that I was able to install the package, I will check the server logs later, I my server crashed for another unrelated issue
Edit: It didn't work, server log:
Mono path[0] = '/local/game/server_Data/Managed'
Mono config path = '/local/game/server_Data/MonoBleedingEdge/etc'
Unable to preload the following plugins:
FirebaseCppAnalytics.so
FirebaseCppApp-9_4_0.so
FirebaseCppAuth.so
FirebaseCppDatabase.so
FirebaseCppDynamicLinks.so
FirebaseCppMessaging.so
libsqlite3.so
Hi all,
Just for clarity the Firebase Unity SDK doesn't officially support server builds. We don't build and test this scenario either, so we don't have a full working knowledge of the trails you're blazing. Please upvote this issue so that we can prioritize it on our roadmap.
The more information that you can provide to use the better as maybe something will jump out at us as something that we've encountered in other tested scenarios.
Unless I'm wrong this seems to be a missing dependency issue attempting to resolve libraries on various flavors of Linux. Potentially the Amazon versions of libsecret are incompatible with the ones that the Firebase SDK requires, and though the Firebase .so files are found they can't be loaded in conjunction with the platform's libraries.
We mainly test against Ubuntu and I believe that Amazon Linux is either CentOS or Fedora, depending on which version of Amazon Linux you're using. There could be a mismatch there?
@gabetoth-alder, in your latest attempt was there any output beyond Unable to preload the following plugins:
? Is there more debug information that can be enabled?
Thanks!
Just for clarity the Firebase Unity SDK doesn't officially support server builds. We don't build and test this scenario either, so we don't have a full working knowledge of the trails you're blazing. Please upvote this issue so that we can prioritize it on our roadmap.
Yes it would be great, it can have a lot of benefits.
Unless I'm wrong this seems to be a missing dependency issue attempting to resolve libraries on various flavors of Linux. Potentially the Amazon versions of libsecret are incompatible with the ones that the Firebase SDK requires, and though the Firebase .so files are found they can't be loaded in conjunction with the platform's libraries.
We mainly test against Ubuntu and I believe that Amazon Linux is either CentOS or Fedora, depending on which version of Amazon Linux you're using. There could be a mismatch there?
Probably there is something missing in the Amazon Linux.
@gabetoth-alder, in your latest attempt was there any output beyond
Unable to preload the following plugins:
? Is there more debug information that can be enabled?
I cannot add anything else at this point, my server is built to work without firebase (I moved stuff needed to the client, which is is... ok for the current project, but creates limits), so it doesn't crash or produce any more issues. Before that it crashed at the dependency check.
Ok, I'm going to rework this ticket as a feature request for server builds, and keep the ticket open so we can prioritize it properly.
Please upvote this issue if you're looking to use server builds with our SDK. Thanks!
Any updates on this? I am running into this issue with servers running on Unitys Multiplay.
Having the same issue with Unity Multiplay.
Any updates on this? I am running into this issue with servers running on Unitys Multiplay.
Have you found a solution?
After some research, I found a workaround that works for Ubuntu Server 23.10, which may work for other Linux systems.
Firebase .so files is compiled code, and it expects to see some authentication package, this may change depending on what you build for, but the expected package is for desktop editions with a screen, so it's not preinstalled, once installed, they load, but you get an error usually with a log from libsecret (or you dont but Firebase has an exception still), but the error's root cause is dbus (Linux's graphics package) which isn't logged, you can view the error by running: dbus-run-session -- ./<ServerBuildNameHere>
you can also see what it wants by navigating to your server build folder/
libsecret-1-0 is one of Linux's authentication package, however for different systems, there may different packages for libsecret available, the one that works with me is libsecret-1-0 and I do have libsecret-1-dev, but it's not there for dev-cmurphy's system (or maybe they haven't updated their package manager yet), systems using Amazon AWS may want libsecret-devel, to see all the available versions in your system, enter apt install libsecret-*
, then see the packages listed with a prefix of 'libsecret-' and enter n to not install these packages if you don't want them.
sudo apt update -y;
sudo apt install dbus dbus-x11 gnome-keyring libsecret-* -y;
sudo mkdir -p ~/.cache;
sudo mkdir -p ~/.local/share/keyrings;
sudo export $(dbus-launch);
sudo eval "$(printf '\n' | gnome-keyring-daemon --unlock)";
sudo eval "$(printf '\n' | /usr/bin/gnome-keyring-daemon --start)";
sudo dbus-update-activation-environment --all;
sudo apt remove dbus dbus-x11 gnome-keyring libsecret-* -y;
sudo apt install libsecret-1-0 -y;
sudo reboot
if your in a Linux system that uses gnome, note that it's changing the service for user passwords, if there are non-root users in your system, do it in a different environment and see if theres any security issues. It also leaves some unused packages, use apt autoremove
to remove them. If your using docker, note that gnome keyring requires root access to the host machine, for security reasons, I recomend running docker run --privileged <your params and image>
and do these commands then save the image while the container is running with docker commit <ContainerIdOrName> <NewImageName>
, and run the new saved image instead, you can view all images with docker images -a, it should run without --privileged afterwards. Also note that docker forces --privileged to be off next time the container is started, so if you reboot it, it doesn't have root access.
Try running the server build with root as a test, if it works then it's a permissions issue. Root isn't affected by deny permissions.
If you have xinitrc, it's been reported to cause some issues with dbus which is used by libsecret, there may be issues with other packages, try troubleshooting with minimal packages to avoid other error factors temporarily, then test it in your system.
If you get an error about a version of libstdc++ not being installed, update your system or downgrade your Firebase version, libstdc++ is the c++ compiler, which is what compiled Firebase .so files, if they were compiled with a version higher than your version of your c++ compiler, you get the error, but it's not a simple apt install, many critical system packages are compiled with .so, so it doesn't update it, and if you remove then try installing it, your system won't boot nor will it update it.
Also note that Firebase sometimes gives their own exception if you do too many failed attempts, it will clearly say it in the logs though as a System.Exception.
If this doesn't work, you can wait for Firebase to support it or troubleshoot it with the information mentioned, I think there's only 2 steps:
This is rough but it's something to go off of for others, and possibly help making support for Unity server builds, hope this helps!
Just for clarity the Firebase Unity SDK doesn't officially support server builds. We don't build and test this scenario either, so we don't have a full working knowledge of the trails you're blazing. Please upvote this issue so that we can prioritize it on our roadmap.
+1000 for this. Clients should never touch the database, or even know anything about it, or where it is, or what it is. Game server must have full access, everything client wants / needs flows through game server (plus maybe a separate web service for account creation / auth before connecting to game server). No Firebase libs should be in the client builds.
No idea why you wouldn't have started from that perspective.
Jumping in here to reup and reaffirm support for this request! Our dedicated servers should absolutely be in control of the data writing, and not entrusting that to clients.
This issue is coming up on google searches so I want to add a few thoughts here. When building images from Unity's unitymultiplay/linux-base-image
, the firebase libraries do not load correctly (starting with 12.x AFAIK), spitting errors like this
2025-01-14 16:30:23 DllNotFoundException: FirebaseCppApp-12_5_0 assembly:<unknown assembly> type:<unknown type> member:(null)
Upon inspection with ldd
, you will see mismatching glibc
version errors like these
/game/duelo-server-0.0.0_Data/Plugins/FirebaseCppApp-12_5_0.so: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.34' not found (required by /game/duelo-server-0.0.0_Data/Plugins/FirebaseCppApp-12_5_0.so)
/game/duelo-server-0.0.0_Data/Plugins/FirebaseCppApp-12_5_0.so: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32' not found (required by /game/duelo-server-0.0.0_Data/Plugins/FirebaseCppApp-12_5_0.so)
...
The fix is to use a different base image and configure it according to their documentation (unless you prefer to suffer upgrading all the packages in your dockerfile).
@MrGadget1024 sorry to ping on an old issue, but it has been a long standing feature of firebase database that it was perfectly acceptable to accept client writes, provided that your database rules are setup correctly. In fact, one of the great features of firebase is this very nature, which I have used in serverless apps many times. This is my first time using it in Unity though, is there something else I should be considering?
Our mobile project has a multiplayer server which will run on linux. We build the server with Target Platform set to linux and Server Build ticked on the Build Settings window in Unity Editor on Windows.
When the server starts the attached log message is seen. server_crash.txt This part at the end hints that the libs aren't loaded:
Details: