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

fix(plugin-ledger-connector-iroha): running the container image locally fails #1874

Closed
izuru0 opened this issue Feb 22, 2022 · 4 comments · Fixed by #2207
Closed

fix(plugin-ledger-connector-iroha): running the container image locally fails #1874

izuru0 opened this issue Feb 22, 2022 · 4 comments · Fixed by #2207
Labels
bug Something isn't working documentation Improvements or additions to documentation Iroha Bugs/features related to the Iroha ledger connector plugin P2 Priority 2: High

Comments

@izuru0
Copy link
Contributor

izuru0 commented Feb 22, 2022

Describe the bug

when trying to run iroha connector container locally by following README, command docker run returns error.

To Reproduce

first:

yarn run configure
yarn run build:dev:backend
DOCKER_BUILDKIT=1 docker build -f ./packages/cactus-plugin-ledger-connector-iroha/Dockerfile . -t cplcb

then:

docker run \
  --rm \
  --publish 3000:3000 \
  --publish 4000:4000 \
  --publish 5000:5000 \
  --env PLUGINS='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-iroha", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL",  "options": {"rpcApiHttpHost": "http://localhost:8545", "instanceId": "some-unique-iroha-connector-instance-id"}}]' \
  cplcb

Expected behavior

container runs.

Logs/Stack traces

docker-command-log.txt

Cloud provider or hardware configuration:

local pc

Operating system name, version, build:

/tmp/tryiroha/cactus$ printf "$(uname -srm)\n$(cat /etc/os-release)\n"
Linux 5.13.0-30-generic x86_64
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
/tmp/tryiroha/cactus$ node --version
v16.13.1
/tmp/tryiroha/cactus$ docker --version
Docker version 20.10.7, build 20.10.7-0ubuntu5~20.04.2
/tmp/tryiroha/cactus$ 

Hyperledger Cactus release version or commit (git rev-parse --short HEAD):

/tmp/tryiroha/cactus$ git rev-parse --short HEAD
a8734bf0

Hyperledger Cactus Plugins/Connectors Used

iroha

@izuru0 izuru0 added bug Something isn't working documentation Improvements or additions to documentation Iroha Bugs/features related to the Iroha ledger connector plugin labels Feb 22, 2022
@petermetz petermetz added the P2 Priority 2: High label Feb 25, 2022
@izuru0
Copy link
Contributor Author

izuru0 commented Mar 11, 2022

@petermetz are there any workaround for this?

@petermetz
Copy link
Member

petermetz commented Mar 24, 2022

@izuru0 Apologies for the slow response, I'm investigating this and it's looking like one of those cascading/domino effect bugs where multiple things came together to wreak havoc...
A part of the plot has been uncovered and documented here, but I'm working on more of it so please stay tuned: #1951

@petermetz
Copy link
Member

One more thing (more of a note to self) is that you'll also need the authorization configuration in the env variables (if that's the preferred way for you to provide the config) so something like this for testing & development should work better:

(this still won't work as of today until the other fixes are in place but I wanted to make not anyway because it's one more clue)

docker run \
  --rm \
  --publish 3000:3000 \
  --publish 4000:4000 \
  --publish 5000:5000 \
  --env AUTHORIZATION_CONFIG_JSON="{}"\
  --env AUTHORIZATION_PROTOCOL=NONE \
  --env PLUGINS='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-iroha", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL",  "options": {"rpcApiHttpHost": "http://localhost:8545", "instanceId": "some-unique-iroha-connector-instance-id"}}]' \
  cplcb:latest

@jagpreetsinghsasan
Copy link
Contributor

jagpreetsinghsasan commented Nov 10, 2022

One more thing (more of a note to self) is that you'll also need the authorization configuration in the env variables (if that's the preferred way for you to provide the config) so something like this for testing & development should work better:

(this still won't work as of today until the other fixes are in place but I wanted to make not anyway because it's one more clue)

docker run \
  --rm \
  --publish 3000:3000 \
  --publish 4000:4000 \
  --publish 5000:5000 \
  --env AUTHORIZATION_CONFIG_JSON="{}"\
  --env AUTHORIZATION_PROTOCOL=NONE \
  --env PLUGINS='[{"packageName": "@hyperledger/cactus-plugin-ledger-connector-iroha", "type": "org.hyperledger.cactus.plugin_import_type.LOCAL", "action": "org.hyperledger.cactus.plugin_import_action.INSTALL",  "options": {"rpcApiHttpHost": "http://localhost:8545", "instanceId": "some-unique-iroha-connector-instance-id"}}]' \
  cplcb:latest

I tried running the plain cactus-cmd-api-server with the similar above command, and even that wasn't working.
So I had to create a sample config.json with this field specifically mentioned grpcMtlsEnabled set to false.
Then only I could make the api-server running using this command

docker run --rm --publish 3000:3000 --publish 4000:4000 --mount type=bind,source="$(pwd)"/.config.json,target=/config.json --env AUTHORIZATION_CONFIG_JSON="{}"  --env AUTHORIZATION_PROTOCOL=NONE --env CONFIG_FILE=/config.json cas

And the iroha plugin was not able to run (in my case) with the error run-time-error module not found
Currently looking into this (because the container actually contains the run-time-error module under node_modules, as shown in the below screenshot, thus investigating)

image
image

jagpreetsinghsasan added a commit to jagpreetsinghsasan/cactus that referenced this issue Nov 16, 2022
    Primary Changes
    ---------------
    1. Updated iroha package.json to include a missing dependency
    2. Updated Dockerfile to include new api-server image and
       used yarn to install the iroha package
    3. Updated README.md to include the newly changes to both
       the api-server as well as iroha connector plugin
    4. Updated cmd-api-server README.md to include similar
       changes

Fixes hyperledger#1874

Signed-off-by: jagpreetsinghsasan <jagpreet.singh.sasan@accenture.com>
jagpreetsinghsasan added a commit to jagpreetsinghsasan/cactus that referenced this issue Nov 18, 2022
    Primary Changes
    ---------------
    1. Updated iroha package.json to include a missing dependency
    2. Updated Dockerfile to include new api-server image and
       used yarn to install the iroha package
    3. Updated README.md to include the newly changes to both
       the api-server as well as iroha connector plugin
    4. Updated cmd-api-server README.md to include similar
       changes

Fixes hyperledger#1874

Signed-off-by: jagpreetsinghsasan <jagpreet.singh.sasan@accenture.com>
petermetz pushed a commit to jagpreetsinghsasan/cactus that referenced this issue Nov 20, 2022
    Primary Changes
    ---------------
    1. Updated iroha package.json to include a missing dependency
    2. Updated Dockerfile to include new api-server image and
       used yarn to install the iroha package
    3. Updated README.md to include the newly changes to both
       the api-server as well as iroha connector plugin
    4. Updated cmd-api-server README.md to include similar
       changes

Fixes hyperledger#1874

Signed-off-by: jagpreetsinghsasan <jagpreet.singh.sasan@accenture.com>
petermetz pushed a commit that referenced this issue Nov 20, 2022
    Primary Changes
    ---------------
    1. Updated iroha package.json to include a missing dependency
    2. Updated Dockerfile to include new api-server image and
       used yarn to install the iroha package
    3. Updated README.md to include the newly changes to both
       the api-server as well as iroha connector plugin
    4. Updated cmd-api-server README.md to include similar
       changes

Fixes #1874

Signed-off-by: jagpreetsinghsasan <jagpreet.singh.sasan@accenture.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation Iroha Bugs/features related to the Iroha ledger connector plugin P2 Priority 2: High
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants