Closed markwilkinson closed 6 years ago
Hmm, yeah, that doesn’t seem right. Oh, you know what, could be a content-type issue. Try adding a content-type: text/turtle to the create container POST
Unfortunately, almost the same result: (the POST includes the content-type header now, this is just the result for POSTing testcontainer2 versus testcontainer without that header (above) )
n0:testcontainer
a ldp:Resource;
terms:modified "2018-06-07T07:33:27Z"^^XML:dateTime;
st:mtime 1528356807.401;
st:size 83.
<https://localhost:8443//testcontainer2.ttl>
a tur:Resource, ldp:Resource;
terms:modified "2018-06-07T12:56:13Z"^^XML:dateTime;
st:mtime 1528376173.189;
st:size 83.
It's actually a bit surprising to see the degree to which the result differs with/without the Content-Type header. I saw the conversation (including TBL) about adding file type extensions even if the Slug doesn't have them, but... I stopped using Content-Type specifically because I wanted to control when there was an extension and when there was not. I don't like machines to second-guess me when they don't have to ;-)
Oh weird. Ok.
So, something's definitely off here. I know that creating containers via POST is working (see this integration test for example). What is different in your case?
Also, can you repeat this test on the latest develop
branch? I vaguely recall that some of the issues (like the double //
in https://localhost:8443//testcontainer2.ttl
) have been recently fixed? Maybe not though.
Hmmmm.... I am not able to test the devel version because it will not accept a self-signed certificate.
b.t.w. I am running it as a docker image... if that makes a difference.
OK, I cloned the current "develop" repo branch onto my production server that has a certificate. Configured everything identically to my localhost test environment. Started it as a docker image (and restarted after configuring the json and moving the cert and key into to the image).
The server responds, but it cannot find the root Container:
$ curl -k -i -X GET "https://linkeddata.systems:8443/"
HTTP/1.1 404 Not Found
X-Powered-By: solid-server
Vary: Origin
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: Authorization, User, Location, Link, Vary, Last-Modified, ETag, Accept-Patch, Accept-Post, Upda
tes-Via, Allow, WAC-Allow, Content-Length, WWW-Authenticate
Allow: OPTIONS, HEAD, GET, PATCH, POST, PUT, DELETE
Link: <.acl>; rel="acl", <.meta>; rel="describedBy", <http://www.w3.org/ns/ldp#Container>; rel="type", <http://www.w3.org/ns/l
dp#BasicContainer>; rel="type"
MS-Author-Via: SPARQL
Updates-Via: wss://linkeddata.systems:8443
Content-Type: text/html; charset=utf-8
Content-Length: 52
ETag: W/"34-dfZxo4myzCTnUawMXJ8ddFPSszk"
Date: Fri, 08 Jun 2018 13:07:15 GMT
Connection: keep-alive
Can't find file requested: data/linkeddata.systems/
{
"root": "./data",
"port": "8443",
"serverUri": "https://linkeddata.systems:8443",
"webid": false,
"mount": "/",
"configPath": "./config",
"dbPath": "./.db",
"sslKey": "./cert.key",
"sslCert": "./cert.pem",
"multiuser": true,
"corsProxy": "/proxy"
}
Interesting. And what's the contents (like if you do ls
) of your ./data
dir?
Not very informative :-)
$ sudo docker run -it node-solid-server /bin/bash root@569bf0c94b72:/usr/src/app# ls data/ root@569bf0c94b72:/usr/src/app#
@markwilkinson hmmm that’s not right. it should be creating a dir named ‘linkeddata.systems’ upon startup, inside ./data. That’s what’s causing the 404.
I just did a docker restart to be 100% sure - nope, it isn't created. Is it creating that folder it based on the info in the config file, or is it looking somewhere else for that information?
So I guess the next question is why the dir is not being created. Is the app running as root, and if not, does the os user have write permission?
Oh also, about the self-signed certificate - try running it via solid-test start, that disables the cert checking
Ummmm.... the permissions are whatever is inside of the Docker container... I start the docker image as root, for sure. Inside, I don't know what the permissions are.
solid-test start? I can do that with a docker container?
Ah, I don’t know, I’m not familiar with our docker setup. Will take a look later.
Meanwhile, just to diagnose if it’s an fs permission, try starting it in single user mode (set multiuser to false in config) and try creating container.
ha! Single user mode worked!
Not sure what single vs multi user really means, but... at least I am able to get back to my primary task now :-)
$ curl -k -i -X GET "https://linkeddata.systems:8443/"
HTTP/1.1 200 OK
X-Powered-By: solid-server
Vary: Origin
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: Authorization, User, Location, Link, Vary, Last-Modified, ETag, Accept-Patch, Accept-Post, Upda
tes-Via, Allow, WAC-Allow, Content-Length, WWW-Authenticate
Allow: OPTIONS, HEAD, GET, PATCH, POST, PUT, DELETE
Link: <.acl>; rel="acl", <.meta>; rel="describedBy", <http://www.w3.org/ns/ldp#Container>; rel="type", <http://www.w3.org/ns/l
dp#BasicContainer>; rel="type"
MS-Author-Via: SPARQL
Updates-Via: wss://linkeddata.systems:8443
Content-Type: text/turtle
Date: Mon, 11 Jun 2018 12:02:49 GMT
Connection: keep-alive
Transfer-Encoding: chunked
@prefix : <#>.
@prefix n0: <>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.
@prefix terms: <http://purl.org/dc/terms/>.
@prefix XML: <http://www.w3.org/2001/XMLSchema#>.
@prefix loc: <https://linkeddata.systems:8443//localhost/>.
@prefix st: <http://www.w3.org/ns/posix/stat#>.
n0:
a ldp:BasicContainer, ldp:Container;
terms:modified "2018-06-08T12:47:17Z"^^XML:dateTime;
ldp:contains <https://linkeddata.systems:8443//.gitkeep>, loc:;
st:mtime 1528462037.282;
st:size 4096.
<https://linkeddata.systems:8443//.gitkeep>
a ldp:Resource;
terms:modified "2018-06-08T12:04:34Z"^^XML:dateTime;
st:mtime 1528459474;
st:size 0.
loc:
a ldp:BasicContainer, ldp:Container, ldp:Resource;
terms:modified "2018-06-08T12:47:17Z"^^XML:dateTime;
st:mtime 1528462037.282;
st:size 4096.
(note that it still has duplicate //'s in various places)
Anyway, I'm happy!
Thanks!
So, back to the original bug report - the behavior has not changed (this is a checkout of the develop branch four days ago).
POSTing the message described above (with or without a Content-Type header) still results in the creation of a Resource, rather than a Container.
???
Ah, damn, ok. (btw, the Content-type is currently required.)
And I'm assuming you're still passing along the right Link:
header, right
Command I am using is copy/paste from the original bug report:
$ curl -k -i -X POST "https://linkeddata.systems:8443/" -H "Slug: testcontainer" -H "Content-Type: text/turtle" -H 'Link: <http://www.w3.org/ns/ldp/BasicContainer>; rel="type"' -d @testcontainer.ttl
Heh heh I suspect it's a one-character typo that's causing your issue :)
The Link should be: <http://www.w3.org/ns/ldp#BasicContainer>
- notice the #
instead of /
:)
Goddammit! I'm so sorry for wasting your time!
Yes, that was the problem. (note that it is still generating some odd '//'s but that's not a blocker for the demo that I want to give next week)
Sorry again!
Hahahah no problem! :) Glad we sorted it out.
(Yeah, hmm, the '//' part is not good, I thought that got fixed recently...)
I believe this is a bug, though I might be missing something...??
node-solid-server-4.0.14 (from the tar.gz release)
Curl-ing a message to create a container seems to result in the creation of a Resource instead. Please see the transactions below: