0xPolygonID / issuer-node

Polygon ID Self-Hosted Issuer Node
Apache License 2.0
83 stars 73 forks source link

can't create identity #650

Closed nk2103 closed 2 months ago

nk2103 commented 3 months ago

Expected behaviour

Issuer DID should be generated.

Actual behaviour

Unfortunately, when following the instructions outlined in the README file step by step, I encountered an error(can't create identity) at the 'Generate Issuer DID' stage. Below are the Logs i get.

System information

Issuer node version: v2.4.1 OS & Version: Windows/Linux/OSX Browser & Version: Chrome/Firefox/Safari/Edge

Logs (if needed)

[root@polygon:~/issuer-node# make generate-issuer-did
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_FILE="Dockerfile" docker compose -p issuer -f /root/issuer-node/infrastructure/local/docker-compose.yml up -d initializer
WARN[0000] Found orphan containers ([issuer-vault-1 issuer-redis-1 issuer-postgres-1]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up. 
[+] Running 1/1
 ✔ Container issuer-initializer-1  Started                                                                                                                                                                                                                                                      0.0s 
sleep 5

sed '/ISSUER_API_UI_ISSUER_DID/d' .env-api > .env-api.tmp
mv .env-api.tmp .env-api
docker logs issuer-initializer-1
2024/04/09 10:52:43 INFO missing toml config file. Fallback to env vars err="Config File \"config\" Not Found in \"[/service /home/runner/work/sh-id-platform/sh-id-platform]\""
time=2024-04-09T10:52:43.056Z level=DEBUG msg=database url="postgres://polygonid:polygonid@postgres:5432/platformid?sslmode=disable"
2024/04/09 10:52:43 goose: no migrations to run. current version: 202311211436040
time=2024-04-09T10:52:43.073Z level=INFO msg="migration done!"
2024/04/09 10:52:43 INFO missing toml config file. Fallback to env vars err="Config File \"config\" Not Found in \"[/service /home/runner/work/sh-id-platform/sh-id-platform]\""
time=2024-04-09T10:52:43.249Z level=ERROR msg="creating identity" err="can't create identity: can't save identity: ERROR: null value in column \"keytype\" of relation \"identities\" violates not-null constraint (SQLSTATE 23502)" id=<nil>
time=2024-04-09T10:52:43.249Z level=ERROR msg="error creating identifier" !BADKEY="cannot create identity: can't create identity: can't save identity: ERROR: null value in column \"keytype\" of relation \"identities\" violates not-null constraint (SQLSTATE 23502)"
docker rm issuer-initializer-1
issuer-initializer-1]
martinsaporiti commented 3 months ago

Hi @nk2103 It seems ISSUER_API_UI_KEY_TYPE has no value. Could you check it in the .env-api file? Here an example: https://github.com/0xPolygonID/issuer-node/blob/84bcb60ace21783051ad8787f35f3585dfbdc70e/.env-api.sample#L12

nk2103 commented 3 months ago

Hi @martinsaporiti i checked. It is already set to BJJ.

martinsaporiti commented 3 months ago

@nk2103 could you paste here the content of the .env-api file? Please delete private information before that.

nk2103 commented 3 months ago

@martinsaporiti since Mumbai test network is not supported anymore i switched to Amoy and set up a new Issuer. I still get following error on the step make generate-issuer-did.

COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_FILE="Dockerfile" docker compose -p issuer -f /root/amoyIssu/issuer-node/infrastructure/local/docker-compose.yml up -d initializer WARN[0000] Found orphan containers ([issuer-redis-1 issuer-vault-1 issuer-postgres-1]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up. [+] Running 1/1 ✔ Container issuer-initializer-1 Started 0.1s sleep 5 docker logs issuer-initializer-1 2024/04/17 09:04:08 INFO missing toml config file. Fallback to env vars err="Config File \"config\" Not Found in \"[/service /home/runner/work/sh-id-platform/sh-id-platform]\"" time=2024-04-17T09:04:08.098Z level=DEBUG msg=database url="postgres://polygonid:polygonid@postgres:5432/platformid?sslmode=disable" 2024/04/17 09:04:08 goose: no migrations to run. current version: 202402230818397 time=2024-04-17T09:04:08.118Z level=INFO msg="migration done!" 2024/04/17 09:04:08 INFO missing toml config file. Fallback to env vars err="Config File \"config\" Not Found in \"[/service /home/runner/work/sh-id-platform/sh-id-platform]\"" time=2024-04-17T09:04:08.398Z level=ERROR msg="creating identity" err="wrong DID Metadata" id= time=2024-04-17T09:04:08.398Z level=ERROR msg="error creating identifier" !BADKEY="cannot create identity: wrong DID Metadata"

sed '/ISSUER_API_UI_ISSUER_DID/d' .env-api > .env-api.tmp mv .env-api.tmp .env-api docker stop issuer-initializer-1 issuer-initializer-1 docker rm issuer-initializer-1 issuer-initializer-1

this is my .env-api file:

ISSUER_API_UI_SERVER_URL= ISSUER_API_UI_SERVER_PORT=3002 ISSUER_API_UI_AUTH_USER= ISSUER_API_UI_AUTH_PASSWORD=*** ISSUER_API_UI_ISSUER_NAME=my issuer ISSUER_API_UI_ISSUER_LOGO= ISSUER_API_UI_SCHEMA_CACHE=false ISSUER_API_IDENTITY_METHOD=polygonid ISSUER_API_IDENTITY_BLOCKCHAIN=polygon ISSUER_API_IDENTITY_NETWORK=amoy ISSUER_API_UI_KEY_TYPE=BJJ ISSUER_API_ENVIRONMENT=local ISSUER_CUSTOM_DID_METHODS='[{"blockchain":"linea","network":"testnet","networkFlag":"0b01000001","chainID":59140}]' ISSUER_API_UI_ISSUER_DID=

martinsaporiti commented 3 months ago

@nk2103 Do you have the latest version from the main branch?

nk2103 commented 3 months ago

@martinsaporiti yes it is the latest version 2.5.0 from main branch

martinsaporiti commented 3 months ago

What about Docker images? Have you run the issuer node before? I would recommend you to delete all the images related to the issuer node.

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 20 days with no activity. Remove stale label, add the enhancement label or comment to avoid closing it in 10 days.

nk2103 commented 2 months ago

that worked for me thanks a lot!