devsnd / cherrymusic

Stream your own music collection to all your devices! The easy to use free and open-source music streaming server.
http://www.fomori.org/cherrymusic
GNU General Public License v3.0
1.03k stars 187 forks source link

port setup - access denied #607

Closed JDNooB closed 8 years ago

JDNooB commented 8 years ago

Hi, I'm new to Pi's and still taking baby steps so probably a stupid oversight but here goes. I installed volumio on my pi2. found cherry pi and the github pages. followed the steps to install python, cherrypy and cherrymusic, so far so good.

I got to the port set up, ran the command and I get Err13 permission denied. please can anyone point me in the right direction, what am I missing?? Here's the text following the command...

volumio@volumio:~$ python /opt/cherrymusic/cherrymusic --setup --port 8800
Traceback (most recent call last):
  File "/opt/cherrymusic/cherrymusic", line 33, in <module>
    import cherrymusicserver
  File "/opt/cherrymusic/cherrymusicserver/__init__.py", line 166, in <module>
    from cherrymusicserver import configuration as cfg
  File "/opt/cherrymusic/cherrymusicserver/configuration.py", line 45, in <modul                                                                             e>
    from cherrymusicserver import util
  File "/opt/cherrymusic/cherrymusicserver/util.py", line 39, in <module>
    from cherrymusicserver import log
  File "/opt/cherrymusic/cherrymusicserver/log.py", line 84, in <module>
    handler_file_error = logging.FileHandler(os.path.join(pathprovider.getUserDa                                                                             taPath(), 'error.log'), mode='a', delay=True)
  File "/opt/cherrymusic/cherrymusicserver/pathprovider.py", line 57, in getUser                                                                             DataPath
    assureFolderExists(userdata,['db','albumart','sessions'])
  File "/opt/cherrymusic/cherrymusicserver/pathprovider.py", line 134, in assure                                                                             FolderExists
    os.makedirs(dirpath)
  File "/usr/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/usr/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/usr/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/volumio/.local'
volumio@volumio:~$

EDIT: Formatted console output correctly. Please use Markdown to format code next time. -- 6arms1leg

devsnd commented 8 years ago

Hi JDNooB,

CherryMusic stores it's data in the home folder of your user, in your case thats /home/volumio/.local. It seems however, that this directory .local does not exist and that the user that runs charrymusic is also not allowed to create the directory.

You can try to create the directory manually as root and then to give it to the user:

sudo mkdir /home/volumio/.local
sudo chown volumio /home/volumio/.local

This should create a .local folder in which your user volumio may write, because it belongs to him.

JDNooB commented 8 years ago

Hi devsnd and thanks for the response- I really appreciate the support! Tried your approach but no joy.
Am I inputting your commands in the right place? there does not seem to be any response it just gives me a new prompt..

volumio@volumio:~$ sudo mkdir /home/volumio/.local
volumio@volumio:~$ sudo chown volumio /home/volumio/.local
volumio@volumio:~$ python /opt/cherrymusic/cherrymusic --setup --port 8800
Traceback (most recent call last):
  File "/opt/cherrymusic/cherrymusic", line 43, in <module>
    """ + cherrymusicserver.pathprovider.configurationFile() + """
  File "/opt/cherrymusic/cherrymusicserver/pathprovider.py", line 102, in configurationFile
    return os.path.join(getConfigPath(), configFileName)
  File "/opt/cherrymusic/cherrymusicserver/pathprovider.py", line 77, in getConfigPath
    assureFolderExists(configpath)
  File "/opt/cherrymusic/cherrymusicserver/pathprovider.py", line 134, in assureFolderExists
    os.makedirs(dirpath)
  File "/usr/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/volumio/.config'
volumio@volumio:~$

EDIT: Formatted console output correctly. Please use Markdown to format code next time. -- 6arms1leg

systems-rebooter commented 8 years ago

Hey @JDNooB

I believe you will need to issue same steps, devsnd mentioned above, for .config folder as well:

sudo mkdir /home/volumio/.config
sudo chown volumio /home/volumio/.config
JDNooB commented 8 years ago

systems-rebooter and devsnd, thanks for the help - updated the config as well and voila!!

6arms1leg commented 8 years ago

Great to hear that it works now, @JDNooB ! But... hmmm, a user that has no write access to his own home directory sounds wrong. Setting up CherryMusic on that server seems "adventurous". You might consider having a look at our Wiki. There are a few guides (for different systems) to install and configure CherryMusic easily and safely. Since Volumio is Debian-based, I recommend this guide in particular. Have fun!