Uploaded image for project: 'Fabric'
  1. Fabric
  2. FAB-17518

Fabcar and asset-transfer-basic Java samples are broken

    XMLWordPrintable

Details

    • Bug
    • Status: Unverified
    • High
    • Resolution: Unresolved
    • v2.0.0, v2.1.0, v2.0.1
    • None
    • fabric-samples
    • None
    • (Please add steps to reproduce)

    Description

      Chaincode installation fails:

      ~ # peer lifecycle chaincode install asset-transfer-basic.tar.gz
      Error: chaincode install failed with status: 500 - failed to invoke backing implementation of 'InstallChaincode': could not build chaincode: docker build failed: docker image build failed: Post "http://localhost:2375/build?networkmode=host&t=nid1-nw-242-142-3-nd-758-248-570-asset-transfer-basic-450f44681ed595bf1780960f661cdd4433cf6f62dc6debd7daf232e7f4c54d31-ed7349a7db9b52dba4d1e464b8be36a1642fe117e611b595987769a72deb32e9": docker build failed: Error returned from build: 1 "+ INPUT_DIR=/chaincode/input
      + OUTPUT_DIR=/chaincode/output
      ++ mktemp -d
      + TMP_DIR=/tmp/tmp.HphDKd
      ++ find /chaincode/input -name .jar
      ++ paste -s -d : -
      + JARS=
      ++ find /chaincode/input -name '*.jar'
      ++ wc -l
      + NUM_JARS=1
      + for DIR in ${INPUT_DIR} ${INPUT_DIR}/src
      + '[' -f /chaincode/input/build.gradle -o -f /chaincode/input/build.gradle.kts ']'
      + '[' -f /chaincode/input/pom.xml ']'
      + for DIR in ${INPUT_DIR} ${INPUT_DIR}/src
      + '[' -f /chaincode/input/src/build.gradle -o -f /chaincode/input/src/build.gradle.kts ']'
      + buildGradle /chaincode/input/src /chaincode/output
      + echo 'Copying from /chaincode/input/src to /tmp/tmp.HphDKd'
      Copying from /chaincode/input/src to /tmp/tmp.HphDKd
      + cd /chaincode/input/src
      + tar cf - .
      + cd /tmp/tmp.HphDKd
      + tar xf -
      Gradle build
      + cd /tmp/tmp.HphDKd
      + echo 'Gradle build'
      + '[' -f ./gradlew ']'
      + chmod +x ./gradlew
      + ./gradlew build shadowJar -x test
      Downloading https://services.gradle.org/distributions/gradle-6.5.1-bin.zip
      .................................................................................................
      Welcome to Gradle 6.5.1!
      Here are the highlights of this release:
       - Experimental file-system watching
       - Improved version ordering
       - New samples
      For more details see https://docs.gradle.org/6.5.1/release-notes.html
      Starting a Gradle Daemon (subsequent builds will be faster)
      FAILURE: Build failed with an exception.
      * What went wrong:
      Task 'shadowJar' not found in root project 'basic'.
      * Try:
      Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
      * Get more help at https://help.gradle.org
      BUILD FAILED in 21s
      "
      

      https://github.com/hyperledger/fabric-samples/blob/master/asset-transfer-basic/chaincode-java/build.gradle is missing shadowJar task while it is required by the chaincode builder: https://github.com/hyperledger/fabric-chaincode-java/blob/master/fabric-chaincode-docker/build.sh#L18.

      E.g. everything works well for https://github.com/hyperledger/fabric-samples/tree/master/chaincode/abstore/java which has a shadowJar task:

      ~ # peer lifecycle chaincode install abstore.tar.gz
      2020-10-22 10:36:39.821 UTC [cli.lifecycle.chaincode] submitInstallProposal -> INFO 001 Installed remotely: response:<status:200 payl
      oad:"\nHabstore:541c4f83dc833fdf667b4f25f237ee53f5d401517f8886df9d7b5572bea9c831\022\007abstore" >
      2020-10-22 10:36:39.823 UTC [cli.lifecycle.chaincode] submitInstallProposal -> INFO 002 Chaincode code package identifier: abstore:54
      1c4f83dc833fdf667b4f25f237ee53f5d401517f8886df9d7b5572bea9c831

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            toxzic Eugene Aseev
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: