2 Permissions issues; using unraid SMB shares as remote volume for docker stacks in portainer


Recommended Posts

Hi,

 

Not sure if this is the correct forum for this post but it related to SMB shares that I am trying to mount as volumes for docker containers on another machine on the network. Sorry if this is the incorrect place.

 

I am new to unraid/portainer and relatively new to docker-compse.

 

I am trying to use portainer to manage my docker containers. Portainer is running on my unraid box and a portainer-agent is running on a NUC that I want to use for plex (hardware transcoding) and nextcloud. I am setting up stacks on the portainer-agent via the portainer interface accessed on my unraid box.

 

I have mariadb and nginxproxymanager running successfully on my portainer-agent with remote volumes mapped.

 

I am using the LSIO images for nextcloud, mariadb and plex.

 

nginxproxymanager:

I did not set a UID or GID for this stack and have mapped the volumes to my appdata on my unraid box.

 

Nextcloud:

I have set the UID and GID to the same as a user I created on my unraid instance that has read/write permissions to both my cache (housing docker appdata) and my zfs share. In my troubleshooting I have also created the same user on the portainer-agent node with the same UID and GID.

 

I can get nextcloud up and running but when I try to access the webui (and the same message is repeated in the container logs) I see that the config file is RO and that allowing the webserver to access the dir is a common fix. I have tried just about every permission set I can think of with no luck.

 

Plex:

The container does not start and I wind up with the following error in the container log:

libc++abi: terminating with uncaught exception of type boost::filesystem::filesystem_error: boost::filesystem::create_directories: Permission denied [system:13]: "/config/Library/Application Support/Plex Media Server/Cache", "/config/Library/Application Support/Plex Media Server"

/etc/s6-overlay/s6-rc.d/init-plex-claim/run: line 63:   136 Aborted                 (core dumped) s6-setuidgid abc /bin/bash -c 'LD_LIBRARY_PATH=/usr/lib/plexmediaserver:/usr/lib/plexmediaserver/lib /usr/lib/plexmediaserver/Plex\ Media\ Server'

 

Volume definitions:

volumes:
  nginxproxymanager_config:
    driver_opts:
      type: cifs
      o: "username=$USER,password=$USERPASS,nobrl"
      device: "//$IPADDR/appdata/nginxproxymanager/config"
  nginxproxymanager_letsencrypt:
    driver_opts:
      type: cifs
      o: "username=$USER,password=$USERPASS,nobrl"
      device: "//$IPADDRR/appdata/nginxproxymanager/letsencrypt"

 

Link to comment

Be sure that the appdata share is enabled for smb:

image.thumb.png.d6eed5c56c3537d136b650f5de10e443.png

 

Under settings samba:

image.thumb.png.01e1e35f0b98c5e2351743c7893efbed.png

 

Under SMB extra, you may need to add:

##############################

[global]

#Protocols:
    domain master = yes
    preferred master = yes
    os level = 200
    server role = standalone server

#Identification:
    netbios aliases = %hostnameofYourUnriadBoX
    server string = Samba Server Version %v

################################

 

you should then test to make sure you can access the samba share via \\$IPADDRR\appdata\nginx

 

The extra setting will make unraid the NetBIOS samba master on the network and in control of the windows wsd name servers for ip access and samba windows sharing...

 

You may be hitting a file permission execution issues, the folder share is not setup to be read or written to by the others in your case you may need to run the following commands:

 

chmod -R 777 /folder path

and chmod -R 777 * to all files in that path

 

then chown -R nobody:nogroup /folder path

then with in the folder chown -R nobody:nogroup *

 

This will allow any account "read/ write/ execute/ access" from anywhere. As we don't know what your PORTAINER account is using for permission to run or access the samba share file.

 

?why not use unraids docker instance? I have fond PORTAINER to be ok but absolute garbage. Also, what PORTAINER instance are you running? Windows PORTAINER will not run unraid appdata dockers. Different host layers...

 

Also from your post you need to use \\ in your volume definitions

 

// mean that local machine. \\ outside local machine

 

Edited by bmartino1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.