-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
fix #9983 MigrateNetworkConfiguration error #9987
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember why I wrote the conditions for the prestartup migration stuff, but I don't think this PR is the proper fix. Isn't the issue that "network.xml" doesn't exist? There should be a File.Exists
check added to the network migration.
For me, comparing a backup version of |
So it looks like that there is more than one situation to look at? The issue that I was addressing is the steps of installing a fresh Jellyfin server, where no This differs of course from when performing an update where this directory already exists. For a fresh install the config files are created with default values from scratch, so no 'migration' in a strict sense. While in the latter case config files do exist, and need be migrated. The problem I ran into is that the first run of Jellyfin server, including the installation wizard execution, seems to work fine. The second run however aborted at this line:
This showed up in the jellyfin server log of the second run as: See the Jellyfin log in #9983 as well. Analysis Although the problem happens during the second run, the cause of the problem is before that. The problem indicates issues with the (prestartup) migration, which of course should have been performed during the initial run in the first place. So I started debugging the first run. I discoverd that the prestartup expects 3 migrations:
They all have the
As this holds for all prestartup migration routines, the loop
never reaches the statement
that writes the performed migrations to the migrations.xml file. So these 3 migration routines are not logged in that file.
Note: even though those migrations where shown in the jellyfin log as being marked: This causes no further problems during the first run of Jellyfin server. When starting it for the second time however, these 3 prestartup migration routines are not marked as
but that only happens during the first run when isStartWizardCompleted==false .
So the migration routines are not trapped by the
and are executed while there is nothing to migrate. Which causes Jellyfin server to abort the second run, I presume. fix
by means of: saveConfiguration(migrationOptions);
In some cases this might be redundant, but on the other hand, it does not seem to hurt either. A second adaption is needed for the
The condition
with migrationOptions containing the 3 prestartup migration routines, so migrationOptions.Applied.Count==3 . So there is work to do for HandleStartupWizardCondition and it should not just return with above if statement.
The reason for condition Notes
And tracked by
|
I'd expect setting |
By the way, as you were probably hinting at, there might be another issue, with jellyfin/Jellyfin.Server/Migrations/PreStartupRoutines/MigrateNetworkConfiguration.cs Line 12 in 1ea8150
Running an already installed Jellyfin server (so with existing configuration files; not a first run of a fresh install) after manually removing the entry of this migration routine from To me this is a different issue as I was specifically looking at a fresh install. But I can register it as a separate issue, and look into it. |
The 3 prestartup migration routines do have |
To further explain:
|
This PR now also includes a fix for MigrateNetworkConfiguration.cs. Two issues are addressed:
|
I ran this PR trying to get past this issue. While this does prevent the crash on 2nd run, the network.xml is never created even with no/empty data directory. I do not know if it is related, but a few of the ip bindings were failing, related to network discovery. |
@Xabis : thank you for your comment. Did you complete fresh installation with the initial setup wizard? The fresh installation begins with starting the Jellyfin server, and then continues by completing the setup wizard in the web client. The network.xml configuration file indeed is not created during the step of starting the Jellyfin server. It is only created after completing the setup wizard and entering the appropriate values where asked for. At least in my case, the resulting network.xml looks ok to me. This procedure did make sense to me. The problem I was addressing occurred in the first step, starting the Jellyfin server and is related to migrating functionality, and not to setup functionality, and I can imagine that the migration functions defer installation issues (like creation of the network.xml file) to the startup wizard. I was a little wary of changing the procedure in this respect, so my fix aimed at a flaw related to the migration.xml file. And in my case, the fix works as expected. Anyway, I am not sure if your issue is directly related to what I ran into, but if you can elaborate on what exactly your findings are I can of course try to find an answer for that as well. Preferably by first finalizing the present PR and opening a new issue and PR, not to mix up basically different problems. |
@Sky-High, I can confirm the file gets written post initial setup; thanks for clarifying the creation path. I am attempting to run the server in debug mode, directly inside visual studio, and have been running into issues. One of them being the first time setup not working properly, due to socket failures in the SSDP network discovery functionality. Apologies for the churn. |
fix #9983: [Issue]: Starting freshly installed Jellyfin server for the second time fails with MigrateNetworkConfiguration error
Changes
migration.xml now is written also when migrations are skipped during a fresh install of Jellyfin server
Issues
fixes #9983