Something is broken. I’ve spent quite a few hours getting the iTunes import working. I know I’m getting closer since I’ve read more success stories about how people succeeded and I’m doing the exact same thing.
I’m running PMS ( Version 1.21.2.3943) in docker on a self built NAS with Ubuntu. I’ve got my iTunes library stored on the same NAS, mapped volumes to docker so it can import movies, tv shows and music. And also my iTunes library is on the same NAS.
- I’ve enabled the iTunes Plugin in Settings → Settings → Plugins.
- I’ve placed the library.xml in the root of the docker mapped volume and restarted PMS (by restarting the docker container).
- I’ve verified that the user in the container can read the library.xml on the designated iTunes XML library path as set in the Plugin Settings.
- I have created a new library of the type “Music” and ticked the check box to import iTunes playlists and ratings and so on.
- After creation of that iTunes music library in iTunes, I can’t get the “import from iTunes” button to show up, like others seem to have been able to. I’ve restarted the container; no change.
I’ve triggered a re-read of the library.xml file by saving it, so PMS would pick that up and re-read it’s contents:
Jan 31, 2021 20:54:42.498 [0x7f78ea7fc700] DEBUG - File "/opt/library.xml" changed: 2021-01-31 20:48:11 (1612122491) => 2021-01-31 20:54:42 (1612122882).
Jan 31, 2021 20:54:42.498 [0x7f78ea7fc700] INFO - DatabaseLoader::handleChangedFile(0x3b1ab80)
Jan 31, 2021 20:54:42.729 [0x7f78ea7fc700] DEBUG - iTunes: Reading XML files...
Jan 31, 2021 20:54:42.729 [0x7f78ea7fc700] DEBUG - iTunes: Reading XML file: /opt/library.xml
Jan 31, 2021 20:54:44.246 [0x7f78ea7fc700] DEBUG - iTunes: Loading tracks...
Jan 31, 2021 20:54:46.027 [0x7f78ea7fc700] DEBUG - iTunes: Completed reading 2339 tracks in 1.1 seconds.
Jan 31, 2021 20:54:46.028 [0x7f78ea7fc700] INFO - iTunes: loading playlists...
Jan 31, 2021 20:54:46.068 [0x7f78ea7fc700] DEBUG - iTunes: reading tracks from playlist Liza
Jan 31, 2021 20:54:46.076 [0x7f78ea7fc700] DEBUG - iTunes: read 30 tracks for playlist Liza
Jan 31, 2021 20:54:46.076 [0x7f78ea7fc700] DEBUG - iTunes: reading tracks from playlist CD 01
Jan 31, 2021 20:54:46.082 [0x7f78ea7fc700] DEBUG - iTunes: read 22 tracks for playlist CD 01
...
Jan 31, 2021 20:54:46.258 [0x7f78ea7fc700] DEBUG - iTunes: reading tracks from playlist 03 Rock songs
Jan 31, 2021 20:54:46.311 [0x7f78ea7fc700] DEBUG - iTunes: read 176 tracks for playlist 03 Rock songs
Jan 31, 2021 20:54:46.311 [0x7f78ea7fc700] DEBUG - iTunes: reading tracks from playlist 04 Top 40 songs
Jan 31, 2021 20:54:46.483 [0x7f78ea7fc700] DEBUG - iTunes: read 587 tracks for playlist 04 Top 40 songs
Jan 31, 2021 20:54:46.484 [0x7f78ea7fc700] DEBUG - iTunes: reading tracks from playlist 06 Dance songs
Jan 31, 2021 20:54:46.533 [0x7f78ea7fc700] DEBUG - iTunes: read 193 tracks for playlist 06 Dance songs
...
Jan 31, 2021 20:54:46.848 [0x7f78ea7fc700] DEBUG - iTunes: reading tracks from playlist X-mas
Jan 31, 2021 20:54:46.870 [0x7f78ea7fc700] DEBUG - iTunes: read 82 tracks for playlist X-mas
...
Jan 31, 2021 20:54:46.879 [0x7f78ea7fc700] INFO - iTunes: done loading 39 playlists and 2 folders in 0.6 seconds.
Jan 31, 2021 20:54:46.967 [0x7f78ea7fc700] INFO - iTunes: parsed library in 1.8 seconds.
Jan 31, 2021 20:54:46.967 [0x7f78ea7fc700] DEBUG - Loading com.plexapp.plugins.itunes is complete (success=1)
So far so good you would say; the library.xml file was re-read and parsed successfully. But right after the last log line above, this is shown:
Jan 31, 2021 20:54:47.137 [0x7f78ea7fc700] ERROR - Couldn't rename file "/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.itunes-new.db-shm" to "/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.itunes.db-shm": No such file or directory
Jan 31, 2021 20:54:47.137 [0x7f78ea7fc700] ERROR - Couldn't rename file "/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.itunes-new.db-wal" to "/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.itunes.db-wal": No such file or directory
Jan 31, 2021 20:54:47.149 [0x7f78ea7fc700] DEBUG - iTunes: There are 2335 audio tracks and 4 video tracks.
And that’s it. I’m positive that this “renaming error” is the root cause I’m not seeing the playlists and ratings I’ve carefully curated the past decade. When I examine the contents of the /config/Library/Application Support/Plex Media Server/Plug-in Support/Databases directory, the “new” versions of the com.plexapp.plugins.itunes-new.db-shm and com.plexapp.plugins.itunes-new.db-wal indeed aren’t there. So it’s no wonder there is a renaming error. The “old” versions are present though:
root@6a354daeb41e:/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases# ls -la
total 221788
drwxr-sr-x 2 abc users 4096 Jan 31 21:08 .
drwxr-sr-x 7 abc users 4096 Dec 18 16:28 ..
-rw-r--r-- 1 abc users 6197248 Jan 31 20:51 com.plexapp.dlna.db
-rw-r--r-- 1 abc users 32768 Jan 31 20:51 com.plexapp.dlna.db-shm
-rw-r--r-- 1 abc users 6233592 Jan 31 20:51 com.plexapp.dlna.db-wal
-rw-r--r-- 1 abc users 1691648 Jan 31 21:08 com.plexapp.plugins.itunes.db
-rw-r--r-- 1 abc users 32768 Jan 31 21:08 com.plexapp.plugins.itunes.db-shm
-rw-r--r-- 1 abc users 0 Jan 31 21:08 com.plexapp.plugins.itunes.db-wal
-rw-r--r-- 1 abc users 30924800 Jan 31 13:04 com.plexapp.plugins.library.blobs.db
-rw-r--r-- 1 abc users 764928 Jan 21 02:00 com.plexapp.plugins.library.blobs.db-2021-01-21
-rw-r--r-- 1 abc users 336896 Jan 24 02:00 com.plexapp.plugins.library.blobs.db-2021-01-24
-rw-r--r-- 1 abc users 22030336 Jan 27 02:04 com.plexapp.plugins.library.blobs.db-2021-01-27
-rw-r--r-- 1 abc users 21970944 Jan 30 02:01 com.plexapp.plugins.library.blobs.db-2021-01-30
-rw-r--r-- 1 abc users 32768 Jan 31 20:50 com.plexapp.plugins.library.blobs.db-shm
-rw-r--r-- 1 abc users 0 Jan 31 20:50 com.plexapp.plugins.library.blobs.db-wal
-rw-r--r-- 1 abc users 36726784 Jan 31 20:50 com.plexapp.plugins.library.db
-rw-r--r-- 1 abc users 6181888 Jan 21 02:00 com.plexapp.plugins.library.db-2021-01-21
-rw-r--r-- 1 abc users 12057600 Jan 24 02:00 com.plexapp.plugins.library.db-2021-01-24
-rw-r--r-- 1 abc users 40479744 Jan 27 02:04 com.plexapp.plugins.library.db-2021-01-27
-rw-r--r-- 1 abc users 37710848 Jan 30 02:01 com.plexapp.plugins.library.db-2021-01-30
-rw-r--r-- 1 abc users 32768 Jan 31 21:38 com.plexapp.plugins.library.db-shm
-rw-r--r-- 1 abc users 657128 Jan 31 21:38 com.plexapp.plugins.library.db-wal
-rw-r--r-- 1 abc users 4096 Jan 30 22:00 com.plexapp.plugins.trakttv.db
-rw-r--r-- 1 abc users 32768 Jan 31 20:51 com.plexapp.plugins.trakttv.db-shm
-rw-r--r-- 1 abc users 2933472 Jan 31 20:51 com.plexapp.plugins.trakttv.db-wal
So what’s going on here? Anyone got a clue?
– EDIT –
I’ve used sqlite3 to open the com.plexapp.plugins.itunes.db database to see if any content is in there, and there is… From the looks of it, all of the library.xml info is stored in the sqlite database. But it’s not imported or at least “visible” in the Plex web interface or iPhone app.
Any clues? Anyone?