I am trying to deploy chaincode using the chain code for developers tutorial "<http://hyperledger-fabric.readthedocs.io/en/latest/chaincode4ade.html>". I was able to complete the steps till Terminal 2 but get an Error in the command "docker exec -it cli bash" for Terminal 3. 

Output for Terminal 1:

> 
> []Received message REGISTER from shim
>  peer | 2017-08-22 23:29:26.025 UTC [chaincode] HandleMessage -> DEBU 1a9 []Fabric side Handling ChaincodeMessage of type: REGISTER in state created
>  peer | 2017-08-22 23:29:26.025 UTC [chaincode] beforeRegisterEvent -> DEBU 1aa Received REGISTER in state created
>  peer | 2017-08-22 23:29:26.025 UTC [chaincode] registerHandler -> DEBU 1ab registered handler complete for chaincode mycc:0
>  peer | 2017-08-22 23:29:26.025 UTC [chaincode] beforeRegisterEvent -> DEBU 1ac Got REGISTER for chaincodeID = name:"mycc:0" , sending back REGISTERED
>  peer | 2017-08-22 23:29:26.025 UTC [chaincode] notifyDuringStartup -> DEBU 1ad nothing to notify (dev mode ?)
>  peer | 2017-08-22 23:29:26.025 UTC [chaincode] notifyDuringStartup -> DEBU 1ae sending READY
>  peer | 2017-08-22 23:29:26.025 UTC [chaincode] processStream -> DEBU 1af []Move state message READY
>  peer | 2017-08-22 23:29:26.025 UTC [chaincode] HandleMessage -> DEBU 1b0 []Fabric side Handling ChaincodeMessage of type: READY in state established
>  peer | 2017-08-22 23:29:26.026 UTC [chaincode] enterReadyState -> DEBU 1b1 []Entered state ready
>  peer | 2017-08-22 23:29:26.026 UTC [chaincode] notify -> DEBU 1b2 notifier Txid: does not exist
>  peer | 2017-08-22 23:29:26.026 UTC [chaincode] processStream -> DEBU 1b3 []sending state message READY
> 
> 
> 

Output for Terminal 2: 

> 
> CORE\_PEER\_ADDRESS=peer:7051 CORE\_CHAINCODE\_ID\_NAME=mycc:0 ./sacc
>  2017-08-22 23:29:26.020 UTC [shim] SetupChaincodeLogging -> INFO 001 Chaincode log level not provided; defaulting to: INFO
>  2017-08-22 23:29:26.020 UTC [shim] SetupChaincodeLogging -> INFO 002 Chaincode (build level: ) starting up ...
> 
> 
> 

Output for Terminal 3:

> 
> docker exec -it cli bash
>  Error response from daemon: Container 37efeab8d4930060c9de46d3bab9ab1ab034781be26b4a5176b80b54d6c1180b is not running
> 
> 
> 

I couldn't find any resolution for this. Can anyone help me? I am using MacOS X.

I uncommented the line "command: /bin/bash -c './script.sh'" in the yaml file.

Output for docker ps after terminal 1:

> 
> docker ps
>  CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
>  befcf58f4b59 hyperledger/fabric-ccenv "/bin/bash -c 'sle..." 21 seconds ago Up 20 seconds chaincode
>  3129dac3e13b hyperledger/fabric-peer "peer node start -..." 21 seconds ago Up 20 seconds 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer
>  56a92979e7cb hyperledger/fabric-orderer "orderer" 22 seconds ago Up 21 seconds 0.0.0.0:7050->7050/tcp orderer
> 
> 
> 

Output for docker ps after terminal 2:

> 
> docker ps
>  CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
>  befcf58f4b59 hyperledger/fabric-ccenv "/bin/bash -c 'sle..." 2 minutes ago Up 2 minutes chaincode
>  3129dac3e13b hyperledger/fabric-peer "peer node start -..." 2 minutes ago Up 2 minutes 0.0.0.0:7051->7051/tcp, 0.0.0.0:7053->7053/tcp peer
>  56a92979e7cb hyperledger/fabric-orderer "orderer" 2 minutes ago Up 2 minutes 0.0.0.0:7050->7050/tcp orderer
> 
> 
> 

Cli Error while running .yaml file:

> 
> Returning dummy reject all policy because Admins could not be found in /Application/Admins
>  orderer | 2017-08-23 23:09:50.644 UTC [policies] GetPolicy -> DEBU 154 Returning policy Readers for evaluation
>  orderer | 2017-08-23 23:09:50.644 UTC [policies] GetPolicy -> DEBU 155 Returning dummy reject all policy because Readers could not be found in /Application/Readers
>  orderer | 2017-08-23 23:09:50.644 UTC [policies] GetPolicy -> DEBU 156 Returning policy Writers for evaluation
>  orderer | 2017-08-23 23:09:50.645 UTC [policies] GetPolicy -> DEBU 157 Returning dummy reject all policy because Writers could not be found in /Application/Writers
>  orderer | 2017-08-23 23:09:50.645 UTC [common/configtx] addToMap -> DEBU 158 Adding to config map: [Groups] /Channel
>  orderer | 2017-08-23 23:09:50.645 UTC [common/configtx] addToMap -> DEBU 159 Adding to config map: [Groups] /Channel/Application
>  orderer | 2017-08-23 23:09:50.645 UTC [common/configtx] addToMap -> DEBU 15a Adding to config map: [Groups] /Channel/Application/SampleOrg
>  cli | Error: Got unexpected status: BAD\_REQUEST
>  orderer | 2017-08-23 23:09:50.645 UTC [common/configtx] addToMap -> DEBU 15b Adding to config map: [Values] /Channel/Consortium
>  orderer | 2017-08-23 23:09:50.645 UTC [common/configtx] addToMap -> DEBU 15c Adding to config map: [Groups] /Channel
>  cli | Usage:
>  cli | peer channel create [flags]
>  cli | 
>  cli | Flags:
>  orderer | 2017-08-23 23:09:50.645 UTC [common/configtx] addToMap -> DEBU 15d Adding to config map: [Groups] /Channel/Application
>  cli | -c, --channelID string In case of a newChain command, the channel ID to create.
>  orderer | 2017-08-23 23:09:50.645 UTC [common/configtx] addToMap -> DEBU 15e Adding to config map: [Groups] /Channel/Application/SampleOrg
>  cli | -f, --file string Configuration transaction file generated by a tool such as configtxgen for submitting to orderer
>  orderer | 2017-08-23 23:09:50.646 UTC [common/configtx] addToMap -> DEBU 15f Adding to config map: [Policy] /Channel/Application/Admins
>  cli | -t, --timeout int Channel creation timeout (default 5)
>  cli | 
>  cli | Global Flags:
>  cli | --cafile string Path to file containing PEM-encoded trusted certificate(s) for the ordering endpoint
>  cli | --logging-level string Default logging level and overrides, see core.yaml for full syntax
>  cli | -o, --orderer string Ordering service endpoint
>  orderer | 2017-08-23 23:09:50.646 UTC [common/configtx] addToMap -> DEBU 160 Adding to config map: [Policy] /Channel/Application/Writers
>  cli | --test.coverprofile string Done (default "coverage.cov")
>  cli | --tls Use TLS when communicating with the orderer endpoint
>  cli | -v, --version Display current version of fabric peer server
>  cli | 
>  orderer | 2017-08-23 23:09:50.646 UTC [common/configtx] addToMap -> DEBU 161 Adding to config map: [Policy] /Channel/Application/Readers
>  orderer | 2017-08-23 23:09:50.646 UTC [common/configtx] addToMap -> DEBU 162 Adding to config map: [Values] /Channel/Consortium
>  orderer | 2017-08-23 23:09:50.646 UTC [orderer/common/broadcast] Handle -> WARN 163 Rejecting CONFIG\_UPDATE because: Error authorizing update: Error validating DeltaSet: invalid mod\_policy for element [Policy] /Channel/Application/Writers: mod\_policy not set
>  orderer | 2017-08-23 23:09:50.646 UTC [orderer/main] func1 -> DEBU 164 Closing Broadcast stream
>  orderer | 2017-08-23 23:09:50.648 UTC [orderer/common/deliver] Handle -> WARN 165 Error reading from stream: rpc error: code = Canceled desc = context canceled
>  orderer | 2017-08-23 23:09:50.649 UTC [orderer/main] func1 -> DEBU 166 Closing Deliver stream
> 
> 
>