SolidLabResearch / Solid-Agent

A rule-based intelligent software agent
8 stars 1 forks source link

Error: No WebSocketChannel found in the storage description resource. #8

Closed j-steinbach closed 9 months ago

j-steinbach commented 11 months ago

I am trying to get the UCP configuration working based on the guide, but it fails on npx ts-node indexUCP.ts.

 ↳ npx ts-node indexUCP.ts
oidc-provider WARNING: Unsupported Node.js runtime version. Use ^12.19.0, ^14.15.0, or ^16.13.0
token expires in: 600 seconds.
Account (http://localhost:3123/solid/profile/card#me) created and logged in true
/home/jst/Projects/KNoWS/SHARCS/Solid-Agent/node_modules/solid-notification-client/dist/NotificationUtil.js:33
            op = body.call(thisArg, _);
                      ^
Error: No WebSocketChannel found in the storage description resource.
    at /home/jst/Projects/KNoWS/SHARCS/Solid-Agent/node_modules/solid-notification-client/dist/NotificationUtil.js:108:31
    at step (/home/jst/Projects/KNoWS/SHARCS/Solid-Agent/node_modules/solid-notification-client/dist/NotificationUtil.js:33:23)
    at Object.next (/home/jst/Projects/KNoWS/SHARCS/Solid-Agent/node_modules/solid-notification-client/dist/NotificationUtil.js:14:53)
    at fulfilled (/home/jst/Projects/KNoWS/SHARCS/Solid-Agent/node_modules/solid-notification-client/dist/NotificationUtil.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Even though the above fails with an error, I still am able to exectute UcpSendPolicy.ts

 ↳ npx ts-node UcpSendPolicy.ts
2023-06-22T13:46:56.064Z Duration policy: https://woutslabbinck.solidcommunity.net/profile/card#me now has access to http://localhost:3000/ldes for PT30S
woutslabbinck commented 11 months ago

It seems like you do not have a Solid server running with the Solid Notifications Protocol (more specifically WebSocketChannel2023) on port 3000.

Therefore, the DemoUCPAgent will never be notified when you send a policy to the policy container.

Have you tried setting up a CSS within the directory with following command npx community-solid-server -c memory-no-setup.json?

This memory config sure has the required notification protocol activated with CSS v6.0.0

j-steinbach commented 10 months ago

Not sure what I do wrong.

  1. Run npx community-solid-server -c memory-no-setup.json to start the server
  2. Run npx ts-node indexUCP.ts
  3. Get the above-mentioned error
  4. (Run npx ts-node UcpSendPolicy.ts and get reported that 2023-06-28T12:46:50.153Z Duration policy: https://woutslabbinck.solidcommunity.net/profile/card#me now has access to http://localhost:3000/ldes for PT30S
woutslabbinck commented 10 months ago

We've pinned it down to a problem with setting up the websocketconnection with the CSS. More testing still has to be done to really pinpoint the problem. The error was coming from the following package: https://www.npmjs.com/package/solid-notification-client

woutslabbinck commented 10 months ago

After an offline discussion, it suddenly works now for @j-steinbach. We'll re-open and further investigate if the problem appears again as currently we cannot reproduce it again.

woutslabbinck commented 9 months ago

When running CSS v6.0.1, I got the same error. The reason for failure was a difference in the .well-known/solid contents.

v6.0.0. content:

<http://localhost:3000/.well-known/solid> rdf:type pim:Storage ;
  notify:subscription <http://localhost:3000/.notifications/WebHookChannel2023/> ,
                                    <http://localhost:3000/.notifications/WebSocketChannel2023/> .

v6.0.1 content:

<http://localhost:3000/> rdf:type pim:Storage ;
  notify:subscription <http://localhost:3000/.notifications/WebHookChannel2023/> ,
                                    <http://localhost:3000/.notifications/WebSocketChannel2023/> .

And in the Solid Notification Client, a query was executed on both notify:subscription and the storage description URL.

A fix that just queries for the notify:subscribe triples will solve this.

woutslabbinck commented 9 months ago

Fixed by bumping the solid notification client (https://github.com/SolidLabResearch/Solid-Agent/commit/ae327826cb5af12ab6637c34fd6f95dc161df485)