Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Camera Upload on FreeNAS

FinalDoomFinalDoom Members, Plex Pass Posts: 21 Plex Pass

Anyone have experience with or able to get camera upload to work from Android to FreeNAS plex? My android app starts the upload process, and cycles through photos, but always says 567/567 remaining (the thumbnail on the notification changes), and no photos show up in Plex. I'm thinking it's some sort of permissions issue, but plex:plex owns the relevant /var/db/plexdata/Plex Media Server/Media Upload folder, and it's 755 permissions.

I'm a little lost on how to debug this. No errors show up in any logs, not even a hint that any upload is happening.

Best Answer

«1

Answers

  • mikec_ptmikec_pt Members, Plex Employee, Plex Pass, Plex Ninja Posts: 593 Plex Employee

    This could be an android issue... do you see anything the android app logs?
    You could however try to set the server logging to VERBOSE and look for more info.

    In any case I use FreeBSD as a server and regular use Camera Upload on more than one android device and don't see any issues!

    wait.. /var/db ? that should be --> /usr/pbi/plexmediaserver-amd64/plexdata at least that's the dir used by default in FreeNAS, while in FreeBSD its /usr/local/plexdata ...

  • mikec_ptmikec_pt Members, Plex Employee, Plex Pass, Plex Ninja Posts: 593 Plex Employee

    Actually come to think of it I think this changed to "{jail_root}/var/db/plexdata/" so you might be looking in the correct place as long as that dir is inside the jail.. if its a permissions issue however it might be that you have the right "chmod" but not the correct owner..

    can you do (inside the jail) ls -lah /var/db/plexdata/Plex Media Server or add "jail_root" if doing the command in the host's shell.

  • FinalDoomFinalDoom Members, Plex Pass Posts: 21 Plex Pass
    edited July 2015

    I hadn't figured out how to get the Android logs yet, but they were revealing. Lots of lines of:

    07-16 18:07:45.750  i: [CameraUploadService] Upload file IMG_20120324_224208.jpg with URL http://192.168.1.11:32400/library/metadata?locationID=3&sectionID=3&subdirectory=Mobile%20Backup&filename=2012-03-24%2022.42.08.jpg&type=13&createdAt=1332610928&X-Plex-Token=<REMOVED>
    07-16 18:07:46.126  w: [CameraUploadService] Unexpected return code: 500
    

    As for the directories, the camera upload documentation is a little sparse, but the linux paths pointed there, and they matched in the jail, for once. I only have plexmediaserverUI in the /usr/pbi path, as far as plex named things go. I think there was more in there. Maybe an upgrade moved things around.

    # ls -lah /var/db/plexdata/Plex\ Media\ Server/
    total 216
    drwxr-xr-x  12 plex  plex     13B Jul 16 19:28 .
    drwxr-xr-x   3 root  wheel     3B Mar 27 19:28 ..
    drwxrwxrwx   4 plex  plex      6B Jul 16 20:52 Cache
    drwxrwxrwx   3 plex  plex      3B Mar 27 19:29 Library
    drwxrwxrwx   3 plex  plex     29B Jul 16 19:28 Logs
    drwxrwxrwx   3 plex  plex      3B Mar 27 19:31 Media
    drwxr-xr-x   2 plex  plex      2B Jul 16 16:33 Media Upload
    drwxrwxrwx   6 plex  plex      6B May 24 22:10 Metadata
    drwxrwxrwx   7 plex  plex      7B Mar 27 19:29 Plug-in Support
    drwxrwxrwx  34 plex  plex     34B Jul 11 04:35 Plug-ins
    -rw-------   1 plex  plex    1.2k Jul 16 19:28 Preferences.xml
    drwxrwxrwx   2 plex  plex      2B Mar 27 19:31 Scanners
    drwxr-xr-x   3 plex  plex      3B May 21 19:05 Thumbnails
    

    Actually, now, looking at that, Media Upload looks a little wrong, or at least inconsistent. I'm not sure why group or other writable should matter if the plex user (that I'd expect) is doing the writing.

    And... that fixed it. I changed back to the default upload settings (Mobile Photos library and so on), chmod +w Media\ Upload and it's working. Odd that it didn't work out of the box.

    Thanks for the suggestions!

  • FinalDoomFinalDoom Members, Plex Pass Posts: 21 Plex Pass

    Here's an oddity. I turned camera upload off to see if I could upload to the Photos main library, and in an album, and it's reset the permissions back to 755 not 777. And I just tried setting it back, and it doesn't stick. Hm.

  • FinalDoomFinalDoom Members, Plex Pass Posts: 21 Plex Pass
    edited July 2015

    Yup, that is the case. (That there's a folder inside Media Uploads called Mobile Photos, with plex:plex and 755 permissions).

    I can upload into the Photo library as well, by making the folder it's based in is group writable and group is plex. Probably I can keep it root:wheel, but I'll have to mess about with the permissions later.

    It would be nice to be able to configure a secondary "upload" folder for Photo libraries, so I don't have to mux the permissions for my media folders.

  • mikec_ptmikec_pt Members, Plex Employee, Plex Pass, Plex Ninja Posts: 593 Plex Employee
    edited July 2015

    Well you can certainly create a "Photo Library" first (using the Web App)...

    Say you want all photos in the same place you have you're media... just create a folder for it, make sure the permissions are correct (just like you do for you're media)... you can even copy over the photos you have already on the "Mobile Photos" library... or just leave it empty as all mobile photos will be synced next.

    Now on android instead of using a "New Library" just select the existing one, the one you've just created on the Web App.

    This way you can use whatever folder you want, in any 'place' in you're PMS :)

  • RockyTop11RockyTop11 Members, Plex Pass Posts: 8 Plex Pass

    Can someone help break down the required steps needed in order to rectify the issue listed here originally? I have the same problem but am having trouble following the steps listed.

    Thank you!

  • mikec_ptmikec_pt Members, Plex Employee, Plex Pass, Plex Ninja Posts: 593 Plex Employee

    @RockyTop11 you mean on the FreeNAS side?

    All you should need is make sure "/var/db/plexdata/Plex\ Media\ Server/" is writable by "plex" you could just make sure that the Media Upload folder as write access but plex should have access (rw) to everything bellow "/var/db/plexdata/" anyway.

    If the issue is how do I do this on FreeNAS...

    You need to login to you're freenas host, and then initiate a shell on the jail...

    The way I do it is login to the freenas host using ssh and then use jexec {jail_name_or_number} csh this will get you inside the jail where you can execute the ls and chmod commands.

    let me know if this helps or where you are stuck and I'll see if I can give you a list of steps...

  • RockyTop11RockyTop11 Members, Plex Pass Posts: 8 Plex Pass
    edited July 2016

    @mikec_pt thank you for getting back with me!!

    So, I went into the directory you mentioned and all folders in the /var/db/plexdata/ folder have plex:plex (not sure what each column means) listed. However, I don't have my "Phone Upload" folder set to that location. I have it set to upload to a folder called "Phone" in the "plexmediaserver_1" jail and the destination of "/media/Pictures/Phone" folder. I set those settings on my phone Plex app. In there, the permissions vary, with the majority of the folders being owned, etc by 1001 (my user I created, will) or root.

    The $ ls -lah command in that folder shows the below information for the folder mentioned above...

    dr-xrwxr-x+ 2 root 1001 673B Jul 9 00:24 Phone

    Does this help?

    Thank you!

  • mikec_ptmikec_pt Members, Plex Employee, Plex Pass, Plex Ninja Posts: 593 Plex Employee
    edited July 2016

    plex:plex means {owner_user}:{group}

    the plex user must own (or have access using acls) the /media/Pictures/Phone directory, so I.E.: chown -R plex:plex /media/Pictures/Phone

    This is the same as in any other Library, like movies, tv shows... plex should own that dir, the group is not mandatory but if this is just for plex it should be ok

    rw permissions look ok so it should work

  • RockyTop11RockyTop11 Members, Plex Pass Posts: 8 Plex Pass

    @mikec_pt Thank you, again. I went into the /media/Pictures/ directory and typed chown +R plex:plex Phone ...I received an "illegal user name" error...

    I went into the FreeNAS web config and didn't see a plex user or plex group listed...How could that be if other folders are designated to that user/group?

    Feel free to PM me if you feel that would be better to continue this. Again, greatly appreciate the help in troubleshooting this!

  • mikec_ptmikec_pt Members, Plex Employee, Plex Pass, Plex Ninja Posts: 593 Plex Employee

    my bad I missedtyped +R its -R, R is a flag for recursive mode

  • RockyTop11RockyTop11 Members, Plex Pass Posts: 8 Plex Pass
    edited July 2016

    IT WORKED!!!! Thank you VERY MUCH @mikec_pt !!

    Final question: Should the permissions of the other folders being 1001 or root for users or groups be of concern in the /media/ folders?

    Thank you, again!

  • mikec_ptmikec_pt Members, Plex Employee, Plex Pass, Plex Ninja Posts: 593 Plex Employee

    @RockyTop11 said:
    IT WORKED!!!! Thank you VERY MUCH @mikec_pt !!

    Final question: Should the permissions of the other folders being 1001 or root for users or groups be of concern in the /media/ folders?

    Thank you, again!

    If you're seeing that in the host its normal, the user only exists inside the jail.

  • RockyTop11RockyTop11 Members, Plex Pass Posts: 8 Plex Pass

    @mikec_pt I think I understand what you are saying...Basically, don't worry about it? Thank you, again!

  • marktheredmarkthered Members, Plex Pass Posts: 30 Plex Pass
    edited August 2016

    I'm having the same problem, but I cannot get the above solution to work.

    How do I find out which user "plex" is from inside Freenas? The code above gives me an error message because there is no user / group plex. "chown: plex: illegal group name"

    I know this is easy for most of you, but my ssh console knowledge is very limited.

  • mikec_ptmikec_pt Members, Plex Employee, Plex Pass, Plex Ninja Posts: 593 Plex Employee

    @markthered the user is created inside the JAIL not the host it self,if you wan to user "chmod ..... plex" then you need to run that command in the jail... alternatively you could use uid/gid...

    In any case to access the jail shell use --> jexec [Jail_ID] csh

  • marktheredmarkthered Members, Plex Pass Posts: 30 Plex Pass

    OK. I'll level with you. I followed the Freenas videos to get to where I am right now. Coding in Linux is not my forte. Below is what I am getting when I write your code. What am I doing wrong? I'm one of those normies who bought Plex with the hope I didn't have to learn code to make a feature work that Plex is advertising. What am I missing in my code below?

  • mikec_ptmikec_pt Members, Plex Employee, Plex Pass, Plex Ninja Posts: 593 Plex Employee

    You're not coding ... You're just using them command line, if you're not familiar with it, there's a lot of other platforms that PLEX supports and might suite you best (i.e. Windows)

    Creating directores and assigning permissions is something you would do in any system regardless of the software you might use to access those directories... I.E. for plex to access youre media you had to create the folders with the correct permissions.

    Of course the FreeNAS plug-in helps a bit, but it's also creating a jail which makes it more complex for users that are not familiar with this...

    Anyway with that said in the command I provided you [jail_id] should be substituted by the jail ID or even name.

    Also you don't really need to fix this permissions inside the jail if you don't want to... You can use the Plex Web App to create a Library as you would do for any other content, just choose Photos and then in the Android client you can choose the Upload Library to be an existing one rather then the one created by the server.

    If you need help with the Android side let me know.

«1
Sign In or Register to comment.