Jump to content

New Plugin - Disk Space


chef

Recommended Posts

What you mean to say is your system is denying the server permission to query your drives.

 

i'm looking to see if .netstandard has permission to access drive info. Good news is that it looks like Ubuntu honors GetDrives in .netcore.

Link to comment
Share on other sites

Mind sending it? I believe I deleted that version

 

Sent from my SM-G973U using Tapatalk

Check the dl at the top, that has been fixed.

Link to comment
Share on other sites

Demanding Permission settings for reading folders might need a nuget library installed.

 

That could be an issue.

Edited by chef
Link to comment
Share on other sites

4.4.0.6 on ubuntu server, seem to not work, white screen

 

edit:

 

2020-01-10 17:29:42.941 Error HttpServer: Error processing request

*** Error Report ***

Version: 4.4.0.6

Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb

Operating system: Unix 5.0.0.37

64-Bit OS: True

64-Bit Process: True

User Interactive: True

Runtime: file:///opt/emby-server/system/System.Private.CoreLib.dll

System.Environment.Version: 3.1.0

Processor count: 4

Program data path: /var/lib/emby

Application directory: /opt/emby-server/system

System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path is denied.

---> System.IO.IOException: Permission denied

--- End of inner exception stack trace ---

at System.IO.DriveInfo.CheckStatfsResultAndThrowIfNecessary(Int32 result)

at System.IO.DriveInfo.get_TotalSize()

at DiskSpace.DiskSpaceService.<>c.<Get>b__6_0(DriveInfo d)

at System.Linq.Enumerable.SelectArrayIterator`2.ToList()

at DiskSpace.DiskSpaceService.Get(GetDriveData request)

at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost appHost, Object requestDto, IRequest req)

at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, RestPath restPath, String responseContentType, CancellationToken cancellationToken)

at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, CancellationToken cancellationToken)

Source: System.IO.FileSystem.DriveInfo

TargetSite: Void CheckStatfsResultAndThrowIfNecessary(Int32)

InnerException: System.IO.IOException: Permission denied

Source:

TargetSite:

 

Quick question, do you have drives on your system that are not accessed by Emby?

 

I'm wondering (if you do) then that drive wouldn't have Access control rights with emby and therefore would error.

 

@@chacawaca

Edited by chef
Link to comment
Share on other sites

Sure, 

Where do i put the dll?

Wow i feel like a newb, i responded to a DM on a forum post. 

Its been that kind of week. 

Edited by tdiguy
  • Like 1
Link to comment
Share on other sites

Sure, 

Where do i put the dll?

 

Emby-Server\programdata\plugins

 

You'd have to restart the server to load the new file.

 

There maybe issues with Permissions accessing the Drive Collection, so I'm interested in how you get on.

 

Thanks for you time :)

Edited by chef
Link to comment
Share on other sites

This doesn't look right..

Server is a ubuntu 18 lts5e19251441edf_Untitled.png

You're right, that is strange.

 

Chalk that up to a possible bug in .netStandard for sure.

 

Those are not top tier drive letters.

 

Thank you for taking the time.

Edited by chef
Link to comment
Share on other sites

You're right, that is strange.

 

Chalk that up to a possible bug in .netStandard for sure.

 

Those are not top tier drive letters.

 

Thank you for taking the time.

It does end up listing nearly every mount point. I am not sure why some of those are there but it does list /media/emby and a few other mount points. I just dont understand how and why it decided to display which folders and mount points.

Link to comment
Share on other sites

I guess try and use Environment/Drives emby endpoint to get only the drive letters the user has added to emby, and then use FileInfo classes to get the data. DriveInfo in .netcore seems to have some issues.

Edited by chef
Link to comment
Share on other sites

Jdiesel

I guess try and use Environment/Drives emby endpoint to get only the drive letters the user has added to emby, and then use FileInfo classes to get the data. DriveInfo in .netcore seems to have some issues.

Is this helpful?

 

https://github.com/Sonarr/Sonarr/blob/7d06e5d6842e6b81b8d4b4b0ab94f5bfba21cae6/src/NzbDrone.Common/Disk/DriveInfoMount.cs

  • Like 1
Link to comment
Share on other sites

Yes sir, thank you. That is pretty much what's happening here. Using DriveInfo to get drive info.

 

I've changed the plugin a bit so if there are permission errors then the UI will let the user know that they have to allow access control. That part can't be automated because we can't demand control rights.

 

As far as Linux users experiencing extra mounts being listed, I think the best that can happen would be to check the TotalSpace of each mount and ignore responses with 0 bytes.

 

Thanks @@Jdiesel

Link to comment
Share on other sites

@@Luke :)

 

I  integrated the IFileSystem interface from the Emby api to get drive paths that are specific to what emby users add to their libraries.

 

 

I have a theory that by requesting drives specific to emby libraries, that there are better odds accessing drive data through the plugin.

 

 

We know that linux honors the DriveInfo Namespace through .netstandard, but the use of 'GetDrives()' was either hitting an 'UnauthorizedAccessException' or returning too many mounting points that had nothing to do with allocated space for  emby libraries.

 

To handle the 'UnauthorizedAccessException' the plugin will put a message in an h1 which lets the user know that emby doesn't have access to drive data, and I can code a 'help' button which can bring the user to either a thread here, or (maybe better) a wiki page to allow access control for emby to their drives.

 

@@tdiguy (since you're on linux and you  where able to get drive access) would you mind trying the version of the plugin posted below, it'd be great to see if you are able to get a more refined result now?

@@chacawaca (since you where not able to gain access to drive data) would you mind trying this version of the plugin posted below, you'll most likely see the Access control error?

 

 

 

DOWNLOAD: DiskSpace.zip

Link to comment
Share on other sites

chacawaca

this version work, but like tdiguy i have a shit load of path. Maybe if we can filter them that will be nice.

Link to comment
Share on other sites

this version work, but like tdiguy i have a shit load of path. Maybe if we can filter them that will be nice.

Okay, do the paths start with a '\' by chance?

Link to comment
Share on other sites

@@tdiguy, quick question, did you mean that there where more drives listed then what was in that picture posted above?

Well, its odd because much of what it shows as drives are not drives at all, but yes there were more "drives" than what was pictured, i could not fit them all in one clipping.

If there is a way to limit what is shown to what is shown with something like the df -h command it would be more useful.

  • Like 1
Link to comment
Share on other sites

chacawaca

better, but stil have a lot of useless thing,

 

/dev

/run

/dev/shm

/run/lock

/sys/fs/cgroup

/snap/lxd

/snap/...  4-5 snap rep

/run/snapd/ns

 

and major problem / isnt there anymore so we dont have our main harddrive. only mounted one is there

  • Like 1
Link to comment
Share on other sites

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...