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

Node Demo Not Working Properly #355

Open
taff-git opened this issue Jan 20, 2025 · 21 comments
Open

Node Demo Not Working Properly #355

taff-git opened this issue Jan 20, 2025 · 21 comments

Comments

@taff-git
Copy link

Is this a regression?

Yes

Description

Hi,

The Node Demo is not working properly after start.
It is showing error related with SDK.Store module and RxDB.
"RxDB Error-Code DB8"
Also, DIDComm is not starting.

If someone know how to fix this please reply.

Regards,

Please provide the exception or error you saw

"RxDB Error-Code DB8"

Please provide the environment you discovered this bug in

Ubunutu 22.04 LTS
Node V23.0.6

Anything else?

Image

@elribonazo
Copy link
Contributor

Going to look up on this and get back to you soon!

@curtis-h
Copy link
Contributor

Hi @taff-git
we're struggling to replicate the exact error you've encountered, could you provide a little more information please:

  • what were the exact steps you took to reach that point?
  • what is the mediator DID being used?
  • have you changed any of the demo code?

@taff-git
Copy link
Author

taff-git commented Jan 21, 2025 via email

@curtis-h
Copy link
Contributor

@taff-git perfect, thanks for the update :)

I think that the Mediator DID might be incorrect, did you get this from a locally running mediator or somewhere else?

@taff-git
Copy link
Author

taff-git commented Jan 21, 2025 via email

@curtis-h
Copy link
Contributor

Hi @taff-git
I'm really struggling to replicate the issue, the only scenarios that I can get close with are where the mediator DID is wrong, ie either unresolveable, points to a wrong service endpoint or the mediator itself has stopped running.

Can you just confirm that:

  1. the mediator is running
    you should be able to visit the homepage on http://localhost:8080/ (if you haven't changed the docker-compose.yml)
  2. the DID is copied from the Mediator homepage
    on the homepage the DID is towards the top, just under "Mediator identity (DID):"
  3. that DID is resolving with ServiceEndpoints that have your correct local ip address
    you can resolve a DID in the node demo by selecting DIDs > Resolve DID and pasting the DID. it will output the resolved json and the Service Endpoints should be towards the bottom.

@taff-git
Copy link
Author

taff-git commented Jan 23, 2025

Hi Curtis,

The DID resolution part is working but the agent is not starting,
I am putting the screenshots here, so that you can see and get clearer picture of the issue.

Thanks,

Image
Image
Image

@curtis-h
Copy link
Contributor

@taff-git that's great, thanks
so that looks exactly like the error I get if the Mediator isn't running, is it possible either your mediator has stopped or something is blocking the communication?

@taff-git
Copy link
Author

@taff-git that's great, thanks so that looks exactly like the error I get if the Mediator isn't running, is it possible either your mediator has stopped or something is blocking the communication?

But Curtis, If I can host the mediator on my localhost, then what is blocking the communication and how to check it?

@curtis-h
Copy link
Contributor

I think the next step would be to see the original error, so either running the demo with a debugger attached or if that's not easy then you could add a console.log:
so if you edit demos/node/build/index.js
find the achieveMediation function
and in the catch block add a debugger or console.log

example:
Image

@taff-git
Copy link
Author

I think the next step would be to see the original error, so either running the demo with a debugger attached or if that's not easy then you could add a console.log: so if you edit demos/node/build/index.js find the achieveMediation function and in the catch block add a debugger or console.log

example: Image

Ok. Thanks, Let me try..

@taff-git
Copy link
Author

Hi Again,

I tried running it in the debug mode the error occur at the,
const store = new SDK.Store({
name: 'node_random_test',
password: Buffer.from("node_random_test").toString("hex"),
storage: InMemory as any,
ignoreDuplicate: false
});
in didcommStart.

The error starts with Fetch, then move to RxDB- D8 error.

Image

@curtis-h
Copy link
Contributor

I'm not sure I understand, I don't see how that store instancing code can generate a Fetch error? I'm expecting the error be thrown in agent.start() as that's where we handle fetching resources.

also noticing that code you've pasted is different to what's committed? have you changed it locally? or is it on some branch? can't see how else it can be different...

@taff-git
Copy link
Author

taff-git commented Jan 23, 2025

I'm not sure I understand, I don't see how that store instancing code can generate a Fetch error? I'm expecting the error be thrown in agent.start() as that's where we handle fetching resources.

also noticing that code you've pasted is different to what's committed? have you changed it locally? or is it on some branch? can't see how else it can be different...

I also feel the code is different, But I have not changed anything in code. The index.js file you attached looked very large mine is just 10 lines of code.
Just this...
""use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const figlet = require("figlet");
const app_1 = require("./cli/app");
(async () => {
const welcome = figlet.textSync("Node Demo");
console.log(welcome);
const app = new app_1.App();
await app.start();
})();
"
Should I download the new repo now? Or Can you share the link?

The repository I used is https://github.com/hyperledger/identus-edge-agent-sdk-ts,
And I cloned it last week.

Regards,

@curtis-h
Copy link
Contributor

sorry the index being different is my mistake, the actual link should've read build/index.js as in the SDK build, not the demo build.

That aside, that link is the correct repo, and if you cloned last week the code should be the same, in fact the didcommStart file hasn't changed since it was added.
If you cloned https://github.com/hyperledger/identus-edge-agent-sdk-ts
and have no local changes
the only possibility left that I can think of is you're on a different branch?

can you try the debugging again, this time with using the sdk index?
and maybe send a screenshot of your didcommStart.ts and a git status?

@taff-git
Copy link
Author

sorry the index being different is my mistake, the actual link should've read build/index.js as in the SDK build, not the demo build.

That aside, that link is the correct repo, and if you cloned last week the code should be the same, in fact the didcommStart file hasn't changed since it was added. If you cloned https://github.com/hyperledger/identus-edge-agent-sdk-ts and have no local changes the only possibility left that I can think of is you're on a different branch?

can you try the debugging again, this time with using the sdk index? and maybe send a screenshot of your didcommStart.ts and a git status?

Yes the code is same, no change in recent repo.

Also I ran the code in debug mode in build/index.js and you are right mediator is the issue.

Image
Image

How to resolve it ?

@curtis-h
Copy link
Contributor

can you show the error please? specifically with the cause property expanded
for example this is what I get when the mediator isn't running:

Image

@taff-git
Copy link
Author

can you show the error please? specifically with the cause property expanded for example this is what I get when the mediator isn't running:

Image

If you see the screenshot,, It's throwing errors
1. NoMediatorAvalible .............and when try to get one,
2. MediationRequestFailedError

@curtis-h
Copy link
Contributor

I don't know if I'm missing something, but I can't see the original error output (in the same way I've demonstrated) in your pictures. The only way forward I can think of is seeing the exact error that fetch is throwing, as this will narrow down why fetch is failing.

@curtis-h
Copy link
Contributor

hey @taff-git
any update on this?

@taff-git
Copy link
Author

hey @taff-git any update on this?

Hi Curtis,

I am uable to find exact issue, so not able to fix it.
I gave up last week.

Regards,

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