funkwhale_ynh icon indicating copy to clipboard operation
funkwhale_ynh copied to clipboard

Permission errors for album cover

Open llinfrance opened this issue 4 years ago • 5 comments

Hi, I know there are some already open issue with permission error, but I think mine is different: I have an error only for the cover. It works fine importing the music.

To be more specific, I have created a link:

ln -s /Data/Music/Catalogue_MusicBrainz /var/www/funkwhale/import/Catalogue_MusicBrainz

Then I source the virtual environment:

source /var/www/funkwhale/code/virtualenv/bin/activate
export $(cat "/var/www/funkwhale/code/config/.env" | grep -v ^# | xargs)

Finally, I import the music:

export LIBRARY_ID="long-number..."
python /var/www/funkwhale/code/api/manage.py import_files $LIBRARY_ID "/var/www/funkwhale/import/Catalogue_MusicBrainz/a/**/**/**/*" --recursive --noinput --in-place  

Import went well for the music, but not the cover:

Permission denied: '/var/www/funkwhale/media/albums/covers'

I check the ownership of this folder:

drwxr-xr-x 3 funkwhale funkwhale 4096 Nov 11 10:24 .

I also try to add the write permission, but this add a new permission error:

PermissionError: [Errno 13] Permission denied: '/var/www/funkwhale/media/__sized__/albums'

Here I stop changing the permissions of this file to write this issue 😄

Does someone have an idea about this ?

llinfrance avatar Nov 11 '19 21:11 llinfrance

when you do your import, why don't you use the Funkwhale user? https://kb.iu.edu/d/amyi

Jibec avatar Dec 15 '19 09:12 Jibec

su funkwhale -c "mycommand" Asks for a password

Aeris1One avatar Apr 06 '20 11:04 Aeris1One

Le 2020-04-06 13:12, Aeris One a écrit :

su funkwhale -c "mycommand" Asks for a password

try sudo su funkwhale -c "mycommand"

Jibec avatar Apr 06 '20 11:04 Jibec

This account is currently not available EDIT: Solved

Aeris1One avatar Apr 06 '20 11:04 Aeris1One

(virtualenv) admin@16469:/var/www/funkwhale/code$ sudo su funkwhale -c "python api/manage.py import_files $LIBRARY_ID "/home/funkwhale/Music/Music/*" --recursive --noinput"
Traceback (most recent call last):
  File "api/manage.py", line 2, in <module>
    import django
ImportError: No module named django

Aeris1One avatar Apr 06 '20 11:04 Aeris1One

This account is currently not available EDIT: Solved

Should be: sudo su funkwhale -c "mycommand" -s /bin/bash

yalh76 avatar Oct 03 '22 22:10 yalh76