solid-contrib / data-modules

Solid Data Modules
7 stars 1 forks source link

[contacts] Error: Fetcher: <http://localhost:3000/alice/public-contacts/index.ttl> Unauthorized #98

Closed michielbdejong closed 8 months ago

michielbdejong commented 8 months ago

In the contacts/ folder I tried:

npm ci
npm run build
npm run pod

And then in a second window, reading the public contacts failed:

michiel-2:contacts michiel$ node ./examples/read-address-book.mjs
/Users/michiel/gh/solid-contrib/data-modules/contacts/node_modules/rdflib/lib/fetcher.js:1048
      var err = new Error('Fetcher: ' + errorMessage);
                ^

Error: Fetcher: <http://localhost:3000/alice/public-contacts/index.ttl> Unauthorized
    at Fetcher.failFetch (/Users/michiel/gh/solid-contrib/data-modules/contacts/node_modules/rdflib/lib/fetcher.js:1048:17)
    at /Users/michiel/gh/solid-contrib/data-modules/contacts/node_modules/rdflib/lib/fetcher.js:1706:26
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async fetchNode (file:///Users/michiel/gh/solid-contrib/data-modules/contacts/dist/rdflib/web-operations/fetchNode.js:3:9)
    at async ContactsModuleRdfLib.readAddressBook (file:///Users/michiel/gh/solid-contrib/data-modules/contacts/dist/rdflib/ContactsModuleRdfLib.js:25:9)
    at async file:///Users/michiel/gh/solid-contrib/data-modules/contacts/examples/read-address-book.mjs:9:16 {
  status: 401,
  statusText: '<http://localhost:3000/alice/public-contacts/index.ttl> Unauthorized',
  response: Response {
    size: 0,
    timeout: 0,
    [Symbol(Body internals)]: {
      body: PassThrough {
        _events: {
[...]

I also see no public-contacts folder on http://localhost:3000/alice/ although I do see it in https://github.com/solid-contrib/data-modules/tree/main/contacts/dev-server/initial-data/alice

michielbdejong commented 8 months ago

dev-server logs:

2024-03-24T10:57:32.441Z [HandlerServerConfigurator] {Primary} info: Received GET request for /alice/public-contacts/index.ttl
2024-03-24T10:57:32.446Z [WebAclReader] {Primary} info: Found applicable ACL document http://localhost:3000/alice/.acl
2024-03-24T10:57:32.450Z [PermissionBasedAuthorizer] {Primary} warn: Unauthenticated agent has no read permissions

And that second line is weird because it should find https://github.com/solid-contrib/data-modules/blob/main/contacts/dev-server/initial-data/alice/public-contacts/index.ttl.acl applicable. Maybe I have an old data dir on my laptop and it's not deploying the fixture?

michielbdejong commented 8 months ago

Ah yes, fixed after npm run pod:clean and npm run pod:init!