junjie wu
junjie wu

Reputation: 1

Hyperledger Fabric External builder Failed to generate a Dockerfile: Unknown chaincodeType: EXTERNAL

peer lifecycle chaincode install ../asset-transfer-basic/chaincode-external/asset-transfer-basic-external.tgz

Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: platform builder failed: Failed to generate a Dockerfile: Unknown chaincodeType: EXTERNAL

Upvotes: 0

Views: 2037

Answers (2)

Jani Lintunen
Jani Lintunen

Reputation: 9

This can happen because for one reason or another your external builder is not being executed at all and that causes the peer to try to install the chaincode by the traditional way. For that part of the code type external is not supported, hence the error.

In my case the mistake was that my core.yaml was misformatted because the externalBuilders definition was indented too much to right so it wasn't defined under chaincode definition anymore. And because in reality the external builder wasn't defined at all because of the misformatting it couldn't be executed and then I got exactly the same error.

So, be careful how you format your yaml files.

Upvotes: 0

Saicharan Pogul
Saicharan Pogul

Reputation: 89

Provide the required permissions of scripts in the bin (build, release, detect) directory.

chmod 777 -R bin/

And also make sure to map the chaincode directory properly

core.yaml

externalBuilders: 
    # This path has to be mapped to peer containers with a local chaincode directory
    - path: /opt/gopath/src/github.com/hyperledger/external-builder
      name: chaincode-external-builder
      propagateEnvironment:
         - CORE_PEER_TLS_ROOTCERT_FILE
         - CORE_PEER_TLS_CERT_FILE
         - CORE_PEER_TLS_KEY_FILE

docker-compose.yaml

....
  volumes:
    # external builder chaincode path (local/path:container/path)
    - ../chaincode:/opt/gopath/src/github.com/hyperledger/external-builder

Upvotes: 0

Related Questions