jellyfin / jellyfin-server-macos

The menu bar app and package for Jellyfin Server on macOS.
https://jellyfin.org
Mozilla Public License 2.0
58 stars 15 forks source link

Unable to properly migrate old directories after updating to 10.9.0 #71

Closed genericbar closed 1 month ago

genericbar commented 1 month ago

Hi, I'm no longer able to run the server after updating from 10.8.3 to 10.9.0 on macOS Sonoma 14.4.1, and I get the following error:

Jellyfin Server was unable to properly migrate old directories.

The app remains open in the menu bar while the error pop up window is still open, so it is still possible to launch the Web UI from here but no server is detected. Closing this window will immediately close the app.

I am now blocked and unable to either downgrade to the previous version or use the current latest.

sejmann commented 1 month ago

Here's my original post from issue #72, which I closed as dupe:

After installing the arm64 10.9.0 app from the dmg on my macOS 10.14.1 m1 Mac (that previously had an x86 installs of 10.8.13 Jellyfin and dotnet,) launching the new 10.9.0 Jellyfin app produces a dialog saying "Jellyfin Server was unable to properly migrate old directories" with only an exit button.

No new logs were added (edit: this is false -- a log file was written to ~/Library/Application Support/jellyfin/log, instead of the ~/.local/share/jellyfin/log location I'd initially sought.) , and no apparent migration of database occurred, as I was able to successfully downgrade back to 10.8.13 with no issue. (Edit: This may also have been false.)

Hm. It looks like 10.9.0 AppDelegate.swift createAppFolder attempts to move ~/.local/share/jellyfin subfolders to ~/Library/Application Support/jellyfin. I guess that failed in my case for some reason. Because there are three try statements in the catch block, I can't tell which failed.

Although, I do see the below in Application Support:

.
├── cache
├── config
│   ├── encoding.xml
│   ├── logging.default.json
│   ├── migrations.xml
│   └── system.xml
├── data
│   ├── ScheduledTasks
│   │   ├── 3a025083-141d-3c17-dd96-d5f9b951287b.js
│   │   └── f9b057c0-54e9-e6da-ee4a-88ffd146a403.js
│   ├── device.txt
│   ├── jellyfin.db
│   ├── library.db
│   └── playlists
├── log
│   └── log_20240511.log
├── metadata
├── plugins
│   └── configurations
│       ├── Jellyfin.Plugin.MusicBrainz.xml
│       └── Jellyfin.Plugin.Tmdb.xml
└── root
    └── default

12 directories, 12 files

Which is quite an incomplete copy of what's in ~/.local/share/jellyfin, it seems.

I guess I could rsync, and rename or remove the source directory, and 10.9.0 app should probably launch, or nuke the destination and let it copy over from scratch, and it should also work?

Oh, interesting -- ~/Library/Application Support/jellyfin folder was pre-existing, judging by the modify date of the .DS_store within it, at least since Mar 4 2023 in my case. (Edit, oh, I can't know that, that .DS_store may also have been copied from ~/.local...) Maybe it didn't want to overwrite? Although, files in that folder had recent modified timestamps, so it must have written something. Ah, yes, there is the log file I didn't realize was written. There are no errors in the log, other than not finding /webroot for static files, and quizzically reporting this a fresh install.

Well, I think I now know enough to manually fix the issue on my machine, but I don't know why the swift move failed. Let me know if I can provide more info.

Update 2: I cobbled together the below swift test script:

#!/usr/bin/swift
import Foundation

let localShareJellyfinFolder: URL = FileManager.default.homeDirectoryForCurrentUser
    .appendingPathComponent(".local/share/jellyfin")

let applicationSupportJellyfinFolder: URL = FileManager.default.homeDirectoryForCurrentUser
    .appendingPathComponent("/Library/Application Support/jellyfin")

func directoryExists(path: String) -> Bool {
    var isDirectory: ObjCBool = false
    return FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory)
}

// Old contents were stored in ~/.local/share
// Move to ~/Library/Application Support/Jellyfin
if directoryExists(path: localShareJellyfinFolder.path) {
    do {
        let contents = try FileManager.default.contentsOfDirectory(
            atPath: localShareJellyfinFolder.path)
        print("got contents")

        for contentName in contents {
            let oldPath = localShareJellyfinFolder.appendingPathComponent(contentName)
            let newPath = applicationSupportJellyfinFolder.appendingPathComponent(contentName)
            try FileManager.default.moveItem(
                atPath: oldPath.path,
                toPath: newPath.path
            )
            print("moved \(oldPath.path) to \(newPath.path)")
        }

        try FileManager.default.removeItem(atPath: localShareJellyfinFolder.path)
        print("removed directory")
    } catch {
        print("Jellyfin Server was unable to properly migrate old directories.")
        print("Error info: \(error)")
    }
}

and it's output was:

~$ ./test.swift
got contents
Jellyfin Server was unable to properly migrate old directories.
Error info: Error Domain=NSCocoaErrorDomain Code=516 "“plugins” couldn’t be moved to “jellyfin” because an item with the same name already exists." UserInfo={NSSourceFilePathErrorKey=/Users/sejmann/.local/share/jellyfin/plugins, NSUserStringVariant=(
    Move
), NSDestinationFilePath=/Users/sejmann//Library/Application Support/jellyfin/plugins, NSFilePath=/Users/sejmann/.local/share/jellyfin/plugins, NSUnderlyingError=0x60000248c660 {Error Domain=NSPOSIXErrorDomain Code=17 "File exists"}}

Running stat on the new jellyfin directory in Application Support leads me to believe it's newly created:

~/Library/Application Support$ stat jellyfin
16777234 187235020 drwxr-xr-x 10 sejmann staff 0 320 "May 12 01:17:55 2024" "May 11 21:00:22 2024" "May 11 21:00:22 2024" "May 11 21:00:00 2024" 4096 0 0 jellyfin

...and I don't know why I would have already had a folder there of that name, unless 10.8.13 or prior also attempted the same move. And the contents of the folder seem like a fresh install, rather than a migration. And running stat on all of the files and folders within all show similar fresh creation, rather than move. So my test error may be a redherring, and only happening now that there exists folders in ~/Library/Application Support/jellyfin -- I don't know what the initial move failure might have been.

Here are the complete logs of the initial run of 10.9.0:

21:00:00.504 -07:00] [INF] [6] Main: Jellyfin version: "10.9.0"
[2024-05-11 21:00:00.547 -07:00] [INF] [6] Main: Environment Variables: ["[JELLYFIN_LOG_DIR, /Users/sejmann/Library/Application Support/jellyfin/log]"]
[2024-05-11 21:00:00.549 -07:00] [INF] [6] Main: Arguments: ["/Applications/Jellyfin.app/Contents/MacOS/jellyfin.dll", "--webdir", "/Applications/Jellyfin.app/Contents/Resources/jellyfin-web", "--ffmpeg", "/Applications/Jellyfin.app/Contents/MacOS/ffmpeg", "--datadir", "/Users/sejmann//Library/Application Support/jellyfin"]
[2024-05-11 21:00:00.550 -07:00] [INF] [6] Main: Operating system: "Darwin 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:41 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8103"
[2024-05-11 21:00:00.550 -07:00] [INF] [6] Main: Architecture: Arm64
[2024-05-11 21:00:00.550 -07:00] [INF] [6] Main: 64-Bit Process: True
[2024-05-11 21:00:00.550 -07:00] [INF] [6] Main: User Interactive: True
[2024-05-11 21:00:00.550 -07:00] [INF] [6] Main: Processor count: 8
[2024-05-11 21:00:00.550 -07:00] [INF] [6] Main: Program data path: "/Users/sejmann/Library/Application Support/jellyfin"
[2024-05-11 21:00:00.550 -07:00] [INF] [6] Main: Log directory path: "/Users/sejmann/Library/Application Support/jellyfin/log"
[2024-05-11 21:00:00.550 -07:00] [INF] [6] Main: Config directory path: "/Users/sejmann/Library/Application Support/jellyfin/config"
[2024-05-11 21:00:00.550 -07:00] [INF] [6] Main: Cache path: "/Users/sejmann/Library/Application Support/jellyfin/cache"
[2024-05-11 21:00:00.550 -07:00] [INF] [6] Main: Web resources path: "/Applications/Jellyfin.app/Contents/Resources/jellyfin-web"
[2024-05-11 21:00:00.550 -07:00] [INF] [6] Main: Application directory: "/Applications/Jellyfin.app/Contents/MacOS/"
[2024-05-11 21:00:00.566 -07:00] [INF] [6] Jellyfin.Server.Migrations.MigrationRunner: Marking following migrations as applied because this is a fresh install: ["CreateNetworkConfiguration", "MigrateMusicBrainzTimeout", "MigrateNetworkConfiguration"]
[2024-05-11 21:00:00.621 -07:00] [INF] [6] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Setting cache path: "/Users/sejmann/Library/Application Support/jellyfin/cache"
[2024-05-11 21:00:00.672 -07:00] [INF] [6] Emby.Server.Implementations.ApplicationHost: Loading assemblies
[2024-05-11 21:00:00.702 -07:00] [INF] [6] Jellyfin.Networking.Manager.NetworkManager: Defined LAN addresses: ["127.0.0.1/8", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]
[2024-05-11 21:00:00.702 -07:00] [INF] [6] Jellyfin.Networking.Manager.NetworkManager: Defined LAN exclusions: []
[2024-05-11 21:00:00.702 -07:00] [INF] [6] Jellyfin.Networking.Manager.NetworkManager: Using LAN addresses: ["127.0.0.1/8", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]
[2024-05-11 21:00:00.703 -07:00] [INF] [6] Jellyfin.Networking.Manager.NetworkManager: Using bind addresses: ["127.0.0.1", "169.254.171.224", "10.0.0.209", "10.0.0.11"]
[2024-05-11 21:00:00.703 -07:00] [INF] [6] Jellyfin.Networking.Manager.NetworkManager: Remote IP filter is "Allowlist"
[2024-05-11 21:00:00.703 -07:00] [INF] [6] Jellyfin.Networking.Manager.NetworkManager: Filter list: []
[2024-05-11 21:00:01.133 -07:00] [INF] [6] Emby.Server.Implementations.ApplicationHost: There are pending EFCore migrations in the database. Applying... (This may take a while, do not stop Jellyfin)
[2024-05-11 21:00:01.272 -07:00] [WRN] [6] Microsoft.EntityFrameworkCore.Migrations: An operation of type '"SqlOperation"' will be attempted while a rebuild of table '"ImageInfos"' is pending. The database may not be in an expected state. Review the SQL generated by this migration to help diagnose any failures. Consider moving these operations to a subsequent migration.
[2024-05-11 21:00:01.272 -07:00] [WRN] [6] Microsoft.EntityFrameworkCore.Migrations: An operation of type '"SqlOperation"' will be attempted while a rebuild of table '"ImageInfos"' is pending. The database may not be in an expected state. Review the SQL generated by this migration to help diagnose any failures. Consider moving these operations to a subsequent migration.
[2024-05-11 21:00:01.272 -07:00] [WRN] [6] Microsoft.EntityFrameworkCore.Migrations: An operation of type '"SqlOperation"' will be attempted while a rebuild of table '"Permissions"' is pending. The database may not be in an expected state. Review the SQL generated by this migration to help diagnose any failures. Consider moving these operations to a subsequent migration.
[2024-05-11 21:00:01.272 -07:00] [WRN] [6] Microsoft.EntityFrameworkCore.Migrations: An operation of type '"SqlOperation"' will be attempted while a rebuild of table '"Permissions"' is pending. The database may not be in an expected state. Review the SQL generated by this migration to help diagnose any failures. Consider moving these operations to a subsequent migration.
[2024-05-11 21:00:01.273 -07:00] [WRN] [6] Microsoft.EntityFrameworkCore.Migrations: An operation of type '"SqlOperation"' will be attempted while a rebuild of table '"Preferences"' is pending. The database may not be in an expected state. Review the SQL generated by this migration to help diagnose any failures. Consider moving these operations to a subsequent migration.
[2024-05-11 21:00:01.273 -07:00] [WRN] [6] Microsoft.EntityFrameworkCore.Migrations: An operation of type '"SqlOperation"' will be attempted while a rebuild of table '"Preferences"' is pending. The database may not be in an expected state. Review the SQL generated by this migration to help diagnose any failures. Consider moving these operations to a subsequent migration.
[2024-05-11 21:00:01.273 -07:00] [WRN] [6] Microsoft.EntityFrameworkCore.Migrations: An operation of type '"SqlOperation"' will be attempted while a rebuild of table '"Users"' is pending. The database may not be in an expected state. Review the SQL generated by this migration to help diagnose any failures. Consider moving these operations to a subsequent migration.
[2024-05-11 21:00:01.273 -07:00] [WRN] [6] Microsoft.EntityFrameworkCore.Migrations: An operation of type '"SqlOperation"' will be attempted while a rebuild of table '"Users"' is pending. The database may not be in an expected state. Review the SQL generated by this migration to help diagnose any failures. Consider moving these operations to a subsequent migration.
[2024-05-11 21:00:01.339 -07:00] [INF] [6] Emby.Server.Implementations.ApplicationHost: EFCore migrations applied successfully
[2024-05-11 21:00:01.533 -07:00] [INF] [6] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Saving system configuration
[2024-05-11 21:00:01.534 -07:00] [INF] [6] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Setting cache path: "/Users/sejmann/Library/Application Support/jellyfin/cache"
[2024-05-11 21:00:01.536 -07:00] [INF] [6] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "TMDb" "10.9.0.0"
[2024-05-11 21:00:01.536 -07:00] [INF] [6] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "Studio Images" "10.9.0.0"
[2024-05-11 21:00:01.536 -07:00] [INF] [6] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "OMDb" "10.9.0.0"
[2024-05-11 21:00:01.542 -07:00] [INF] [6] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "MusicBrainz" "10.9.0.0"
[2024-05-11 21:00:01.542 -07:00] [INF] [6] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "AudioDB" "10.9.0.0"
[2024-05-11 21:00:01.561 -07:00] [INF] [6] Jellyfin.Server.Migrations.MigrationRunner: Marking following migrations as applied because this is a fresh install: ["DisableTranscodingThrottling", "CreateLoggingConfigHeirarchy", "MigrateActivityLogDatabase", "RemoveDuplicateExtras", "MigrateUserDatabase", "MigrateDisplayPreferencesDatabase", "RemoveDownloadImagesInAdvance", "MigrateAuthenticationDatabase", "FixPlaylistOwner", "MigrateRatingLevels"]
[2024-05-11 21:00:01.562 -07:00] [INF] [6] Jellyfin.Server.Migrations.MigrationRunner: Applying migration '"AddDefaultPluginRepository"'
[2024-05-11 21:00:01.562 -07:00] [INF] [6] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Saving system configuration
[2024-05-11 21:00:01.562 -07:00] [INF] [6] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Setting cache path: "/Users/sejmann/Library/Application Support/jellyfin/cache"
[2024-05-11 21:00:01.562 -07:00] [INF] [6] Jellyfin.Server.Migrations.MigrationRunner: Migration '"AddDefaultPluginRepository"' applied successfully
[2024-05-11 21:00:01.563 -07:00] [INF] [6] Jellyfin.Server.Migrations.MigrationRunner: Applying migration '"ReaddDefaultPluginRepository"'
[2024-05-11 21:00:01.563 -07:00] [INF] [6] Jellyfin.Server.Migrations.MigrationRunner: Migration '"ReaddDefaultPluginRepository"' applied successfully
[2024-05-11 21:00:01.563 -07:00] [INF] [6] Jellyfin.Server.Migrations.MigrationRunner: Applying migration '"AddDefaultCastReceivers"'
[2024-05-11 21:00:01.563 -07:00] [INF] [6] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Saving system configuration
[2024-05-11 21:00:01.563 -07:00] [INF] [6] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Setting cache path: "/Users/sejmann/Library/Application Support/jellyfin/cache"
[2024-05-11 21:00:01.563 -07:00] [INF] [6] Jellyfin.Server.Migrations.MigrationRunner: Migration '"AddDefaultCastReceivers"' applied successfully
[2024-05-11 21:00:01.563 -07:00] [INF] [6] Jellyfin.Server.Migrations.MigrationRunner: Applying migration '"UpdateDefaultPluginRepository10.9"'
[2024-05-11 21:00:01.563 -07:00] [INF] [6] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Saving system configuration
[2024-05-11 21:00:01.564 -07:00] [INF] [6] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Setting cache path: "/Users/sejmann/Library/Application Support/jellyfin/cache"
[2024-05-11 21:00:01.564 -07:00] [INF] [6] Jellyfin.Server.Migrations.MigrationRunner: Migration '"UpdateDefaultPluginRepository10.9"' applied successfully
[2024-05-11 21:00:01.569 -07:00] [INF] [6] Main: Kestrel is listening on "127.0.0.1"
[2024-05-11 21:00:01.569 -07:00] [INF] [6] Main: Kestrel is listening on "169.254.171.224"
[2024-05-11 21:00:01.569 -07:00] [INF] [6] Main: Kestrel is listening on "10.0.0.209"
[2024-05-11 21:00:01.569 -07:00] [INF] [6] Main: Kestrel is listening on "10.0.0.11"
[2024-05-11 21:00:01.828 -07:00] [WRN] [6] Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware: The WebRootPath was not found: "/wwwroot". Static files may be unavailable.
[2024-05-11 21:00:01.865 -07:00] [INF] [6] Emby.Server.Implementations.ApplicationHost: Running startup tasks
[2024-05-11 21:00:01.876 -07:00] [INF] [6] Emby.Server.Implementations.ScheduledTasks.TaskManager: Daily trigger for "Generate Trickplay Images" set to fire at 2024-05-12 03:00:00.000 -07:00, which is 05:59:58.1240170 from now.
[2024-05-11 21:00:01.877 -07:00] [INF] [6] Emby.Server.Implementations.ScheduledTasks.TaskManager: Daily trigger for "Extract Chapter Images" set to fire at 2024-05-12 02:00:00.000 -07:00, which is 04:59:58.1227720 from now.
[2024-05-11 21:00:01.984 -07:00] [INF] [6] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Found ffmpeg version "6.0.1"
[2024-05-11 21:00:02.066 -07:00] [INF] [6] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available "decoders": ["libdav1d", "av1", "h264", "hevc", "mpeg2video", "mpeg4", "msmpeg4", "vp8", "libvpx", "vp9", "libvpx-vp9", "aac", "ac3", "dca", "flac", "mp3", "truehd"]
[2024-05-11 21:00:02.107 -07:00] [INF] [6] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available "encoders": ["libsvtav1", "libx264", "h264_videotoolbox", "libx265", "hevc_videotoolbox", "mpeg4", "msmpeg4", "libvpx", "libvpx-vp9", "aac", "aac_at", "ac3", "alac", "dca", "flac", "libmp3lame", "libopus", "truehd", "libvorbis", "srt"]
[2024-05-11 21:00:02.152 -07:00] [INF] [6] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available filters: ["overlay_opencl", "overlay_videotoolbox", "scale_opencl", "scale_vt", "tonemap_opencl", "tonemap_videotoolbox", "yadif_videotoolbox", "zscale", "alphasrc"]
[2024-05-11 21:00:02.195 -07:00] [WRN] [6] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: "scale_cuda" with option "Output format (default \"same\")" is not available
[2024-05-11 21:00:02.234 -07:00] [WRN] [6] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: "tonemap_cuda" with option "GPU accelerated HDR to SDR tonemapping" is not available
[2024-05-11 21:00:02.373 -07:00] [WRN] [6] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: "overlay_vaapi" with option "Action to take when encountering EOF from secondary input" is not available
[2024-05-11 21:00:02.417 -07:00] [WRN] [6] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: "overlay_vulkan" with option "Action to take when encountering EOF from secondary input" is not available
[2024-05-11 21:00:02.466 -07:00] [INF] [6] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available hwaccel types: ["videotoolbox", "opencl"]
[2024-05-11 21:00:02.629 -07:00] [INF] [6] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: FFmpeg: "/Applications/Jellyfin.app/Contents/MacOS/ffmpeg"
[2024-05-11 21:00:02.630 -07:00] [INF] [6] Emby.Server.Implementations.ApplicationHost: ServerId: "b5ff46fe15194433853183f208d7aba0"
[2024-05-11 21:00:02.630 -07:00] [INF] [6] Emby.Server.Implementations.ApplicationHost: Core startup complete
[2024-05-11 21:00:02.630 -07:00] [INF] [6] Main: Startup complete 0:00:02.3588332
[2024-05-11 21:00:04.899 -07:00] [INF] [4] Emby.Server.Implementations.ScheduledTasks.TaskManager: "Clean up collections and playlists" Completed after 0 minute(s) and 0 seconds
[2024-05-11 21:00:05.531 -07:00] [INF] [18] Emby.Server.Implementations.Session.SessionManager: Sending shutdown notifications
[2024-05-11 21:00:05.557 -07:00] [INF] [11] Jellyfin.Networking.PortForwardingHost: Stopping NAT discovery
[2024-05-11 21:00:05.562 -07:00] [INF] [10] Main: Running query planner optimizations in the database... This might take a while
[2024-05-11 21:00:05.575 -07:00] [INF] [10] Emby.Server.Implementations.ScheduledTasks.TaskManager: "Update Plugins": Cancelling
[2024-05-11 21:00:05.576 -07:00] [INF] [10] Emby.Server.Implementations.ScheduledTasks.TaskManager: "Update Plugins": Waiting on Task
[2024-05-11 21:00:05.582 -07:00] [INF] [11] Emby.Server.Implementations.ScheduledTasks.TaskManager: "Update Plugins" Cancelled after 0 minute(s) and 0 seconds
[2024-05-11 21:00:05.590 -07:00] [INF] [10] Emby.Server.Implementations.ScheduledTasks.TaskManager: "Update Plugins": Task exited
[2024-05-11 21:00:05.590 -07:00] [INF] [10] Emby.Server.Implementations.ScheduledTasks.TaskManager: "Update Plugins" Aborted after 0 minute(s) and 0 seconds
[2024-05-11 21:00:05.592 -07:00] [INF] [10] Emby.Server.Implementations.ApplicationHost: Disposing "CoreAppHost"
[2024-05-11 21:00:05.592 -07:00] [INF] [10] Emby.Server.Implementations.ApplicationHost: Disposing "MusicBrainzArtistProvider"
[2024-05-11 21:00:05.592 -07:00] [INF] [10] Emby.Server.Implementations.ApplicationHost: Disposing "MusicBrainzAlbumProvider"
[2024-05-11 21:00:05.593 -07:00] [INF] [10] Emby.Server.Implementations.ApplicationHost: Disposing "PluginManager"
[2024-05-11 21:00:22.898 -07:00] [INF] [1] Main: Jellyfin version: "10.9.0"
[2024-05-11 21:00:22.918 -07:00] [INF] [1] Main: Environment Variables: ["[JELLYFIN_LOG_DIR, /Users/sejmann/Library/Application Support/jellyfin/log]"]
[2024-05-11 21:00:22.919 -07:00] [INF] [1] Main: Arguments: ["/Applications/Jellyfin.app/Contents/MacOS/jellyfin.dll", "--webdir", "/Applications/Jellyfin.app/Contents/Resources/jellyfin-web", "--ffmpeg", "/Applications/Jellyfin.app/Contents/MacOS/ffmpeg", "--datadir", "/Users/sejmann//Library/Application Support/jellyfin"]
[2024-05-11 21:00:22.919 -07:00] [INF] [1] Main: Operating system: "Darwin 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:41 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8103"
[2024-05-11 21:00:22.919 -07:00] [INF] [1] Main: Architecture: Arm64
[2024-05-11 21:00:22.919 -07:00] [INF] [1] Main: 64-Bit Process: True
[2024-05-11 21:00:22.919 -07:00] [INF] [1] Main: User Interactive: True
[2024-05-11 21:00:22.919 -07:00] [INF] [1] Main: Processor count: 8
[2024-05-11 21:00:22.919 -07:00] [INF] [1] Main: Program data path: "/Users/sejmann/Library/Application Support/jellyfin"
[2024-05-11 21:00:22.919 -07:00] [INF] [1] Main: Log directory path: "/Users/sejmann/Library/Application Support/jellyfin/log"
[2024-05-11 21:00:22.919 -07:00] [INF] [1] Main: Config directory path: "/Users/sejmann/Library/Application Support/jellyfin/config"
[2024-05-11 21:00:22.919 -07:00] [INF] [1] Main: Cache path: "/Users/sejmann/Library/Application Support/jellyfin/cache"
[2024-05-11 21:00:22.919 -07:00] [INF] [1] Main: Web resources path: "/Applications/Jellyfin.app/Contents/Resources/jellyfin-web"
[2024-05-11 21:00:22.919 -07:00] [INF] [1] Main: Application directory: "/Applications/Jellyfin.app/Contents/MacOS/"
[2024-05-11 21:00:22.997 -07:00] [INF] [1] Jellyfin.Server.Migrations.MigrationRunner: Marking following migrations as applied because this is a fresh install: ["CreateNetworkConfiguration", "MigrateMusicBrainzTimeout", "MigrateNetworkConfiguration"]
[2024-05-11 21:00:23.018 -07:00] [INF] [1] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Setting cache path: "/Users/sejmann/Library/Application Support/jellyfin/cache"
[2024-05-11 21:00:23.104 -07:00] [INF] [1] Emby.Server.Implementations.ApplicationHost: Loading assemblies
[2024-05-11 21:00:23.148 -07:00] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN addresses: ["127.0.0.1/8", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]
[2024-05-11 21:00:23.148 -07:00] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN exclusions: []
[2024-05-11 21:00:23.148 -07:00] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using LAN addresses: ["127.0.0.1/8", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]
[2024-05-11 21:00:23.148 -07:00] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using bind addresses: ["127.0.0.1", "169.254.171.224", "10.0.0.209", "10.0.0.11"]
[2024-05-11 21:00:23.148 -07:00] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Remote IP filter is "Allowlist"
[2024-05-11 21:00:23.148 -07:00] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Filter list: []
[2024-05-11 21:00:23.721 -07:00] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "TMDb" "10.9.0.0"
[2024-05-11 21:00:23.722 -07:00] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "Studio Images" "10.9.0.0"
[2024-05-11 21:00:23.722 -07:00] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "OMDb" "10.9.0.0"
[2024-05-11 21:00:23.732 -07:00] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "MusicBrainz" "10.9.0.0"
[2024-05-11 21:00:23.732 -07:00] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: "AudioDB" "10.9.0.0"
[2024-05-11 21:00:23.758 -07:00] [INF] [1] Jellyfin.Server.Migrations.MigrationRunner: Marking following migrations as applied because this is a fresh install: ["DisableTranscodingThrottling", "CreateLoggingConfigHeirarchy", "MigrateActivityLogDatabase", "RemoveDuplicateExtras", "MigrateUserDatabase", "MigrateDisplayPreferencesDatabase", "RemoveDownloadImagesInAdvance", "MigrateAuthenticationDatabase", "FixPlaylistOwner", "MigrateRatingLevels"]
[2024-05-11 21:00:23.764 -07:00] [INF] [1] Main: Kestrel is listening on "127.0.0.1"
[2024-05-11 21:00:23.764 -07:00] [INF] [1] Main: Kestrel is listening on "169.254.171.224"
[2024-05-11 21:00:23.764 -07:00] [INF] [1] Main: Kestrel is listening on "10.0.0.209"
[2024-05-11 21:00:23.764 -07:00] [INF] [1] Main: Kestrel is listening on "10.0.0.11"
[2024-05-11 21:00:23.987 -07:00] [WRN] [1] Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware: The WebRootPath was not found: "/wwwroot". Static files may be unavailable.
[2024-05-11 21:00:24.010 -07:00] [INF] [1] Emby.Server.Implementations.ApplicationHost: Running startup tasks
[2024-05-11 21:00:24.023 -07:00] [INF] [1] Emby.Server.Implementations.ScheduledTasks.TaskManager: Daily trigger for "Generate Trickplay Images" set to fire at 2024-05-12 03:00:00.000 -07:00, which is 05:59:35.9766330 from now.
[2024-05-11 21:00:24.024 -07:00] [INF] [1] Emby.Server.Implementations.ScheduledTasks.TaskManager: Daily trigger for "Extract Chapter Images" set to fire at 2024-05-12 02:00:00.000 -07:00, which is 04:59:35.9755170 from now.
[2024-05-11 21:00:24.099 -07:00] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Found ffmpeg version "6.0.1"
[2024-05-11 21:00:24.144 -07:00] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available "decoders": ["libdav1d", "av1", "h264", "hevc", "mpeg2video", "mpeg4", "msmpeg4", "vp8", "libvpx", "vp9", "libvpx-vp9", "aac", "ac3", "dca", "flac", "mp3", "truehd"]
[2024-05-11 21:00:24.177 -07:00] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available "encoders": ["libsvtav1", "libx264", "h264_videotoolbox", "libx265", "hevc_videotoolbox", "mpeg4", "msmpeg4", "libvpx", "libvpx-vp9", "aac", "aac_at", "ac3", "alac", "dca", "flac", "libmp3lame", "libopus", "truehd", "libvorbis", "srt"]
[2024-05-11 21:00:24.206 -07:00] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available filters: ["overlay_opencl", "overlay_videotoolbox", "scale_opencl", "scale_vt", "tonemap_opencl", "tonemap_videotoolbox", "yadif_videotoolbox", "zscale", "alphasrc"]
[2024-05-11 21:00:24.242 -07:00] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: "scale_cuda" with option "Output format (default \"same\")" is not available
[2024-05-11 21:00:24.265 -07:00] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: "tonemap_cuda" with option "GPU accelerated HDR to SDR tonemapping" is not available
[2024-05-11 21:00:24.337 -07:00] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: "overlay_vaapi" with option "Action to take when encountering EOF from secondary input" is not available
[2024-05-11 21:00:24.359 -07:00] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: "overlay_vulkan" with option "Action to take when encountering EOF from secondary input" is not available
[2024-05-11 21:00:24.382 -07:00] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available hwaccel types: ["videotoolbox", "opencl"]
[2024-05-11 21:00:24.489 -07:00] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: FFmpeg: "/Applications/Jellyfin.app/Contents/MacOS/ffmpeg"
[2024-05-11 21:00:24.490 -07:00] [INF] [1] Emby.Server.Implementations.ApplicationHost: ServerId: "b5ff46fe15194433853183f208d7aba0"
[2024-05-11 21:00:24.490 -07:00] [INF] [1] Emby.Server.Implementations.ApplicationHost: Core startup complete
[2024-05-11 21:00:24.490 -07:00] [INF] [1] Main: Startup complete 0:00:01.8396845
[2024-05-11 21:00:27.051 -07:00] [INF] [7] Emby.Server.Implementations.ScheduledTasks.TaskManager: "Clean up collections and playlists" Completed after 0 minute(s) and 0 seconds
[2024-05-11 21:00:27.581 -07:00] [INF] [14] Emby.Server.Implementations.ScheduledTasks.TaskManager: "Update Plugins" Completed after 0 minute(s) and 0 seconds
[2024-05-11 21:00:36.966 -07:00] [INF] [17] Emby.Server.Implementations.Session.SessionManager: Sending shutdown notifications
[2024-05-11 21:00:36.994 -07:00] [INF] [19] Jellyfin.Networking.PortForwardingHost: Stopping NAT discovery
[2024-05-11 21:00:36.998 -07:00] [INF] [14] Main: Running query planner optimizations in the database... This might take a while
[2024-05-11 21:00:37.017 -07:00] [INF] [14] Emby.Server.Implementations.ApplicationHost: Disposing "CoreAppHost"
[2024-05-11 21:00:37.018 -07:00] [INF] [14] Emby.Server.Implementations.ApplicationHost: Disposing "MusicBrainzArtistProvider"
[2024-05-11 21:00:37.018 -07:00] [INF] [14] Emby.Server.Implementations.ApplicationHost: Disposing "MusicBrainzAlbumProvider"
[2024-05-11 21:00:37.018 -07:00] [INF] [14] Emby.Server.Implementations.ApplicationHost: Disposing "PluginManager"

It is suspicious that the log states it's a fresh install. It seems like that may have been the initial mistake, and that subsequent runs fail because ~/.local/share/jellyfin still exists and the move can't complete because matching subfolders in ~/Library/Application Support/jellyfin now exist.

anthonylavado commented 1 month ago

I'll be attempting to recreate this later today, though I should note that I only have access to Intel Macs. There are some team members with Apple Silicon so I may ask them for help as well.

If you do move the contents of the folder manually, does it work as intended?

sejmann commented 1 month ago

Update 3: Nuking ~/Library/Application Support/jellyfin and rerunning my test script returns:

~$ ./test.swift
got contents
Jellyfin Server was unable to properly migrate old directories.
Error info: Error Domain=NSCocoaErrorDomain Code=4 "“plugins” couldn’t be moved to “jellyfin” because either the former doesn’t exist, or the folder containing the latter doesn’t exist." UserInfo={NSSourceFilePathErrorKey=/Users/sejmann/.local/share/jellyfin/plugins, NSUserStringVariant=(
    Move
), NSDestinationFilePath=/Users/sejmann//Library/Application Support/jellyfin/plugins, NSFilePath=/Users/sejmann/.local/share/jellyfin/plugins, NSUnderlyingError=0x600000e773c0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

– that make sense, because my little script doesn't create the directory, probably unlike the Jellyfin.app. Okay, so I mkdir jellyfin first and rerun:

~$ ./test.swift
got contents
moved /Users/sejmann/.local/share/jellyfin/plugins to /Users/sejmann//Library/Application Support/jellyfin/plugins
moved /Users/sejmann/.local/share/jellyfin/trakt to /Users/sejmann//Library/Application Support/jellyfin/trakt
moved /Users/sejmann/.local/share/jellyfin/transcodes to /Users/sejmann//Library/Application Support/jellyfin/transcodes
moved /Users/sejmann/.local/share/jellyfin/root to /Users/sejmann//Library/Application Support/jellyfin/root
moved /Users/sejmann/.local/share/jellyfin/log to /Users/sejmann//Library/Application Support/jellyfin/log
moved /Users/sejmann/.local/share/jellyfin/data to /Users/sejmann//Library/Application Support/jellyfin/data
moved /Users/sejmann/.local/share/jellyfin/metadata to /Users/sejmann//Library/Application Support/jellyfin/metadata
removed directory

That mostly seemed to work – it moved over everything, and du -c of the contents of the new folder match the size of the contents of the jellyfin in prior location.

<removed snippet about rogue plugin recreating local/share/jellyfin to write data, as it was a result of still having 10.8.13 running. />

tbeseda commented 1 month ago

Just chiming in to say I have the same issue with a stock Jellyfin server, no plugins.

gnattu commented 1 month ago

There is indeed a bug in the migration code.

For current workaround, you can do this:

Go to ~/.local/share, move the jellyfin folder to ~/Library/Application Support/. Make sure that the jellyfin folder does not exit in ~/.local/share and is present in ~/Library/Application Support/.

You can go to these folders by pressing command+option+G and paste the path.

We will update the tray app soon so this never happens again

tbeseda commented 1 month ago

Confirming this worked for me: remove/rename ~/Library/Application Support/jellyfin move ~/.local/share/jellyfin to ~/Library/Application Support/jellyfin run Jellyfin.app. launch web interface (hard refresh of browser is needed). back in business 🤘

Thanks!

genericbar commented 1 month ago

I'm afraid I went with the nuclear option and fully wiped Jellyfin of my system and then it worked fine after I installed the latest ARM64 version. Hoping this gets fixed fast for other though.

gnattu commented 1 month ago

Alright, we found that such migration just cannot happen if you installed this pre 10.9 due to database will also store the old location. The new plan would be the following:

If you installed it clean for 10.9, your data folder will be the new default ~/Library/Application Support/jellyfin

If you installed from 10.8 and updated to 10.9, we will modify the menu bar app so that your old location ~/.local/share/jellyfin will continue to work.

So everyone should roll back now, sorry for the inconvenience.

anthonylavado commented 1 month ago

There is a new release, which should resolve these issues.