othmar52 / slimpd

PHP/JS based MPD-web-client for large music collections
GNU Affero General Public License v3.0
41 stars 11 forks source link

Error when trying to update db #40

Closed XenGi closed 3 years ago

XenGi commented 8 years ago
OOOPS!

something went wrong...
/index.php/importer/triggerUpdate

is shown when clicked on update sliMpd Database.

ngninx log shows:

2016/09/07 16:42:26 [error] 133#0: *1361 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Class 'Slimpd\importer' not found in /var/www/slimpd/php/Modules/controller.php on line 34" while reading response header from upstream, client: 10.128.0.10, server: _, request: "GET /index.php/importer/triggerUpdate?nosurrounding=1 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "cantinaband", referrer: "http://cantinaband/index.php/importer"

nginx config:

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www/slimpd;

    index index.php;

    server_name _;

    access_log              /var/log/nginx/slimpd.access.log main;
    error_log               /var/log/nginx/slimpd.error.log warn;

    location / {
            try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param SCRIPT_NAME $fastcgi_script_name;
            fastcgi_index index.php;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }
}
othmar52 commented 8 years ago

Valid point - thank you for reporting! There had been heavy rework on the whole import procedure and this part is not reworked yet.

As a temporary workaround you can do this in your terminal:

mpc update
/path/to/sliMpd/slimpd update
sudo /path/to/sliMpd/scripts/sphinx-rotate.sh

Some background info: Depending on the size of the users music collection the initial import process may run for several days. I don't like the idea to trigger such an enormous process via the webbrowser and loose control about the process. I already have an idea for solving this problem via a sliMpd-cronjob but unfortunately it is not implemented yet.

I will update this issue as soon as i have implemented my approach. In the meantime i will hide the button or forward to this issue conversation.

othmar52 commented 8 years ago

I already have an idea for solving this problem via a sliMpd-cronjob but unfortunately it is not implemented yet.

i have added another cli-tool-argument ./slimpd check-que

this will process all actions that has been triggered via sliMpd-GUI a mechanism with a .lock file avoids parallel execution of sliMpd-cli-tool

to have it working like expected a cronjob executed every minute is required */1 * * * * webserver-user php /path/to/slimpd-root/slimpd check-que >> /dev/null

of course the same command can be executed directly in terminal without setting up a cronjob.