nodeSolidServer / node-solid-server

Solid server on top of the file-system in NodeJS
https://solidproject.org/for-developers/pod-server
Other
1.78k stars 303 forks source link

Cannot create new file in public directory (error 500) #901

Open cory2067 opened 5 years ago

cory2067 commented 5 years ago

I tried cloning the repository and running with Docker. I wanted to make an account and do a simple test by creating "test.ttl" under my public directory. However, nearly everything I tried was greeted by an error. Here's my adventure in trying to do so:

  1. Created a new account
  2. Log in
  3. Navigate to /public and create new source file with "+" button Result: image
  4. Try to escape by pushing the home icon image
  5. Log out and try to log back in again image
  6. Eventually manage to log back in. Go back to /public, am greeted by unexpected looking page: image

Docker logs say nothing. There's a lot of errors here without much helpful output, so I don't really know how to go about figuring this out.

justinwb commented 5 years ago

Hi @cory2067 - can you give us more detail on your environment setup? What steps did you take specifically to get there?

The solid server itself should be providing a lot more detail about what's happening in the logs. Can you provide that log output corresponding to these requests?

cory2067 commented 5 years ago

Sure. I have Docker CE version 18.06, running on Linux Mint 19. I made a fresh clone of the repository and ran these commands:

sudo docker build -t solid .
sudo docker run -dp 8443:8443 --name solid solid

After reproducing the error, asking for the output only gives the following:

$ sudo docker logs solid

> solid-server@4.2.0 solid /usr/src/app
> node ./bin/solid "start"

Solid server (v4.2.0) running on https://localhost:8443/
Press <ctrl>+c to stop

Is there another way to get the logs? Additionally, docker stop and ctrl+c (when running without -d) don't stop the server, and I need to resort to docker kill

dmitrizagidulin commented 5 years ago

Is there another way to get the logs?

Ah, yeah, so, it should actually be starting with a -verbose flag, like node ./bin/solid "start" -v.

That reminds me, we really should open an issue to make --verbose flag on by default. There is no earthly reason to not have it on.

cory2067 commented 5 years ago

Cool, I'll try adding a -v

Ok, it looks like the server isn't happy with the certificates that are generated in the Dockerfile:

Mon, 05 Nov 2018 22:17:28 GMT solid:ACL Write access denied to (none)
Mon, 05 Nov 2018 22:17:28 GMT solid:server Error page because of: { [HTTPError: Access to https://cor.localhost:8443/public/test.ttl requires authorization]
  name: 'HTTPError',
  message: 'Access to https://cor.localhost:8443/public/test.ttl requires authorization',
  status: 401 }
Mon, 05 Nov 2018 22:17:28 GMT solid:server Display login-required for https://cor.localhost:8443/public/test.ttl
Mon, 05 Nov 2018 22:17:28 GMT solid:server Error page because of: { FetchError: request to https://localhost:8443/.well-known/openid-configuration failed, reason: self signed certificate
    at ClientRequest.<anonymous> (/usr/src/app/node_modules/node-fetch/lib/index.js:1358:11)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at TLSSocket.socketErrorListener (_http_client.js:387:9)
    at emitOne (events.js:116:13)
    at TLSSocket.emit (events.js:211:7)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
  message: 'request to https://localhost:8443/.well-known/openid-configuration failed, reason: self signed certificate',
  type: 'system',
  errno: 'DEPTH_ZERO_SELF_SIGNED_CERT',
  code: 'DEPTH_ZERO_SELF_SIGNED_CERT' }

I changed the last line of the Dockerfile to the following to make it work properly:

CMD ./bin/solid-test "start" -v