hashgraph / guardian

The Guardian is an innovative open-source platform that streamlines the creation, management, and verification of digital environmental assets. It leverages a customizable Policy Workflow Engine and Web3 technology to ensure transparent and fraud-proof operations, making it a key tool for transforming sustainability practices and carbon markets.
Apache License 2.0
98 stars 127 forks source link

Error during initial setup #3020

Closed sauravesr closed 8 months ago

sauravesr commented 8 months ago

Problem description

After the installation step is done, I created a registry account and in the "Finish Setup" step when I enter my Operator ID (Hedera Account) and Operator KEY (Hedera Account Private Key), I am redirected to the page where we enter geography, law, tags and ISIC code, After I fill the form and click connect I am getting this error (full logs in Administration section) :

Error: credential is not valid JSON-LD: { "type": "MISSING_PROPERTIES_IN_CONTEXT", "details": [ "credentialSubject.ISIC", "credentialSubject.geography", "credentialSubject.law", "credentialSubject.tags" ] } at /usr/local/guardian-service/node_modules/@transmute/vc.js/dist/vc.js.cjs.production.min.js:1:5864 at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5)

Step to reproduce

Steps to reproduce the behavior:

  1. Go to User Profile
  2. Enter the Operator ID (Hedera Account) and Operator KEY (Hedera Account Private Key) in the Finish Setup form and click Next.
  3. Enter the geography, law, tags and ISIC values as USA, USA, Verra, 051 062 repectively.
  4. See error MISSING_PROPERTIES_IN_CONTEXT as pop up

Expected behavior

No error and continue setup as expected.

Screenshots

image

Neurone commented 8 months ago

That seems a problem with the configuration file, possibly related to IPFS not being able to record the VC.

Are you using the local IPFS node provided in the repo? In that case you need to set IPFS_PROVIDER="local" ignoring the IPFS_STORAGE_API_KEY variable.

If you are using web3storage, please verify the IPFS_PROVIDER is set to web3storage and the IPFS_STORAGE_API_KEY is set accordingly.

In case these remediations don't solve the issue, can you provide more details about your configuration (guardian version, docker version, etc.) and the logs from "Guardian UI -> Administration -> Logs -> Save logs"?

sauravesr commented 8 months ago

Hi @Neurone, Thanks for such a quick response, you were right to assume that it was an issue with the IPFS config.

I was using a local IPFS configuration, instead of cloud one. I followed this doc to be exact: https://docs.hedera.com/guardian/guardian/readme/getting-started/installation/building-from-source-and-run-using-docker#4.1-setting-up-ipfs-local-node

I used the default value for IPFS_PUBLIC_GATEWAY=https://localhost:8080/ipfs/${cid} and IPFS_NODE_ADDRESS=http://localhost:5001/ as provided in the documentation.

image

I was thinking that since all services were launched through docker-compose they should be accessible through http://localhost:port as they are in the same internal network in docker.

Changing the values for IPFS service in env to: IPFS_PUBLIC_GATEWAY="http://ipfs-node:8080/ipfs/${cid}" and IPFS_NODE_ADDRESS="http://ipfs-node:5001"

seems to have fixed the issue.

Thank you again!

Neurone commented 8 months ago

Thanks for pointing out the doc, we will fix it.