UnrealGameSync Metadata Server Issue

It creates itself. But per the original question of this page, it crashes when it tries to do that (at least in my environment). So that’s why my answer shows the code changes I made.

I see, that makes sense. It looks like that code is fixed on the newest version of UGS. Okay, well thank you for your help. I should be able to get this setup on the remote server now I think

I got it working finally. If anyone else is having issues on the remote server with it not creating the database file, check permissions! Not just on the folder that has the stuff in it. I had to set permissions all the way up to C:\inetpub to make it work

Glad I could help. I spent a lot of time figuring it out so I’m glad someone else can take advantage of it.

Any updates on this wiki page? :))

Any update on the wikis? I’m struggling to get this setup, and all I have to go off of is https://github.com/codewaregames/UnrealGameSync/wiki/MetadataServer
and
https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/DeployingTheEngine/UnrealGameSync/Reference/
P.S. I don’t know why I can’t issue the http://hostname:portnumber/api/latest?GET url request :tired_face:

I was finally able to get this working, on the machine that I deployed to my connectionString was “127.0.0.1” and it ended up working. This is because my server was LOCAL to that machine it was hosted on, IIS handled the rest for the company.

Hey, I know it’s been years since you worked on this… But I’ve spent days stuck unable to get this working locally… Any chance you remember what was wrong about your permissions and/or connection string?

Ok, I have a new important step. I had to use MySQL 8.0.28, newer versions generate the database with a different charset (https://community.powerbi.com/t5/Desktop/Refresh-data-error-Character-set-utf8mb3-is-not-supported-by-Net/td-p/2298674) and metadata server silently gives exception and give 404 when opening api/latest. I had to run metadata server from VS and enable exceptions to catch all the database related issues (Debug ASP.NET Exceptions - Visual Studio (Windows) | Microsoft Learn). It was difficult to identify the issue as ugs_db and all the tables were actually created successfully just that API was giving 404.

Additionaly you always must do the “Disabling ONLY_FULL_GROUP_BY” step from UGS Reference | Unreal Engine 4.27 Documentation
and write the change to the MySQL config file.

Also, these IIS App Pool permission users are not listed in any user lists, not even if you use advanced user search. You really need to type it manually using the whole path, including the slash.

After these steps, I was finally able to start the metadata server successfully. Best way to track you progress is to first don’t do anything with IIS. Start the Metadata Server directly from visual studio and test & troubleshoot it there until you can get the /api/latest working. The correct format is just domain:port/api/latest. Just then move everything to IIS and continue there.

I had also various other issues but these were resolved by installing missing visual studio ASP web tools, reparing visual studio (!) as apparently it did not install all of them for whatever reason, install IIS from windows get features (but just clicking the upper level checkbox is not enough, you need also a bit more stuff from deeper levels which are unchecked by default).

I used the default metadata server from Epic’s engine source.

Indeed, the different charset is still present in MySQL 8.0.33.

However, even with mysql-connector-net-8.0.33.1 and ONLY_FULL_GROUP_BY disabled, I am still facing error 404 when trying to open api/latest. I am able to access the MYSQL database directly using the same username and password provided in the Web.config file, and I have granted the user the correct permissions under MySQL workbench (directly linked to the ugs_db schema) and IIS Application Pool.

It has been a few days since I started investigating this issue, which occurred after upgrading MySQL from version 8.0.22 to 8.0.33, causing the entire Metadata Server to go down. If you have any additional tips for debugging the issue, please feel free to share them.

I’ve just finished setting this up (and struggling) with UE5.

Environment:

  • //UE5/Release-5.2 @25384739
  • Microsoft Visual Studio Professional 2022 (64-bit) - Current Version 17.3.5
  • Database server:
    ** Microsoft Windows Server 2022 Standard (10.0.17763 Build 17763)
    ** MySQL Community Server - GPL (8.0.16)
  • Web server:
    ** Microsoft Windows Server 2022 Standard - 10.0.20348 Build 20348
    ** IIS 10.0.20348.1

These are the main gotchas I ran into:

  1. The MySQL version should match the version of the MySql.Data DLL exactly.

  2. The Unreal docs say ‘if you enable the ONLY_FULL_GROUP_BY function, you may run into errors while running the MySQL script’, but I ran into these issues with a fresh MySQL installation. So, best to run the provided command anyway.

  3. In the Unreal docs, there is a typo in the MySQL command: ‘SELECT_REPLACE’ should be ‘SELECT REPLACE’.

  4. This command needs to be run in the MySQL Client, not as a query in Workbench.

  5. The MySQL service account requires sufficient access rights (just give it the Database Admin role to begin with and replace with specific schema rights once the database has been created - I checked SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, REFERENCES, INDEX, CREATE VIEW, and everything seems to be working still).

  6. .NET Extensibility 4.8 and ASP.NET 4.8 should be installed via Add Roles & Features (installing them manually does not appear to work).

  7. The application pool requires sufficient permissions (see Cobryis’s reply for more details).

  8. NotForLicensees\Web.config should be excluded from the .csproj (just right-click and remove in VS)

  9. In Web.Release.config and Web.Debug.config, the connection string is in SQL Server format. Make sure you replace the entire connection string with a MySQL format string (as provided in the docs) (assuming you’re using MySQL).

  10. The name of the connection string element is ‘MyDB’, when it should be ‘ConnectionString’. This appears to be a bug.

  11. When publishing, the user name should be fully qualified with the domain name i.e. <domain_name>\<user_name>

  12. Validating the connection will fail during the publishing configuration setup, due to an empty destination URL, but will succeed once setup has completed. So create the publishing profile first, then edit the settings, and validate the connection.

  13. If using Failed Request Tracing (to debug a 404), this needs to be installed via Add Roles & Features, and enabled on both the site and the server (this didn’t actually help me that much - the more specific error was just “The system cannot find the path specified” - and the issue was actually a missing asp.net dependency).

Hopefully, someone finds this useful and doesn’t have to suffer the same pain I went through.

Apologies for ressurecting this once again.
I have gone through this step list (good job setting it up) but I still am having issues.
It runs from visual studio, but not from the IIS directly (still on the 404 when doing host/api/latest)

So am trying to find how you guys debugged this (I did set the Failed Request Tracing, but that doesn’t seem to help much)

Question, where are you setting ApiUrl?
I am setting it directly on DeploymentSettings.cs

Side note, I can’t make the Direct Web Publish work, I am using Web Deploy Package instead.

Ok. It is working :smiley:
This was definitley hard, documentation is almost not existing. Best one is code and this post, so I thank everyone here.

Btw, my final issues were
1- Metadata service was failing to connect
2- I couldn’t access the website from outside (IIS is so hard to use)
3- Even after that, UGS was not sending information over.

1- One was me being a dumb dumb. I had change Web.Debug.Config but not Web.Release.Config (even though I published a release version) so that was easy

So for problem number, I am not sure what fixed in the end.
But I had to do a couple of things.
2.1 - Set bindings like this
image
2.2 - My MetadaService is running on a IIS instance on a AWS Server (Windows Server)
So I also had to add these roles on the sever admin
image
After that I was able to access the website from outside

3- I was getting a json exception in UGS. So I started it from Visual studio in Debug.
Unfortunatelly, the exception was external and not triggering, even though I had external exceptions set to stop execution
But while looking at the code, I found out that when we were posting any event/comment

So my ApiUrl had api/latest in it, that it shouldn’t.
it should be just the website name [Preformatted text](http://www.yourhost.com)

And now things seem to be working

Glad to see you got this sorted! I’m done with IIS XD.

Sry to resurrect this, but I am having issues I am just unable to wrap my head around.

I am 90% sure I have the IIS on my server setup right, same with the MySQL server stuff. (This thread helped TONS, thanks to both you folks!).

I setup VS2022 and pulled down Engine v5.3.2, and ran locally using the IP in the connection string. I looked at the output and just happened to see this:

iisexpress.exe Error: 0 : Authentication to host ‘’ for user ‘’ using method ‘mysql_native_password’ failed with message: Access denied for user ‘’@‘we-ugs-metadata.-Redacted-.xx.internal.cloudapp.’ (using password: NO)
Exception thrown: ‘MySql.Data.MySqlClient.MySqlException’ in MySql.Data.dll

It didn’t actually throw the exception during debug (annoying). Whats confusing is it doesn’t have the user name and PW. I had to put these in the Web.Template.config as well as in the Web.Release.config and the Debug; It would error out with “Connection string cannot be empty”. doing this will give a 4.3 error when visiting the site, and the SQL database at the site location does not appear. looking in SQL Workbench, there is a ugs_db created, but that might have been from a previous attempt. ( I have been beating my head against this for over a week).

If anyone can expand this into a “Complete idiot’s Guide to UGS Metadata Server Setup” that would help… I am really out of my depth here… Thanks in Advance!

Does ANYONE have ANY idea?

So, after some poking, I was able to get a different error;
The Web.Release.config, and Web.Debug.config are similar to this:

I then put the connection string in the Web.Template.config (This was the only way the user name and PW made it to the web.config)

When running in debug, these errors I see in the output:

Exception thrown: 'System.NotSupportedException' in MySql.Data.dll
Exception thrown: 'System.NotSupportedException' in MySql.Data.dll
Exception thrown: 'System.Collections.Generic.KeyNotFoundException' in mscorlib.dll