Jump to content

Cannot Manually Create A New Emby Server


Go to solution Solved by nmalinoski,

Recommended Posts

Posted

Hi everyone,

 

Looking at my, Last Post, updating to Emby version 4.8.11.0 broke my Emby server.  I decided to delete the Jail and manually create the new server using the commands below.  This is the way I have always done it.  The creation errors out with the attached error.  Once again, it has something to do with mbedtls.

 

cd iocage-amd64

iocage fetch -P emby-server.json dhcp="on" ip6="inherit" allow_mlock="on" --branch master

iocage set plugin_repository='https://github.com/MediaBrowser/iocage-amd64.git' emby-server_1

 

Is there a new command that will use the new mbedtls2?  Or a command that I can use to create the new server?

 

Thanks,

Chris

Error.JPG

Posted

Hi, do you need to update your local git clone of our repository?

Posted

Hey Luke,

 

I honestly don't know.  The steps I used above I had gotten from a post a year or so ago.  I'm not even able to get to this step iocage set plugin_repository='https://github.com/MediaBrowser/iocage-amd64.git' emby-server_1 as the error occurs when running iocage fetch -P emby-server.json dhcp="on" ip6="inherit" allow_mlock="on" --branch master.

 

I currently have two two Emby servers and one is based on an older Jail, a 12.3 release.  I was working on getting two identical servers on a 13.1 or higher Jail so that I can delete the 12.3.  I'd use one server and have the other as a backup.

 

Chris

Posted

Have you considered truenas scale?

Posted

I have considered Scale and have a test machine to work on it.  I just didn't want risking losing my pool switching to Scale and having to set it all up again.  I had everything working just fine until this and if works, why change?  It just doesn't make any sense why installing the update on one server worked fine while installing the same on a different server didn't.  If I recall correctly, when using the command pkg install mbedtls2 and it update as it did with the other server, but also it went through an install of dot something.

So are you saying, going forward, we won't be able to create new Emby servers (Jails) using this command -  iocage fetch -P emby-server.json dhcp="on" ip6="inherit" allow_mlock="on" --branch master?

How would someone manually create the server then gong forward?

Posted

You can still do this. I was just trying to suggest Scale because it is linux based and avoids the whole complication of the entire BSD platform.

I would suggest deleting your git clone of our iocage repo and then going through the commands again.

Posted

Thank, I do plan looking into Scale in the future, but right now all I use my NAS for is Emby.  I have everything working the way I want it and all the images and metadata the way I want it.  The reason why I have two servers is case something happens to one when updating it like it just did.

You said I can still do this, referring to manually creating a Jail in Core.  How would I do this if the command iocage fetch -P emby-server.json dhcp="on" ip6="inherit" allow_mlock="on" --branch master fails to create the jail due to not being able to install mbedtls?  Are you guys working on a new emby-server.json?

 

Chris

Posted

Any update on this?  If I can't manually create a new Jail, I'm not sure I trust updating Emby anymore.  I don't want to lose the Jail again.

Posted

Hi, can you try this again? Thanks.

Posted

Just tried Luke and got the same error.  An issue with mbedtls.  See attachment.

New Install #2.JPG

Posted

Give up on the plugins.

Create a fresh jail and make sure the mlock option is on.

Use the freebsd directions inside it to install.

You may need to pkg install mbedtls2 vs 3 depending on what the latest version links to.

Posted

Thanks bolok.  Would you have a link to the instructions on how to install Emby within the Jail?  I was under the impression that the command I was using was not using the plugin.  Anyway, I'm willing to give your suggestion a try.  I can easily make the Jail, just need to know the steps to install Emby within the Jail.

 

Thanks,

Chris

Posted
On 4/4/2025 at 9:05 PM, cgcmgr said:

Thanks bolok.  Would you have a link to the instructions on how to install Emby within the Jail?  I was under the impression that the command I was using was not using the plugin.  Anyway, I'm willing to give your suggestion a try.  I can easily make the Jail, just need to know the steps to install Emby within the Jail.

 

Thanks,

Chris

@cgcmgrI beleive he means this:

https://emby.media/freebsd-server.html

Can you try that, except with the 4.8.11 pkg, which can be found here:

https://github.com/MediaBrowser/Emby.Releases/releases/tag/4.8.11.0

(just search that page for freebsd).

If you get an error on the pkg install about mbedtls3, try mbedtls2 instead.

Please let us know if this helps. Thanks.

Posted

Just getting around to this now and ran into an issue. Probably user error, but here is my question.  

Following the steps in the article that Luke linked, it says:

First, make sure your FreeBSD system is configured for latest packages.

Install dependencies:
sudo pkg install dotnet libass fontconfig freetype2 mbedtls3 fribidi gnutls iconv opus sqlite3 libtheora libva ocl-icd libvorbis webp libzvbi libraw ImageMagick6 tesseract intel-media-sdk libunwind libinotify openssl icu krb5 libexif libjxl libheif libimagequant openexr openjpeg orc pango tiff
 
Where is this done?  I did it inside the new Jail shell I created and got the message that "Sudo: command not found."  Am I supposed to run it in the Truenas Shell?  If it is supposed to be done in the TrueNas shell, will these dependencies break my other Emby servers?
 
Since Sudo was not found, I decided to just trying the command within the Jail shell - pkg add -f https://github.com/MediaBrowser/Emby.Releases/releases/download/4..8.11.0/emby-server-freebsd13_4.8.11.0_amd64.pkg.
 
This started of throwing off numerous missing dependencies.  I performed pkg install XXX, where XXX is the dependency name that was missing.  It would install and then I'm execute the Emby server command again.  This threw off another missing dependency.  I kept the process going, installing a dependency and then running the Emby server command.  This went on and on until I finally got to this message - "missing shlib dependency libfftw3.so.3."  Executing pkg install libfftw3.so.3 returns an error that it cannot be found.  This is where I gav up.
 
Not sure if I'm doing this right or not.  Can anyone let me know what I'm doing wrong?  Again, if the Sudo command to install the dependencies is supposed to be run in the Truenas Shell, as opposed to the Jail Shell, will it break my existing Emby servers that are  within jails?
 
Thanks,
Chris
Posted

Hey Luke, no I haven't.  I'm still experiencing the same issue as above in my last post.  I'm not sure if I should be running the command

sudo pkg install dotnet libass fontconfig freetype2 mbedtls3 fribidi gnutls iconv opus sqlite3 libtheora libva ocl-icd libvorbis webp libzvbi libraw ImageMagick6 tesseract intel-media-sdk libunwind libinotify openssl icu krb5 libexif libjxl libheif libimagequant openexr openjpeg orc pango tiff

in the TrueNas Shell or the Jail shell.  Running it in the Jail shell, I get the message that Sudo isn't recognized.  I'm afraid to try it in the Truenas shell, as I don't want it to break my current Emby servers.

 

I'd still like to be able to just create a new jail with Emby in it using the command in my original post. 

cd iocage-amd64

iocage fetch -P emby-server.json dhcp="on" ip6="inherit" allow_mlock="on" --branch master

iocage set plugin_repository='https://github.com/MediaBrowser/iocage-amd64.git' emby-server_1

 

As I stated, mbedtls will not install.

 

Will this ever be fixed?

comfy_server
Posted

Why would you need sudo, though? In your screenshots it looked like you were already in the shell as root, so you could call pkg install directly.

Alternatively, it is possible to install something into the jail from outside with pkg -j jailname install. This is actually my preferred method, since I don't like my jails to have pkg installed, and their network connectivity is usually pretty restricted.

Posted

Hi confy_server,

 

So I tried installing without Sudo before the previous post and it did go through an install, but it didn't look like it installed any of the dependencies listed and failed on installing dotnet.  See attachment #1.

I then ran the command pkg add -f https://github.com/MediaBrowser/Emby.Releases/releases/download/4.8.11.0/emby-server-freebsd13_4.8.11.0_amd64.pkg 

I received a message that it couldn't install as it was missing dependency expat, see attachment #2.  I then went though the pkg install for every dependency that it said it was missing as described in my post from April 12th.  It eventually got to "missing shlib dependency libfftw3.so.3."  Executing pkg install libfftw3.so.3 returns an error that it cannot be found.  This is where I gave up.

 

Am I using the correct pkg add command to install server 4.8.11.0?

 

I just want to confirm, I should be running these commands in the Jail's shell, correct?  Not in the TreuNas shell.

 

Can anyone offer any insight or assistance?

 I can migrate to Scale, but I know I will lose the Jail and will have to install Emby and start all over.  I do have a manual backup of my current 4.8.11.0 Emby server.  Would I just be able to restore that and be good with all my movie's picture art and metadata?  I'm not even sure where the location to copy it to is located in Scale since I always copied it to mnt/ChrisNas/iocage/jails/ChrisEmby/root/var/db in Core.

 

I really don't want to migrate to Scale and lose everything, as it is currently the way I want it.

#1.JPG

#2.JPG

nmalinoski
Posted

The reason no packages are matching dotnet is because, by default in a fresh jail, no pkg repos are configured. It seems you need to create /usr/local/etc/pkg/repos/FreeBSD.conf containing (mostly borrowed from plugin-default.conf in my plugin-based emby instance):

FreeBSD: {
	url: "https://pkg.freebsd.org/FreeBSD:13:amd64/latest",
	signature_type: "fingerprints",
	fingerprints: "/usr/share/keys/pkg",
	enabled: true
}

Then you need to run `pkg update -f`. After that, the install command should work fine.

I'm not sure why these steps are missing from the Emby FreeBSD install guide.

Posted

Thanks @nmalinoski, I can definitely give that a try.  Currently, the FreeBSD.conf file in that location only shows:

FreeBSD: {

       enabled: no

}

 

A few questions:

1. So I should just be able to create the file and copy it to the location overwriting the current FreeBSD.conf file?

2. Where do I run the pkg update -f command?  In the TrueNAS shell or the new jail shell?

3. If it is to be run in the TrueNAS shell, will it have any effect on my current Jails?  I do not want to damage them.

 

Thanks,

Chris

nmalinoski
Posted (edited)

On further research, you don't need to create that file; that's really only needed for overriding the defaults, which we're not doing for 4.9.x.

Also, looks like the "dotnet" package is now "dotnet8", and 4.9.x currently still requires mbedtls2 instead of mbedtls3.

 

More comprehensive instructions for Emby 4.9.x beta on TrueNAS 13.1:

  1. Create a new base jail with mlock enabled (name will assumed to be "emby-server") using the host shell:
    iocage create -r 13.4-RELEASE -n emby-server allow_mlock="on" ip6="inherit" ip4_addr="10.2.3.4/24"
  2. Set up your mounts: (Adjust first path for your media dataset. Adjust ro to rw if you want Emby to be able to write to your media dataset.)
    iocage fstab -a emby-server /mnt/[pool]/[dataset] /media nullfs ro 0 0
  3. Start the jail and connect to its console:
    iocage start emby-server
    iocage console emby-server
  4. If you have existing Emby data in another jail or in a backup, copy it to /mnt/[pool]/iocage/jails/emby-server/root/var/db/emby-server now, and it should get picked up by Emby when it starts: (Outside the jail)
    cp -R /mnt/[pool]/iocage/jails/emby-old/root/var/db/emby-server /mnt/[pool]/iocage/jails/emby-server/root/var/db/
    1. If you do this, remember to reset the ownership of this directory. (Inside the jail)
      chown -R emby:emby /var/db/emby-server
  5. Install packages and configure/start Emby:
    pkg update -f
    pkg install dotnet8 libass fontconfig freetype2 mbedtls2 fribidi gnutls iconv opus sqlite3 libtheora libva ocl-icd libvorbis webp libzvbi libraw ImageMagick6 tesseract intel-media-sdk libunwind libinotify openssl icu krb5 libexif libjxl libheif libimagequant openexr openjpeg orc pango tiff
    pkg add -f https://github.com/MediaBrowser/Emby.Releases/releases/download/4.9.0.50/emby-server-freebsd13_4.9.0.50_amd64.pkg
    sysrc emby_server_enable="YES"
    service emby-server start

Notes:

  1. This seems to _only_ work with Emby 4.9.x; you can install 4.8.11.0, but it won't start.

  2. Emby 4.9.0.50 (latest as of writing) currently has a bug that prevents it from scanning library files, so maybe don't use that version. 4.9.0.43 does _not_ have this bug. I have yet to test 4.9.0.48.

  3. There doesn't seem to be any way to install 4.8.11.0 (latest stable as of writing) on TrueNAS Core 13.1. It targets 13.2-RELEASE, which is past EOL, and its upstream package repo has been removed.

Edited by nmalinoski
First bullets weren't needed
Posted

I appreciate you doing this for me.  I may try it or I may just hold out to see if this ever gets fixed.  Mayne it will with a different release of Emby.  I'm thinking I my just try and clone my existing Jail with Emby on it, rename it and make some changes and see if that works or not.

Posted
On 4/22/2025 at 5:41 PM, cgcmgr said:

I appreciate you doing this for me.  I may try it or I may just hold out to see if this ever gets fixed.  Mayne it will with a different release of Emby.  I'm thinking I my just try and clone my existing Jail with Emby on it, rename it and make some changes and see if that works or not.

Has that helped?

Posted

Hey Luke.  I'm actually trying it now on a test machine and it worked.  I was able to create a Jail with Emby 4.9.0.48.  I didn't try any import a previous backup , I just wanted to see if it worked and it did.  The only issue I'm having now is permissions.  I cannot get Emby to see the Media dataset.  I've been working on this for a couple of hours now and no matter what user or group I assign, the new server will not see my dataset and I cannot create a library.

 

Also, since this is Emby 4.9.0.48, would I be able to restore a 4..8.0.11 backup?

Posted

Got it working.  I'm just used to creating a library and seeing the "/" symbol as the first folder.  This always let me know that the permissions were working.  The "/" never showed up.  I played with permissions for hours and could not get it to show.  I finally just typed the path /Media and my library created and found all my movies.  

 

Now this was on a test NAS.  I'd like to be able to do this on my  production NAS and copy over a manual back of emby-server so that everything is like my backup.  Is this possible with since my backup is based on 4.8.11.0?  If not, I'd have to start importing from scratch again?

#1.JPG

#2.JPG

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...