YunoHost-Apps / funkwhale_ynh

A modern, convivial and free music server on YunoHost
https://funkwhale.audio/
GNU Affero General Public License v3.0
72 stars 22 forks source link

funkwhale-beat doesn't start #198

Closed isAAAc closed 1 year ago

isAAAc commented 1 year ago

Describe the bug

funkwhale-beat doesn't start

Context

Steps to reproduce

Expected behavior

funkwhale-beat should running

Logs

When an operation fails, YunoHost provides a simple way to share the logs.

root@krashboyz:~# yunohost service status funkwhale-beat configuration: unknown description: funkwhale celery beat process last_state_change: 2023-02-23 17:59:57 start_on_boot: enabled status: failed


i found those closed tickets:
https://github.com/YunoHost-Apps/funkwhale_ynh/issues/111
https://github.com/YunoHost-Apps/funkwhale_ynh/issues/147
isAAAc commented 1 year ago

https://github.com/YunoHost-Apps/funkwhale_ynh/issues/111#issuecomment-705200932 can't use this path:

root@krashboyz:~# ls -al /var/www/funkwhale/code/api/
ls: cannot access '/var/www/funkwhale/code/api/': No such file or directory
root@krashboyz:~# ls -al /var/www/funkwhale/code/
ls: cannot access '/var/www/funkwhale/code/': No such file or directory
root@krashboyz:~# ls -al /var/www/funkwhale
total 24
drwxr-x---   6 funkwhale www-data 4096 Dec 25 17:14 .
drw-r-xr-x+ 34 root      root     4096 Feb 22 19:29 ..
drwxr-x---   6 funkwhale www-data 4096 Dec 25 17:17 api
drwxr-x---   2 funkwhale www-data 4096 Dec 25 17:16 config
drwxrwx---   3 funkwhale www-data 4096 Dec 25 17:13 front
drwxrwx---   6 funkwhale www-data 4096 Dec 25 17:14 virtualenv

https://github.com/YunoHost-Apps/funkwhale_ynh/issues/147#issuecomment-880857666 works:

root@krashboyz:~# mv /var/www/funkwhale/api/celerybeat-schedule.db /var/www/funkwhale/api/celerybeat-schedule_old.db

root@krashboyz:~# yunohost service start funkwhale-beat
Success! Service 'funkwhale-beat' started

root@krashboyz:~# yunohost service status funkwhale-beat
configuration: unknown
description: funkwhale celery beat process
last_state_change: 2023-02-23 18:06:41
start_on_boot: enabled
status: running
stilobique commented 1 year ago

Solved this issue with your comment.

Edit : On each restart, I need to fix this issue :/ .

isAAAc commented 1 year ago

@stilobique , after upgrade last month, i lost some tracks: they were listed , but the app can't find them,

did you have the same ? i foud back them after a rollback.

now i would upgrade again and have a look directly on it, i don't know if it is related with this issue.

upgrade to do : Funkwhale (funkwhale) from 1.2.10~ynh2 to 1.2.10~ynh3

isAAAc commented 1 year ago

ok , i just tried, it is failing, even i apply the workaround.

should i open a new issue ?

stilobique commented 1 year ago

Hum, I have another some strange issue, but hard to know if an old issue or come with the last update. I don't have the time to search what and why ; maybe in 3/4 week I can look to fix and opening another issue.

isAAAc commented 1 year ago

ok, all is tracked here, i won't open a new issue for now, just staying in 1.2.10~ynh2 + workaround

keep in touch ;)

isAAAc commented 1 year ago

trying Funkwhale (funkwhale) from 1.2.10~ynh2 to 1.3.0~ynh1 at this moment :crossed_fingers:

isAAAc commented 1 year ago

like last time, I can't hear the track I'm using to test whether it works ( https://son.krashboyz.org/library/tracks/2 ) .

-> rollback to version: 1.2.10~ynh2 + workaround -> I can listen to the track

I don't know how I can help you to help me :/

tell me anything you need for the debug @stilobique

Thovi98 commented 1 year ago

Could you please try to upgrade to latest testing and tell me if it works? If not, please share your nginx logs.

Some changes have been made to nginx in testing that may solve your issue

isAAAc commented 1 year ago

upgrade complete but seems to be the same version as on maintream ?

version: 1.3.0~ynh1

i did: yunohost app upgrade funkwhale -u https://github.com/YunoHost-Apps/funkwhale_ynh/tree/testing --debug

logs are there : https://paste.yunohost.org/raw/ozaseweqoy

running tests : KO

Thovi98 commented 1 year ago

I'm on my phone so it's difficult to look at all your logs right now, but can you paste here the directory of your media files?

And what's the workaround you are talking about?

isAAAc commented 1 year ago

And what's the workaround you are talking about?

this one in the present ticket: https://github.com/YunoHost-Apps/funkwhale_ynh/issues/198#issuecomment-1442131985 , but it works only when i rollback on version: 1.2.10~ynh2 as mentionned

I'm on my phone so it's difficult to look at all your logs right now, but can you paste here the directory of your media files?

humm i re-upgrade from testing, i probably didn't cecked the good path on the fist try ...

# yunohost app upgrade funkwhale -u https://github.com/YunoHost-Apps/funkwhale_ynh/tree/testing --debug

OK,
i think we found somethting yes:

(after upgrade from testing): the old data folder is still existing, but .env file hasn't the good path for it, OR, a mv is missing to put old data dir to the new path declared in the .env:

root@krashboyz:/var/www/funkwhale/config# ls -al /home/yunohost.app/funkwhale/media
total 28
drwxr-x---  7 funkwhale www-data 4096 Dec 14 21:34 .
drwxr-x---  6 funkwhale www-data 4096 Jun  8 18:55 ..
drwxr-x--- 28 funkwhale www-data 4096 Mar 13 19:53 attachments
drwxr-x---  3 funkwhale www-data 4096 Dec 12 20:54 federation_cache
drwxr-x---  3 funkwhale www-data 4096 Jan  9  2022 __sized__
drwxr-x--- 76 funkwhale www-data 4096 Dec 13 11:26 tracks
drwxr-x---  3 funkwhale www-data 4096 Dec 14 21:34 transcoded

root@krashboyz:/var/www/funkwhale/config# cat .env |grep media
# Where media files (such as album covers or audio tracks) should be stored
MEDIA_ROOT=/home/yunohost.app/funkwhale/data/media
# If you want to serve media directly from your S3 bucket rather than through a proxy,
# If you are using Amazon S3 to serve media directly, you will need to specify your region

\o/ we are near the solution i think @Thovi98

EDIT:

Thovi98 commented 1 year ago

MEDIA_ROOT=/home/yunohost.app/funkwhale/media

Strange enough, how is it possible your media directory is /home/yunohost.app/funkwhale/media and not /home/yunohost.app/funkwhale/data/media ?

So the solution would be to upgrade to 1.3.0 and then mv /home/yunohost.app/funkwhale/media /home/yunohost.app/funkwhale/data/media.

Could you please try?

And it’s still unclear for me what’s your workaround: are you speaking of mv /var/www/funkwhale/api/celerybeat-schedule.db /var/www/funkwhale/api/celerybeat-schedule_old.db?

Thovi98 commented 1 year ago

Be sure to have a backup of all your media files before proceeding!

isAAAc commented 1 year ago

@Thovi98 : just tried, the track can't be read...

i tried the workaround too, but it doesn't work neither...

i'm really lost :/

And it’s still unclear for me what’s your workaround: are you speaking of mv /var/www/funkwhale/api/celerybeat-schedule.db /var/www/funkwhale/api/celerybeat-schedule_old.db?

yes , as mentionned here: https://github.com/YunoHost-Apps/funkwhale_ynh/issues/147#issuecomment-880857666

root@krashboyz:~# yunohost --version
yunohost: 
  repo: stable
  version: 11.1.21.3
yunohost-admin: 
  repo: stable
  version: 11.1.10
moulinette: 
  repo: stable
  version: 11.1.4
ssowat: 
  repo: stable
  version: 11.1.4
root@krashboyz:~# yunohost app info funkwhale
description: Convivial and modern music server
domain_path: son.krashboyz.org/
name: Funkwhale
version: 1.3.0~ynh2
root@krashboyz:~# grep MEDIA /var/www/funkwhale/config/.env
MEDIA_ROOT=/home/yunohost.app/funkwhale/data/media
# PROXY_MEDIA=false
root@krashboyz:~# ls -al /home/yunohost.app/funkwhale/data/media
total 28
drwxr-x---  7 funkwhale www-data 4096 Dec 14 21:34 .
drwxr-xr-x  4 root      root     4096 Jun 13 12:13 ..
drwxr-x--- 28 funkwhale www-data 4096 Mar 13 19:53 attachments
drwxr-x---  3 funkwhale www-data 4096 Dec 12 20:54 federation_cache
drwxr-x---  3 funkwhale www-data 4096 Jan  9  2022 __sized__
drwxr-x--- 76 funkwhale www-data 4096 Dec 13 11:26 tracks
drwxr-x---  3 funkwhale www-data 4096 Dec 14 21:34 transcoded
total 20
drwxr-x---  5 funkwhale www-data 4096 Jun 13 12:13 .
drwxr-xr-x 16 root      root     4096 Jun  8 19:57 ..
drwxr-xr-x  4 root      root     4096 Jun 13 12:13 data
drwxr-x---  2 funkwhale www-data 4096 Sep  8  2021 music
drwxr-x---  7 funkwhale www-data 4096 Sep  8  2021 static

root@krashboyz:~# chown -R funkwhale:www-data /home/yunohost.app/funkwhale/data

but it is not better , i'm going crazy

Thovi98 commented 1 year ago

Could you try some tracks and send your nginx logs?

isAAAc commented 1 year ago

nginx says error 404: https://krashboyz.org/zerobin/?4a9a6ca94a057bed#Dh3368vPyEJCrYr28SnqK38kcpNfTYdsCSpeZQ6ibHsv

Thovi98 commented 1 year ago

Could you share me your actual nginx.conf? I think you will find it in /etc/nginx/conf.d/son.krashboyz.org.d/funkwhale.conf

And can you share the result of ls -lah /home/yunohost.app/funkwhale/data/music/ ls -lah /home/yunohost.app/funkwhale/data/media/

ls -lah /home/yunohost.app/funkwhale/music/ ls -lah /home/yunohost.app/funkwhale/media/

Thanks

isAAAc commented 1 year ago
root@krashboyz:/home/yunohost.app/funkwhale/data/media# cat /etc/nginx/conf.d/son.krashboyz.org.d/funkwhale.conf
root /var/www/funkwhale/front/dist;

location /api/ {

  # global proxy conf
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_set_header X-Forwarded-Host $host:$server_port;
  proxy_set_header X-Forwarded-Port $server_port;
  proxy_redirect off;

  # websocket support
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection $connection_upgrade;

  # this is needed if you have file import via upload enabled
  client_max_body_size 100M;
  proxy_pass   http://127.0.0.1:5000;
}

location / {
  alias /var/www/funkwhale/front/dist/;
  expires 1d;
  try_files $uri $uri/  /index.html;
}

location /embed.html {
  more_set_headers "Content-Security-Policy: connect-src https: http: 'self'; default-src 'self'; script-src 'self' unpkg.com 'unsafe-inline' 'unsafe-eval'; style-src https: http: 'self' 'unsafe-inline'; img-src https: http: 'self' data:; font-src https: http: 'self' data:; object-src 'none'; media-src https: http: 'self' data:";
  more_set_headers "Referrer-Policy: strict-origin-when-cross-origin";

  alias /var/www/funkwhale/front/dist/embed.html;
  expires 1d;
}

location /federation/ {

  # global proxy conf
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_set_header X-Forwarded-Host $host:$server_port;
  proxy_set_header X-Forwarded-Port $server_port;
  proxy_redirect off;

  # websocket support
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection $connection_upgrade;

  proxy_pass   http://127.0.0.1:5000/federation/;
}

# You can comment this if you do not plan to use the Subsonic API
location /rest/ {

  # global proxy conf
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_set_header X-Forwarded-Host $host:$server_port;
  proxy_set_header X-Forwarded-Port $server_port;
  proxy_redirect off;

  # websocket support
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection $connection_upgrade;

  proxy_pass   http://127.0.0.1:5000/api/subsonic/rest/;
}

location /.well-known/ {

  # global proxy conf
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_set_header X-Forwarded-Host $host:$server_port;
  proxy_set_header X-Forwarded-Port $server_port;
  proxy_redirect off;

  # websocket support
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection $connection_upgrade;

  proxy_pass   http://127.0.0.1:5000;
}

location /media/__sized__/ {
  alias /home/yunohost.app/funkwhale/data/media/__sized__/;
  more_set_headers "Access-Control-Allow-Origin: *";
}

location /media/attachments/ {
  alias /home/yunohost.app/funkwhale/data/media/attachments/;
  more_set_headers "Access-Control-Allow-Origin: *";
}

# This is an internal location that is used to serve
# media (uploaded) files once correct permission / authentication
# has been checked on API side.
# Comment the "NON-S3" commented lines and uncomment "S3" commented lines
# if you're storing media files in a S3 bucket.
location ~ /_protected/media/(.+)/ {
  internal;
  alias  /home/yunohost.app/funkwhale/data/media/$1;                                 # NON-S3
# Needed to ensure DSub auth isn't forwarded to S3/Minio, see #932.
# proxy_set_header Authorization "";                                  # S3
# proxy_pass $1;                                                      # S3
  more_set_headers "Access-Control-Allow-Origin: *";
    }

location /_protected/music/ {
  # this is an internal location that is used to serve
  # audio files once correct permission / authentication
  # has been checked on API side
  # Set this to the same value as your MUSIC_DIRECTORY_PATH setting
  internal;
  alias   /home/yunohost.app/funkwhale/data/music/;
  more_set_headers "Access-Control-Allow-Origin: *";
}

# Allow direct access to /staticfiles
location /staticfiles/ {
  alias /home/yunohost.app/funkwhale/data/static/;
  more_set_headers "Access-Control-Allow-Origin: *";
}

# Allow direct access to only specific subdirectories in /media
location /media/dynamic_preferences/ {
  alias /home/yunohost.app/funkwhale/data/media/dynamic_preferences/;
  more_set_headers "Access-Control-Allow-Origin: *";
}

location /manifest.json {
  return 302 /api/v1/instance/spa-manifest.json;
}
root@krashboyz:/home/yunohost.app/funkwhale/data/media# ls -lah /home/yunohost.app/funkwhale/data/music/
ls: cannot access '/home/yunohost.app/funkwhale/data/music/': No such file or directory
root@krashboyz:/home/yunohost.app/funkwhale/data/media# ls -lah /home/yunohost.app/funkwhale/data/media/
total 28K
drwxr-x---  7 funkwhale www-data 4.0K Dec 14 21:34 .
drwxr-xr-x  4 funkwhale www-data 4.0K Jun 13 12:13 ..
drwxr-x--- 28 funkwhale www-data 4.0K Mar 13 19:53 attachments
drwxr-x---  3 funkwhale www-data 4.0K Dec 12  2022 federation_cache
drwxr-x---  3 funkwhale www-data 4.0K Jan  9  2022 __sized__
drwxr-x--- 76 funkwhale www-data 4.0K Dec 13 11:26 tracks
drwxr-x---  3 funkwhale www-data 4.0K Dec 14 21:34 transcoded
root@krashboyz:/home/yunohost.app/funkwhale/data/media# ls -lah /home/yunohost.app/funkwhale/music/
total 8.0K
drwxr-x--- 2 funkwhale www-data 4.0K Sep  8  2021 .
drwxr-x--- 5 funkwhale www-data 4.0K Jun 13 12:13 ..
root@krashboyz:/home/yunohost.app/funkwhale/data/media# ls -lah /home/yunohost.app/funkwhale/media/
ls: cannot access '/home/yunohost.app/funkwhale/media/': No such file or directory

thx for your help and your time <3

Thovi98 commented 1 year ago

Could you please ls -lah /home/yunohost.app/funkwhale/ ?

isAAAc commented 1 year ago
root@krashboyz:/home/yunohost.app/funkwhale/data/media# ls -lah /home/yunohost.app/funkwhale/
total 20K
drwxr-x---  5 funkwhale www-data 4.0K Jun 13 12:13 .
drwxr-xr-x 16 root      root     4.0K Jun  8 19:57 ..
drwxr-xr-x  4 funkwhale www-data 4.0K Jun 13 12:13 data
drwxr-x---  2 funkwhale www-data 4.0K Sep  8  2021 music
drwxr-x---  7 funkwhale www-data 4.0K Sep  8  2021 static
Thovi98 commented 1 year ago

Could you share the services logs (the logs of each Funkwhale services) please?

isAAAc commented 1 year ago

i just retried to play a track

isAAAc commented 1 year ago

looks like the other issue https://github.com/YunoHost-Apps/funkwhale_ynh/issues/230 no ?

Thovi98 commented 1 year ago

Yes it seems to. I propose that you follow the issue there and if there's something new on your instance you comment further here, if it's okay for you :)

Thovi98 commented 1 year ago

Next update should resolve your issue. You just may have to adapt your music directory by mv /home/yunohost.app/funkwhale/music/ /home/yunohost.app/funkwhale/data/music/ And maybe? mv /home/yunohost.app/funkwhale/static/ /home/yunohost.app/funkwhale/data/static/

isAAAc commented 1 year ago

@Thovi98 hi o/ just upgrade to version: 1.3.3~ynh1 , i didn't mv anything, and it works back fine