0xPolygonID / issuer-node

Privado ID Self-Hosted Issuer Node
Apache License 2.0
86 stars 83 forks source link

Network Error shows in the issuer-ui #722

Closed barrybecker4 closed 1 month ago

barrybecker4 commented 2 months ago

I apologize if this is not the right place for trouble shooting help, but I tried following the instructions, but am getting an error in the UI.

Expected behaviour

The UI starts and I do not see "Network Error" in all the tabs.

Actual behaviour

I see this in the UI image

Steps to reproduce the problem

Follow the issuer node install instructions. I am performing the instructions in a Ubuntu VM on a windows host. I used Localtunnel to create public URLs and configured the env files as follows.

.env-ui

ISSUER_UI_AUTH_USERNAME=user-ui
ISSUER_UI_AUTH_PASSWORD=password-ui
ISSUER_UI_BLOCK_EXPLORER_URL=https://www.oklink.com/amoy
ISSUER_UI_BUILD_TAG=
ISSUER_UI_WARNING_MESSAGE=
ISSUER_UI_IPFS_GATEWAY_URL=https://ipfs.io
ISSUER_UI_SCHEMA_EXPLORER_AND_BUILDER_URL=https://schema-builder.polygonid.me
ISSUER_UI_INSECURE=false

.env-api

# tried both http://localhost:3002 and https://issuer-credentials.loca.lt (from local tunnel)
#ISSUER_API_UI_SERVER_URL=https://issuer-credentials.loca.lt
ISSUER_API_UI_SERVER_URL=http://localhost:3002
ISSUER_API_UI_SERVER_PORT=3002
ISSUER_API_UI_AUTH_USER=user-api
ISSUER_API_UI_AUTH_PASSWORD=password-api
ISSUER_API_UI_ISSUER_NAME=Digroup.AI Credential Issuer
ISSUER_API_UI_ISSUER_LOGO=
ISSUER_API_UI_ISSUER_DID=did:polygonid:polygon:amoy:******************
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}]'

.env-issuer (some sensitive info replaced with **)

ISSUER_SERVER_URL=https://issuer-identities.loca.lt
ISSUER_SERVER_PORT=3001
ISSUER_NATIVE_PROOF_GENERATION_ENABLED=true
ISSUER_PUBLISH_KEY_PATH=pbkey
ISSUER_ONCHAIN_PUBLISH_STATE_FREQUENCY=1m
ISSUER_ONCHAIN_CHECK_STATUS_FREQUENCY=1m
ISSUER_DATABASE_URL=postgres://polygonid:polygonid@postgres:5432/platformid?sslmode=disable
ISSUER_IPFS_GATEWAY_URL=https://ipfs.io
ISSUER_LOG_LEVEL=-4
ISSUER_LOG_MODE=2
ISSUER_API_AUTH_USER=user-issuer
ISSUER_API_AUTH_PASSWORD=password-issuer
ISSUER_KEY_STORE_ADDRESS=http://vault:8200
ISSUER_KEY_STORE_PLUGIN_IDEN3_MOUNT_PATH=iden3

# from Alchemy App: https://dashboard.alchemy.com/apps/2w4eabqiwoh51ycz/networks
ISSUER_ETHEREUM_URL=https://polygon-amoy.g.alchemy.com/v2/*******************8
ISSUER_ETHEREUM_CONTRACT_ADDRESS=0x1a*************************************************
ISSUER_ETHEREUM_DEFAULT_GAS_LIMIT=600000
ISSUER_ETHEREUM_CONFIRMATION_TIME_OUT=600s
ISSUER_ETHEREUM_CONFIRMATION_BLOCK_COUNT=5
ISSUER_ETHEREUM_RECEIPT_TIMEOUT=600s
ISSUER_ETHEREUM_MIN_GAS_PRICE=0
ISSUER_ETHEREUM_MAX_GAS_PRICE=2500000
ISSUER_ETHEREUM_GASLESS=false
ISSUER_ETHEREUM_RPC_RESPONSE_TIMEOUT=5s
ISSUER_ETHEREUM_WAIT_RECEIPT_CYCLE_TIME=30s
ISSUER_ETHEREUM_WAIT_BLOCK_CYCLE_TIME=30s
ISSUER_ETHEREUM_RESOLVER_PREFIX=polygon:amoy
ISSUER_ETHEREUM_TRANSFER_ACCOUNT_KEY_PATH=pbkey

ISSUER_PROVER_SERVER_URL=http://localhost:8002
ISSUER_PROVER_TIMEOUT=600s
ISSUER_CIRCUIT_PATH=./pkg/credentials/circuits
ISSUER_REDIS_URL=redis://@redis:6379/1
ISSUER_SCHEMA_CACHE=false

ISSUER_VAULT_USERPASS_AUTH_ENABLED=false
ISSUER_VAULT_USERPASS_AUTH_PASSWORD=password

ISSUER_CREDENTIAL_STATUS_ONCHAIN_TREE_STORE_SUPPORTED_CONTRACT=0x3d3******************************
ISSUER_CREDENTIAL_STATUS_RHS_URL=http://localhost:3001
ISSUER_CREDENTIAL_STATUS_PUBLISHING_KEY_PATH=pbkey
ISSUER_CREDENTIAL_STATUS_RHS_MODE=None
ISSUER_CREDENTIAL_STATUS_RHS_CHAIN_ID=<80002 | 80001 | 137>

ISSUER_MEDIA_TYPE_MANAGER_ENABLED=true

ISSUER_AUTO_PUBLISHING_TO_ON_CHAIN_RHS=true

ISSUER_KEY_STORE_TOKEN=hvs.ETY********************

System information

Issuer node version: vX.X.X - I cloned the latest on Aug 10th 2024. Not sure of the version. OS & Version: Ubuntu 24.04 LTS Browser & Version: Chrome and Firefox

docker ps shows

4017c2ac3f5a   issuer-pending_publisher   "sh -c 'sleep 4s && …"   11 minutes ago      Up 11 minutes                  0.0.0.0:3005->3005/tcp, :::3005->3005/tcp   issuer-pending_publisher-1
fafe3a16edd5   issuer-notifications       "sh -c 'sleep 4s && …"   About an hour ago   Up About an hour               0.0.0.0:3004->3004/tcp, :::3004->3004/tcp   issuer-notifications-1
c7fb9ad88863   issuer-ui                  "/bin/sh /app/script…"   About an hour ago   Up About an hour (unhealthy)   0.0.0.0:8088->80/tcp, :::8088->80/tcp       issuer-ui-1
bfaff80e8695   issuer-api                 "sh -c 'apk add curl…"   About an hour ago   Up 11 minutes (unhealthy)      0.0.0.0:3001->3001/tcp, :::3001->3001/tcp   issuer-api-1
70e0df87bcd7   redis:6-alpine             "docker-entrypoint.s…"   About an hour ago   Up About an hour (healthy)     0.0.0.0:6379->6379/tcp, :::6379->6379/tcp   issuer-redis-1
518a84339740   vault:1.13.2               "docker-entrypoint.s…"   About an hour ago   Up About an hour (healthy)     0.0.0.0:8200->8200/tcp, :::8200->8200/tcp   issuer-vault-1
a39a5a34921a   postgres:14-alpine         "docker-entrypoint.s…"   About an hour ago   Up About an hour (healthy)     0.0.0.0:5432->5432/tcp, :::5432->5432/tcp   issuer-postgres-1

The ui and api show unhealthy, but there are no errors in the logs, and I can access http://localhost:3001/#post-/v1/identities.

Logs (if needed)

issuer-api-1

docker logs issuer-api-1
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/community/x86_64/APKINDEX.tar.gz
(1/10) Installing ca-certificates (20240705-r0)
(2/10) Installing brotli-libs (1.1.0-r2)
(3/10) Installing c-ares (1.28.1-r0)
(4/10) Installing libunistring (1.2-r0)
(5/10) Installing libidn2 (2.3.7-r0)
(6/10) Installing nghttp2-libs (1.62.1-r0)
(7/10) Installing libpsl (0.21.5-r1)
(8/10) Installing zstd-libs (1.5.6-r0)
(9/10) Installing libcurl (8.9.0-r0)
(10/10) Installing curl (8.9.0-r0)
Executing busybox-1.36.1-r29.trigger
Executing ca-certificates-20240705-r0.trigger
OK: 17 MiB in 32 packages
time=2024-08-10T22:57:27.183Z level=DEBUG msg=database url="postgres://polygonid:polygonid@postgres:5432/platformid?sslmode=disable"
time=2024-08-10T22:57:27.397Z level=INFO msg="OK   20230103082420_initial.sql (183.7ms)"
time=2024-08-10T22:57:27.407Z level=INFO msg="OK   20230207173556_remove_unneded_field_from_identity_sql.sql (9.26ms)"
time=2024-08-10T22:57:27.478Z level=INFO msg="OK   20230303114429_add_schemas_table.sql (71.45ms)"
time=2024-08-10T22:57:27.503Z level=INFO msg="OK   20230308093840_add_connections_table.sql (23.86ms)"
time=2024-08-10T22:57:27.507Z level=INFO msg="OK   20230309164801_update_claims_mtp_proof_column.sql (4.72ms)"
time=2024-08-10T22:57:27.514Z level=INFO msg="OK   20230320144410_update_claims_mtp_column.sql (6.9ms)"
time=2024-08-10T22:57:27.536Z level=INFO msg="OK   20230322114550_add_links_table.sql (21.72ms)"
time=2024-08-10T22:57:27.542Z level=INFO msg="OK   20230329153017_add_column_issued_to_links_table.sql (5.53ms)"
time=2024-08-10T22:57:27.547Z level=INFO msg="OK   20230508112523_add_column_created_at_to_claims_table.sql (5.41ms)"
time=2024-08-10T22:57:27.551Z level=INFO msg="OK   20231214192507_add_refresh_service_to_link_table.sql (4.15ms)"
time=2024-08-10T22:57:27.555Z level=INFO msg="OK   20240111024427_add_display_method_to_link_table.sql (4.06ms)"
time=2024-08-10T22:57:27.565Z level=INFO msg="OK   202303311203222_add_pk_to_connections_table.sql (9.38ms)"
time=2024-08-10T22:57:27.573Z level=INFO msg="OK   202304121507181_add_linid_to_claims_table.sql (8ms)"
time=2024-08-10T22:57:27.578Z level=INFO msg="OK   202305111652000_remove_schema_attributes.sql (5.2ms)"
time=2024-08-10T22:57:27.592Z level=INFO msg="OK   202307051116210_add_schemas_version_title_description_column.sql (13.64ms)"
time=2024-08-10T22:57:27.599Z level=INFO msg="OK   202307111216560_update_schemas_version_title_column.sql (6.65ms)"
time=2024-08-10T22:57:27.605Z level=INFO msg="OK   202310090829241_update_identities_table.sql (5.92ms)"
time=2024-08-10T22:57:27.608Z level=INFO msg="OK   202311080942897_add_schema_type_description_to_claims.sql (3.41ms)"
time=2024-08-10T22:57:27.627Z level=INFO msg="OK   202311211436040_add_user_authentications_table.sql (18.62ms)"
time=2024-08-10T22:57:27.634Z level=INFO msg="OK   202402160649030_add_update_at_column_user_authentication.sql (6.56ms)"
time=2024-08-10T22:57:27.638Z level=INFO msg="OK   202402230818397_remove_schema_type_description_to_claims.sql (4.43ms)"
time=2024-08-10T22:57:27.638Z level=INFO msg="goose: successfully migrated database to version: 202402230818397"
time=2024-08-10T22:57:27.638Z level=INFO msg="migration done!"
2024/08/10 22:57:27 INFO starting issuer node... revision=""
2024/08/10 22:57:27 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-08-10T22:57:27.723Z level=INFO msg="Vault userpass auth not enabled"
time=2024-08-10T22:57:27.726Z level=INFO msg="native prover enabled" enabled=true
time=2024-08-10T22:57:28.019Z level=INFO msg="server started" port=3001
time=2024-08-10T22:59:13.845Z level=INFO msg="Shutting down"
OK: 17 MiB in 32 packages
time=2024-08-10T23:00:31.527Z level=DEBUG msg=database url="postgres://polygonid:polygonid@postgres:5432/platformid?sslmode=disable"
time=2024-08-10T23:00:31.538Z level=INFO msg="goose: no migrations to run. current version: 202402230818397"
time=2024-08-10T23:00:31.551Z level=INFO msg="migration done!"
2024/08/10 23:00:31 INFO starting issuer node... revision=""
2024/08/10 23:00:31 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-08-10T23:00:31.673Z level=INFO msg="Vault userpass auth not enabled"
time=2024-08-10T23:00:31.675Z level=INFO msg="native prover enabled" enabled=true
time=2024-08-10T23:00:32.071Z level=INFO msg="server started" port=3001
time=2024-08-10T23:05:22.594Z level=INFO msg="http req" req-id=bfaff80e8695/OBuo7huTR9-000001 method=GET uri=/ status=200 bytes=1075 ua="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" d=125.482µs
time=2024-08-10T23:05:23.797Z level=INFO msg="http req" req-id=bfaff80e8695/OBuo7huTR9-000002 method=GET uri=/static/docs/api/api.yaml status=200 bytes=24954 ua="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" d=365.051µs
time=2024-08-10T23:07:04.792Z level=INFO msg="http req" req-id=bfaff80e8695/OBuo7huTR9-000003 method=GET uri=/ status=200 bytes=1075 ua="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" d=96.276µs
time=2024-08-10T23:07:05.342Z level=INFO msg="http req" req-id=bfaff80e8695/OBuo7huTR9-000004 method=GET uri=/static/docs/api/api.yaml status=200 bytes=24954 ua="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" d=328.197µs
time=2024-08-10T23:53:03.515Z level=INFO msg="Shutting down"
OK: 17 MiB in 32 packages
time=2024-08-10T23:53:17.474Z level=DEBUG msg=database url="postgres://polygonid:polygonid@postgres:5432/platformid?sslmode=disable"
time=2024-08-10T23:53:17.484Z level=INFO msg="goose: no migrations to run. current version: 202402230818397"
time=2024-08-10T23:53:17.484Z level=INFO msg="migration done!"
2024/08/10 23:53:17 INFO starting issuer node... revision=""
2024/08/10 23:53:17 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-08-10T23:53:17.573Z level=INFO msg="Vault userpass auth not enabled"
time=2024-08-10T23:53:17.576Z level=INFO msg="native prover enabled" enabled=true
time=2024-08-10T23:53:18.046Z level=INFO msg="server started" port=3001
time=2024-08-10T23:54:31.942Z level=INFO msg="http req" req-id=bfaff80e8695/xeOBLKdCkD-000001 method=GET uri=/ status=200 bytes=1075 ua="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" d=121.223µs
time=2024-08-10T23:54:32.669Z level=INFO msg="http req" req-id=bfaff80e8695/xeOBLKdCkD-000002 method=GET uri=/static/docs/api/api.yaml status=200 bytes=24954 ua="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" d=613.366µs
time=2024-08-10T23:54:32.811Z level=INFO msg="http req" req-id=bfaff80e8695/xeOBLKdCkD-000003 method=GET uri=/favicon.ico status=200 bytes=1749 ua="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" d=76.075µs

issuer-ui-1

docker logs issuer-ui-1

> issuer-node-ui@1.0.0 build
> vite build

vite v4.5.2 building for production...
transforming...
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
✓ 4536 modules transformed.
rendering chunks...
computing gzip size...

(!) Some chunks are larger than 500 kBs after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
dist/index.html                     0.51 kB │ gzip:   0.34 kB
dist/assets/index-0797bb45.css      5.65 kB │ gzip:   1.79 kB
dist/assets/index-b2198717.js   2,581.59 kB │ gzip: 818.24 kB
✓ built in 39.49s
user-ui
password-ui
Adding password for user user-ui
user-ui:$apr1$XRM90bwt$Qqtpz5Y/sMrvz9kKlrvTK0
2024/08/10 23:04:21 [notice] 91#91: using the "epoll" event method
2024/08/10 23:04:21 [notice] 91#91: nginx/1.27.0
2024/08/10 23:04:21 [notice] 91#91: built by gcc 13.2.1 20231014 (Alpine 13.2.1_git20231014) 
2024/08/10 23:04:21 [notice] 91#91: OS: Linux 6.8.0-40-generic
2024/08/10 23:04:21 [notice] 91#91: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2024/08/10 23:04:21 [notice] 91#91: start worker processes
2024/08/10 23:04:21 [notice] 91#91: start worker process 92
2024/08/10 23:04:21 [notice] 91#91: start worker process 93
2024/08/10 23:04:21 [notice] 91#91: start worker process 94
172.18.0.1 - user-ui [10/Aug/2024:23:06:02 +0000] "GET /schemas HTTP/1.1" 200 514 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" "-"
172.18.0.1 - user-ui [10/Aug/2024:23:06:02 +0000] "GET /assets/index-b2198717.js HTTP/1.1" 200 2610691 "http://localhost:8088/schemas" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" "-"
172.18.0.1 - user-ui [10/Aug/2024:23:06:02 +0000] "GET /assets/index-0797bb45.css HTTP/1.1" 200 5645 "http://localhost:8088/schemas" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" "-"
172.18.0.1 - user-ui [10/Aug/2024:23:06:03 +0000] "GET /images/image-preview.png HTTP/1.1" 200 130096 "http://localhost:8088/schemas" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" "-"
172.18.0.1 - user-ui [10/Aug/2024:23:06:03 +0000] "GET /images/illustration-explainer.svg HTTP/1.1" 200 14822 "http://localhost:8088/schemas" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" "-"
172.18.0.1 - user-ui [10/Aug/2024:23:17:49 +0000] "GET /images/illustration-explainer.svg HTTP/1.1" 304 0 "http://localhost:8088/schemas" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" "-"
172.18.0.1 - user-ui [10/Aug/2024:23:28:08 +0000] "GET /schemas HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" "-"
172.18.0.1 - user-ui [10/Aug/2024:23:28:08 +0000] "GET /assets/index-b2198717.js HTTP/1.1" 304 0 "http://localhost:8088/schemas" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" "-"
172.18.0.1 - user-ui [10/Aug/2024:23:28:08 +0000] "GET /assets/index-0797bb45.css HTTP/1.1" 304 0 "http://localhost:8088/schemas" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" "-"
172.18.0.1 - user-ui [10/Aug/2024:23:28:09 +0000] "GET /images/image-preview.png HTTP/1.1" 304 0 "http://localhost:8088/schemas" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" "-"
172.18.0.1 - user-ui [10/Aug/2024:23:28:09 +0000] "GET /images/illustration-explainer.svg HTTP/1.1" 304 0 "http://localhost:8088/schemas" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" "-"
172.18.0.1 - user-ui [10/Aug/2024:23:28:49 +0000] "GET / HTTP/1.1" 200 514 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" "73.162.162.2"
172.18.0.1 - user-ui [10/Aug/2024:23:28:49 +0000] "GET /assets/index-0797bb45.css HTTP/1.1" 200 5645 "https://issuer-ui.loca.lt/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" "73.162.162.2"
172.18.0.1 - user-ui [10/Aug/2024:23:28:49 +0000] "GET /assets/index-b2198717.js HTTP/1.1" 200 2610691 "https://issuer-ui.loca.lt/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" "73.162.162.2"
172.18.0.1 - user-ui [10/Aug/2024:23:28:53 +0000] "GET /favicon.png HTTP/1.1" 200 1297 "https://issuer-ui.loca.lt/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" "73.162.162.2"
172.18.0.1 - user-ui [10/Aug/2024:23:28:53 +0000] "GET /images/image-preview.png HTTP/1.1" 200 130096 "https://issuer-ui.loca.lt/schemas" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" "73.162.162.2"
172.18.0.1 - user-ui [10/Aug/2024:23:28:53 +0000] "GET /fonts/Matter-Regular.woff2 HTTP/1.1" 200 31396 "https://issuer-ui.loca.lt/assets/index-0797bb45.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" "73.162.162.2"
172.18.0.1 - user-ui [10/Aug/2024:23:28:53 +0000] "GET /images/illustration-explainer.svg HTTP/1.1" 200 14822 "https://issuer-ui.loca.lt/schemas" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" "73.162.162.2"
172.18.0.1 - user-ui [11/Aug/2024:00:00:17 +0000] "GET /images/illustration-explainer.svg HTTP/1.1" 304 0 "https://issuer-ui.loca.lt/schemas" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36" "73.162.162.2"
barrybecker4 commented 2 months ago

Looking at the network tab it looks like a CORS error. I think this means that perhaps all the public URLs in the env files need to have the same base URL. image

barrybecker4 commented 2 months ago

I guess I am confused as to exactly which URLS in the env files need to have Localtunnel public URLs and which can be localhost. I am also not sure what the exact Localtunnel commands should be.

I used: lt --port 3001 --subdomain issuer-identities & yields: https://issuer-identities.loca.lt/ (with a password)

lt --port 3002 --subdomain issuer-credentials & yields: https://issuer-credentials.loca.lt/

lt --port 8088 --subdomain issuer-ui & yields https://issuer-ui.loca.lt/

There is an IP password for each that needs to be entered. Since late 2023 it cannot be avoided. That may be causing issues.

barrybecker4 commented 2 months ago

By adding 10.0.2.15 host.docker.internal (where 10.0.2.15 is IP address assigned to the host by VirtualBox) to my /etc/hosts, I now see all the containers healthy, but I still see the same "Network Error" message in the UI. The Network tab shows CORS errors.

CONTAINER ID   IMAGE                      COMMAND                  CREATED         STATUS                       PORTS                                       NAMES
98e25380f2aa   issuer-ui                  "/bin/sh /app/script…"   9 minutes ago   Up 9 minutes (healthy)       0.0.0.0:8088->80/tcp, :::8088->80/tcp       issuer-ui-1
004636a7a1b7   issuer-pending_publisher   "sh -c 'sleep 4s && …"   9 minutes ago   Up 9 minutes                 0.0.0.0:3005->3005/tcp, :::3005->3005/tcp   issuer-pending_publisher-1
a91cb08da6c0   issuer-notifications       "sh -c 'sleep 4s && …"   9 minutes ago   Up 9 minutes                 0.0.0.0:3004->3004/tcp, :::3004->3004/tcp   issuer-notifications-1
bddda4883659   issuer-api                 "sh -c 'apk add curl…"   6 days ago      Up 36 minutes (healthy)      0.0.0.0:3001->3001/tcp, :::3001->3001/tcp   issuer-api-1
235c36666f75   redis:6-alpine             "docker-entrypoint.s…"   6 days ago      Up About an hour (healthy)   0.0.0.0:6379->6379/tcp, :::6379->6379/tcp   issuer-redis-1
398ba113b229   postgres:14-alpine         "docker-entrypoint.s…"   6 days ago      Up About an hour (healthy)   0.0.0.0:5432->5432/tcp, :::5432->5432/tcp   issuer-postgres-1
212d41379ccc   vault:1.13.2               "docker-entrypoint.s…"   6 days ago      Up About an hour (healthy)   0.0.0.0:8200->8200/tcp, :::8200->8200/tcp   issuer-vault-1
barrybecker4 commented 2 months ago

The frontend application, running on https://issuer-ui.loca.lt, is trying to make an XMLHttpRequest (AJAX request) to the backend API endpoint https://issuer-credentials.loca.lt/v1/schemas. Since these URLs have different origins (different subdomains under loca.lt), the browser enforces the CORS policy and checks for the Access-Control-Allow-Origin header in the response from the backend server. The error message indicates that this header is missing, causing the browser to block the request.

How do I get around CORS without modifying the code? Alernatively, perhaps the CORS headers can be added?

barrybecker4 commented 2 months ago

I also tried following the steps to install the issuer-node on Kubernetes.

I created a values file, env-vars-bb4.yaml that looks like this

privateKey: "<private key from metamask>"
appInstanceName:: polygon-id-issuer
appDomain: "issuer-app.barrybecker4.org"
uiDomain: "issuer-ui.barrybecker4.org"
apiDomain: "issuer-api.barrybecker4.org"
mainnet: false
uiPassword: "password-issuer"
issuerName: "user-issuer"
issuerEthereumUrl: "https://polygon-amoy.g.alchemy.com/v2/***********************************"
ingressEnabled: false
vaultpwd: "password-vault"
rhsMode: "None"
rhsUrl: "https://reverse-hash-service.com"
issuerCustomDidMethods:
  - blockchain: "linea"
    network: "testnet"
    networkFlag: "0b01000001"
    chainID: 59140
issuerKeyStoreToken: "hvs.ETYYrRk4JDXAgubnm6LZTLAw"
issuerSchemaCache: false
issuerMediaTypeManagerEnabled: true
issuerApiUiIssuerDid: "polygon:amoy:****************************************"
issuerApiUiAuthUser: "user-api"
issuerApiUiAuthPassword: "password-api"
issuerApiUiIssuerName: "user-ui"
issuerApiUiIssuerDid: "password-ui"
issuerApiUiSchemaCache: false
issuerApiIdentityMethod: "polygonid"
issuerApiIdentityBlockchain: "polygon"
issuerApiIdentityNetwork: "amoy"

Then start the pods using this script

#!/bin/bash

APP_INSTANCE_NAME="polygon-id-issuer"
NAMESPACE="default"

helm install "$APP_INSTANCE_NAME" . \
  --create-namespace --namespace "$NAMESPACE" \
  --values env-vars-bb4.yaml

All the pods startup successfully, but when I try to access http://http://issuer-api.barrybecker4.org/, I get 503 Service Temporarily Unavailable. Looking at the logs for api-issuer-node, I see

time=2024-08-25T15:08:20.813Z level=DEBUG msg=database url="postgres://polygonid:strongpasswordapp@postgres-issuer-node-svc:5432/platformid?sslmode=disable"
time=2024-08-25T15:08:20.880Z level=INFO msg="goose: no migrations to run. current version: 202402230818397"
time=2024-08-25T15:08:20.880Z level=INFO msg="migration done!"
2024/08/25 15:08:21 INFO starting issuer node... revision=""
2024/08/25 15:08:21 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]\""
2024/08/25 15:08:21 INFO ISSUER_KEY_STORE_TOKEN value is missing
2024/08/25 15:08:21 INFO ISSUER_SCHEMA_CACHE is missing and the server set up it as false
2024/08/25 15:08:21 INFO ISSUER_MEDIA_TYPE_MANAGER_ENABLED is missing and the server set up it as true
2024/08/25 15:08:21 INFO ISSUER_API_UI_KEY_TYPE is missing and the server set up it as BJJ
2024/08/25 15:08:21 INFO ISSUER_API_UI_SERVER_PORT value is missing
2024/08/25 15:08:21 INFO ISSUER_API_UI_SERVER_URL value is missing
2024/08/25 15:08:21 INFO ISSUER_API_UI_AUTH_USER value is missing
2024/08/25 15:08:21 INFO ISSUER_API_UI_AUTH_PASSWORD value is missing
2024/08/25 15:08:21 INFO ISSUER_API_UI_ISSUER_NAME value is missing
2024/08/25 15:08:21 INFO ISSUER_API_UI_ISSUER_DID value is missing
2024/08/25 15:08:21 INFO ISSUER_API_UI_SCHEMA_CACHE is missing and the server set up it as false
2024/08/25 15:08:21 INFO ISSUER_API_IDENTITY_METHOD value is missing and the server set up it as polygonid
2024/08/25 15:08:21 INFO ISSUER_API_IDENTITY_BLOCKCHAIN value is missing and the server set up it as polygon
2024/08/25 15:08:21 INFO ISSUER_API_IDENTITY_NETWORK value is missing and the server set up it as amoy
time=2024-08-25T15:08:21.093Z level=INFO msg="Vault userpass auth enabled"
time=2024-08-25T15:08:22.816Z level=INFO msg="successfully logged in to vault with userpass auth" token=hvs.CAESIOAikDpNfnNsuBAYLVj5k6gXVvi_TftWayLS5yIhJU0IGh4KHGh2cy55aUpGMzh5Q1NjZ3I3WXFoUTZaaG56UHU
time=2024-08-25T15:08:22.828Z level=INFO msg="native prover enabled" enabled=true
time=2024-08-25T15:08:23.105Z level=INFO msg="Vault token successfully renewed" renewal=2024-08-25T15:08:23.105Z
time=2024-08-25T15:08:23.349Z level=INFO msg="server started" port=3001

Does that mean that configuration is missing? Where should that configuration be set?

x1m3 commented 2 months ago

Hello @barrybecker4

I think the certificate for loca.it is misconfigured and ends up returning html content, instead of the API response.

Can you try to call directly (curl, postman, etc...) to some url in the domain https://issuer-credentials.loca.it, for example https://issuer-credentials.loca.it/v1/state/status?

barrybecker4 commented 2 months ago

@x1m3 , thanks responding. I ran lt --port 3001 --subdomain issuer-identities & to create the public URL. I can then access https://issuer-identities.loca.lt/#post-/v1/identities from guest VM browser and in host browser.

Then I ran lt --port 3002 --subdomain issuer-credentials & and put the resulting https://issuer-credentials.loca.lt in .env.api as the value for ISSUER_API_UI_SERVER_URL.
Should http://localhost:3002 be accessible after running make run? Its not. After running make run-ui, and waiting a few minutes, all the containers show healthy.

Now when I run curl -v https://issuer-credentials.loca.lt/v1/state/status, the response looks OK. I do not see a certificate error.

* Host issuer-credentials.loca.lt:443 was resolved.
* IPv6: (none)
* IPv4: 193.34.76.44
*   Trying 193.34.76.44:443...
* Connected to issuer-credentials.loca.lt (193.34.76.44) port 443
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-ECDSA-CHACHA20-POLY1305 / X25519 / id-ecPublicKey
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=loca.lt
*  start date: Jul 28 01:59:11 2024 GMT
*  expire date: Oct 26 01:59:10 2024 GMT
*  subjectAltName: host "issuer-credentials.loca.lt" matched cert's "*.loca.lt"
*  issuer: C=US; O=Let's Encrypt; CN=E6
*  SSL certificate verify ok.
*   Certificate level 0: Public key type EC/prime256v1 (256/128 Bits/secBits), signed using ecdsa-with-SHA384
*   Certificate level 1: Public key type EC/secp384r1 (384/192 Bits/secBits), signed using sha256WithRSAEncryption
*   Certificate level 2: Public key type RSA (4096/152 Bits/secBits), signed using sha256WithRSAEncryption
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://issuer-credentials.loca.lt/v1/state/status
* [HTTP/2] [1] [:method: GET]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: issuer-credentials.loca.lt]
* [HTTP/2] [1] [:path: /v1/state/status]
* [HTTP/2] [1] [user-agent: curl/8.5.0]
* [HTTP/2] [1] [accept: */*]
> GET /v1/state/status HTTP/2
> Host: issuer-credentials.loca.lt
> User-Agent: curl/8.5.0
> Accept: */*
> 
< HTTP/2 404 
< server: nginx/1.17.9
< date: Sat, 31 Aug 2024 13:28:27 GMT
< content-length: 3
< ratelimit-limit: 6000
< ratelimit-remaining: 5999
< ratelimit-reset: 290
404

There is a 404 at the end though, and I see 404 in the web page too if I try it there. In the network tab, I also see a 511 error. If I look at the response, I see this image I tried entering the tunnel pw there, but it did nothing. To bypass the page, the localtunnel instructions suggest

But I don't know how to do that without modifying the issuernode code. Do you have a suggestion for how to get past this?

barrybecker4 commented 2 months ago

I did finally get it working, but it was difficult. I made this PR to update the README with some additional guidance.

barrybecker4 commented 1 month ago

Should I be trying the develop-v2 branch instead of the main branch? Is that the updated README?