Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config file not found? #19

Closed
michielbdejong opened this issue Oct 19, 2020 · 4 comments
Closed

config file not found? #19

michielbdejong opened this issue Oct 19, 2020 · 4 comments

Comments

@michielbdejong
Copy link
Member

$ docker stop `docker ps -q` ; docker rm `docker ps -aq` ; docker network remove testnet
$ sh run-solid-test-suite.sh 
$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
44ee029d169a        server              "docker-php-entrypoi…"   58 seconds ago      Up 57 seconds       80/tcp, 443/tcp     server
$ docker run -it --network=testnet webid-provider /bin/bash
root@020d8f3860e8:/app# curl -ki https://server/.well-known/openid-configuration
HTTP/1.1 200 OK
Date: Mon, 19 Oct 2020 11:40:20 GMT
Server: Apache/2.4.38 (Debian)
X-Powered-By: PHP/7.2.34
Set-Cookie: PHPSESSID=fdae050a56335a7606986c83cdb92d61; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Vary: Accept-Encoding
Content-Length: 1534
Content-Type: text/html; charset=UTF-8

<br />
<b>Warning</b>:  file_put_contents(/app/src/Controller/../../config/serverConfig.json): failed to open stream: Permission denied in <b>/app/src/ServerConfig.php</b> on line <b>30</b><br />
<br />
<b>Warning</b>:  file_get_contents(/app/src/Controller/../../config/serverConfig.json): failed to open stream: No such file or directory in <b>/app/src/ServerConfig.php</b> on line <b>27</b><br />
<br />
<b>Fatal error</b>:  Uncaught TypeError: json_decode() expects parameter 1 to be string, boolean given in /app/src/ServerConfig.php:27
Stack trace:
#0 /app/src/ServerConfig.php(27): json_decode(false, true)
#1 /app/src/ServerConfig.php(14): Pdsinterop\Solid\ServerConfig-&gt;loadConfig()
#2 /app/src/Controller/ServerController.php(18): Pdsinterop\Solid\ServerConfig-&gt;__construct('/app/src/Contro...')
#3 [internal function]: Pdsinterop\Solid\Controller\ServerController-&gt;__construct()
#4 /app/vendor/league/container/src/Definition/Definition.php(252): ReflectionClass-&gt;newInstanceArgs(Array)
#5 /app/vendor/league/container/src/Definition/Definition.php(212): League\Container\Definition\Definition-&gt;resolveClass('Pdsinterop\\Soli...')
#6 /app/vendor/league/container/src/Definition/DefinitionAggregate.php(94): League\Container\Definition\Definition-&gt;resolve(false)
#7 /app/vendor/league/container/src/Container.php(157): League\Container\Definition\DefinitionAggregate-&gt;resolve('Pdsinterop\\Soli...', false)
#8 /app/vendor/league/route/src/Rout in <b>/app/src/ServerConfig.php</b> on line <b>27</b><br />
root@020d8f3860e8:/app# 
@michielbdejong
Copy link
Member Author

What should /app/src/Controller/../../config/serverConfig.json contain?
The error changes when I run:

$ docker exec server touch /app/config/serverConfig.json

And it changes again when I then run:

$ docker exec server touch /app/config/user.json

which seems to be the next file it's missing...

@ylebre
Copy link
Member

ylebre commented Oct 19, 2020

The missing files should be auto-generated by the server, but it looks like it does not have write permissions in the config directory:

failed to open stream: Permission denied

@michielbdejong
Copy link
Member Author

Fixed with chown, thanks!

@Potherca
Copy link
Member

Does this need to be documented somewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants