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

cannot read conf file #41

Closed eoli3n closed 8 years ago

eoli3n commented 8 years ago

Hi,

MariaDB [(none)]> SHOW GRANTS FOR slimpduser@localhost;
+-------------------------------------------------------------------------------------------------------------------+
| Grants for slimpduser@localhost                                                                                   |
+-------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'slimpduser'@'localhost' IDENTIFIED BY PASSWORD '*F79B4D1052D0B8F4BD90B39FB58B6604F9C2F7F1' |
| GRANT ALL PRIVILEGES ON `slimpddb`.* TO 'slimpduser'@'localhost'                                                  |
+-------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

And here my database part in conf file slimpd/core/config/config_local.ini

[database]
dbusername = slimpduser
dbpassword = slimpd
dbdatabase = slimpddb

Then

php slimpd hard-reset

Gives

All data of database:xxx will be lost! Continue? [y/n]
y
PHP Warning:  mysqli::__construct(): (HY000/1045): Access denied for user 'xxx'@'localhost' (using password: YES) in /srv/http/slimpd/core/php/Modules/Importer/CliController.php on line 121

So i tried to edit core/config/config.ini too, same pb

othmar52 commented 8 years ago

hi, thanks for feedback! are you able to access systemcheck site? depending on your personal setup the url looks like http://localhost/slimpd/index.php/systemcheck

does your nginx user has write permissions for /srv/http/slimpd/localdata?

maybe your nginx error_log has some useful information?

can you try to manually delete the cached config-file /srv/http/slimpd/localdata/cache* in case it exists?

eoli3n commented 8 years ago

I cant access to systemcheck. I setted recurive 755 http:root on localdata. Now back to 777 root:root for testing. When i access http://127.0.0.1/slimpd/index.php

Slim Application Error
A website error has occurred. Sorry for the temporary inconvenience.

And this in nginx logs

oct. 26 13:03:24 osz nginx[527]: 2016/10/26 13:03:24 [error] 549#549: *34026 FastCGI sent in tderr: "PHP message: Slim Application Error:
oct. 26 13:03:24 osz nginx[527]: Type: Error
oct. 26 13:03:24 osz nginx[527]: Message: Call to a member function query() on null
oct. 26 13:03:24 osz nginx[527]: File: /srv/http/slimpd/core/php/Repositories/BaseRepository.php
oct. 26 13:03:24 osz nginx[527]: Line: 512
oct. 26 13:03:24 osz nginx[527]: Trace: #0 /srv/http/slimpd/core/php/Modules/Library Controller.php(27): Slimpd\Repositories\BaseRepository->getAll(11, 1, ' ORDER BY added...')
oct. 26 13:03:24 osz nginx[527]: #1 [internal function]: Slimpd\Modules\library\Controller->indexAction(Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
oct. 26 13:03:24 osz nginx[527]: #2 /srv/http/slimpd/core/vendor-dist/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(41): call_user_func(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
oct. 26 13:03:24 osz nginx[527]: #3 /srv/http/slimpd/core/vendor-dist/slim/slim/Slim/Route.php(344): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
oct. 26 13:03:24 osz nginx[527]: #4 /srv/http/slimpd/core/vendor-dist/slim/slim/Slim/MiddlewareAwareTrait.php(116): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
oct. 26 13:03:24 osz nginx[527]: #5 /srv/http/slimpd/core/vendor-dist/slim" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /slimpd/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/php-fpm.sock:", host: "127.0.0.1"

When i try to acces to http://127.0.0.1/slimpd/index.php/systemcheck

 404 Not Found

Same if i manually remove cache, BTW cache file had good user to access db

⚡ root@osz  ~http/slimpd/localdata/cache   master ●  cat conf-a5a38a2b010.php | grep slimpd
'dbusername' => 'slimpduser',
'dbpassword' => 'slimpd',
'dbdatabase' => 'slimpddb',
othmar52 commented 8 years ago

i can't reproduce this error. just to make sure i am getting the situation correctly: you have copied config_local.sample.ini to config_local.ini?

you have modified db-credentials in config_local.ini?

your cached config file has the correct db-credentials

but executing slimpd hard-reset still shows xxx as database name?

All data of database:xxx will be lost! Continue? [y/n]
eoli3n commented 8 years ago
⚡ root@osz  ~http/slimpd/core/config   master ●  cat config_local.ini| grep -A 3 '\[database\]'
[database]
dbusername = slimpduser
dbpassword = slimpd
dbdatabase = slimpddb
⚡ root@osz  ~http/slimpd/core/config   master ●  cd ../../localdata/cache
⚡ root@osz  ~http/slimpd/localdata/cache   master ●  ls -altr
total 36
-rwxrwxrwx 1 root root    71 26 oct.  02:43 .gitignore
drwxrwxrwx 5 root root  4096 26 oct.  02:43 ..
drwxrwxrwx 2 root root  4096 26 oct.  13:08 .
-rwxrwxrwx 1 http http 23107 26 oct.  13:08 conf-a5a38a2b010.php
⚡ root@osz  ~http/slimpd/localdata/cache   master ●  cat conf-a5a38a2b010.php| grep 'db' | head -n 4
    'dbhost' => '127.0.0.1',
    'dbusername' => 'slimpduser',
    'dbpassword' => 'slimpd',
    'dbdatabase' => 'slimpddb',
eoli3n commented 8 years ago

Oh ! now it works... hm Don't know what i missed. Sorry for that

othmar52 commented 8 years ago

fine! so are you able to access systemcheck now? i have to admit that i havn't tried sliMpd with nginx yet

eoli3n commented 8 years ago

http://127.0.0.1/slimpd/index.php/systemcheck

404 Not Found

I admit that i can't understand this http request : index.php isn't a dir

othmar52 commented 8 years ago

ok, obviously nginx needs some more configuration.

based on the slim framework docs it may work with

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

can you give it a try?

eoli3n commented 8 years ago

Worked, but OUCH ! everything's in german ^^'

eoli3n commented 8 years ago

Another thing, css seems not working

systemcheck

css

othmar52 commented 8 years ago

please pull the latest commits to fix the language issue!

check your config_local.ini for values absRefPrefix and absFilePrefix

;example setup without mod_rewrite running slimpd in a subdirectory like http://localhost/slimpd
absRefPrefix = /slimpd/index.php/
absFilePrefix = /slimpd/

and access sliMpd with the noCache parameter to force a rewrite of cachefile

http://127.0.0.1/slimpd/index.php?noCache

eoli3n commented 8 years ago

worked for all ! great, can't wait to test it :) thx a lot for helping. When will wax implemented ? is there a way to test it ? (i saw on doc "unimplemented")

eoli3n commented 8 years ago
MariaDB [(none)]> GRANT ALL PRIVILEGES ON `_%`.* TO ''@'localhost' WITH GRANT OPTION;
ERROR 1133 (28000): Can't find any matching row in the user table
othmar52 commented 8 years ago

can't wait to test it :)

don't expect too much - sliMpd is under very hard development with tons of missing features

When will wax implemented

you mean xwax? it's already working but i have not documented how to setup slightly modified xwax with slimpd

eoli3n commented 8 years ago

yep, i will test all these coming features

othmar52 commented 8 years ago

thank you! the GRANT query should now display correctly in systemcheck GUI please pull the latest commit.

feel free to open separate issues for each error, feedback or question :)

eoli3n commented 8 years ago

worked thx, i will create separate issues now. Have a nice day