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

./trade.sh up -d true only starting two containers #42

Open
progge-sol opened this issue Dec 18, 2018 · 13 comments
Open

./trade.sh up -d true only starting two containers #42

progge-sol opened this issue Dec 18, 2018 · 13 comments

Comments

@progge-sol
Copy link

executing the command
trade-finance-logistics/network/ # ./trade.sh up -d true
gives me no error but only starts the chaincode and orderer containers(as docker container ls shows me). So I am unable to follow chapter 4 in the Book. How to resolve this? Is there any way to start the missing peer and cli containers?

@VRamakrishna
Copy link
Collaborator

Logs are recorded in logs/network.log by default. Can you check them for errors?

@progge-sol
Copy link
Author

There is nothing added to network.log when starting trade.sh with "up -d true"

However, when starting without "-d true" I get

ERROR: for orderer.trade.com  Cannot start service orderer.trade.com: driver failed programming external connectivity on endpoint orderer.trade.com (a5c40b9b2494897cec5f8c490e3d265f49d497b446247cd5292aeb7b5f5b8b2c): Bind for 0.0.0.0:7050 failed: port is already allocated
Encountered errors while bringing up the project.

added to the logs.

@VRamakrishna
Copy link
Collaborator

You are getting the orderer bind error because there's already a service running that's listening on port 7050; most likely the ordering service from your earlier run.

Before attempting to start a network, you need to clean up the containers each time. You can run ./trade.sh clean for that, but it will also delete the network artifacts. To just clear the containers before restarting, run the following commands:

docker kill $(docker ps -q)
docker rm $(docker ps -a -f status=exited -q)

For the dev mode run (with -d true), the log file should be stored in the devmode subfolder. Check that out the next time you attempt a start.

@progge-sol
Copy link
Author

progge-sol commented Dec 18, 2018

There is still nothing added to neither logs/network.log nor logs/devmode/network.log. Latter was not even existent. Even after creation there was nothing added to it.

Edit: I ran these commands

root@test-VirtualBox:/home/test/go/go/src/trade-finance-logistics/network# docker kill $(docker ps -q)
ca89e14328e7
704c51f82f25
root@test-VirtualBox:/home/test/go/go/src/trade-finance-logistics/network# docker rm $(docker ps -a -f status=exited -q)
b7c18390ca2a
ca89e14328e7
3d0879918cca
704c51f82f25
root@test-VirtualBox:/home/test/go/go/src/trade-finance-logistics/network# ./trade.sh up -d true
Starting with channel 'tradechannel'
Continue? [Y/n] 
proceeding ...
2018-12-18 12:23:50.263 UTC [main] main -> INFO 001 Exiting.....
LOCAL_VERSION=1.1.2-snapshot-80853d8
DOCKER_IMAGE_VERSION=1.1.2-snapshot-80853d8
root@test-VirtualBox:/home/test/go/go/src/trade-finance-logistics/network# docker container ls
CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS              PORTS                    NAMES
879175b473b6        hyperledger/fabric-ccenv     "/bin/bash -c 'sle..."   3 seconds ago       Up 1 second                                  chaincode
11fb438319db        hyperledger/fabric-orderer   "orderer"                4 seconds ago       Up 2 seconds        0.0.0.0:7050->7050/tcp   orderer
```
`

@VRamakrishna
Copy link
Collaborator

Check devmode/logs/network.log. (I'm assuming you are running the command from the network folder.)

@progge-sol
Copy link
Author

progge-sol commented Dec 18, 2018

Ok, found it. This is the output of a single execute of ./trade.sh up -d true

Creating orderer
Creating peer
Creating chaincode
Creating cli
Attaching to orderer, peer, chaincode, cli
orderer      | 2018-12-18 12:42:35.459 UTC [localconfig] completeInitialization -> INFO 001 Kafka.Version unset, setting to 0.10.2.0
orderer      | 2018-12-18 12:42:35.496 UTC [orderer.common.server] prettyPrintStruct -> INFO 002 Orderer config values:
orderer      | 	General.LedgerType = "file"
orderer      | 	General.ListenAddress = "orderer"
orderer      | 	General.ListenPort = 7050
orderer      | 	General.TLS.Enabled = false
orderer      | 	General.TLS.PrivateKey = "/etc/hyperledger/fabric/tls/server.key"
orderer      | 	General.TLS.Certificate = "/etc/hyperledger/fabric/tls/server.crt"
orderer      | 	General.TLS.RootCAs = [/etc/hyperledger/fabric/tls/ca.crt]
orderer      | 	General.TLS.ClientAuthRequired = false
orderer      | 	General.TLS.ClientRootCAs = []
orderer      | 	General.Cluster.RootCAs = [/etc/hyperledger/fabric/tls/ca.crt]
orderer      | 	General.Cluster.ClientCertificate = ""
orderer      | 	General.Cluster.ClientPrivateKey = ""
orderer      | 	General.Cluster.DialTimeout = 5s
orderer      | 	General.Cluster.RPCTimeout = 7s
orderer      | 	General.Cluster.ReplicationBufferSize = 20971520
orderer      | 	General.Cluster.ReplicationPullTimeout = 5s
peer         | Error: unknown shorthand flag: 'o' in -o
peer         | Usage:
peer         |   peer node start [flags]
orderer      | 	General.Cluster.ReplicationRetryTimeout = 5s
orderer      | 	General.Keepalive.ServerMinInterval = 1m0s
peer         | 
orderer      | 	General.Keepalive.ServerInterval = 2h0m0s
orderer      | 	General.Keepalive.ServerTimeout = 20s
orderer      | 	General.GenesisMethod = "file"
orderer      | 	General.GenesisProfile = "SampleInsecureSolo"
orderer      | 	General.SystemChannel = "test-system-channel-name"
peer         | Flags:
orderer      | 	General.GenesisFile = "/etc/hyperledger/fabric/genesis.block"
peer         |   -h, --help                help for start
orderer      | 	General.Profile.Enabled = false
orderer      | 	General.Profile.Address = "0.0.0.0:6060"
orderer      | 	General.LocalMSPDir = "/etc/hyperledger/msp"
orderer      | 	General.LocalMSPID = "TradeOrdererMSP"
orderer      | 	General.BCCSP.ProviderName = "SW"
orderer      | 	General.BCCSP.SwOpts.SecLevel = 256
orderer      | 	General.BCCSP.SwOpts.HashFamily = "SHA2"
orderer      | 	General.BCCSP.SwOpts.Ephemeral = false
orderer      | 	General.BCCSP.SwOpts.FileKeystore.KeyStorePath = "/etc/hyperledger/msp/keystore"
orderer      | 	General.BCCSP.SwOpts.DummyKeystore =
peer         |       --peer-chaincodedev   Whether peer in chaincode development mode
orderer      | 	General.BCCSP.SwOpts.InmemKeystore =
peer         | 
orderer      | 	General.BCCSP.PluginOpts =
orderer      | 	General.Authentication.TimeWindow = 15m0s
orderer      | 	FileLedger.Location = "/var/hyperledger/production/orderer"
orderer      | 	FileLedger.Prefix = "hyperledger-fabric-ordererledger"
orderer      | 	RAMLedger.HistorySize = 1000
orderer      | 	Kafka.Retry.ShortInterval = 5s
orderer      | 	Kafka.Retry.ShortTotal = 10m0s
orderer      | 	Kafka.Retry.LongInterval = 5m0s
orderer      | 	Kafka.Retry.LongTotal = 12h0m0s
orderer      | 	Kafka.Retry.NetworkTimeouts.DialTimeout = 10s
orderer      | 	Kafka.Retry.NetworkTimeouts.ReadTimeout = 10s
orderer      | 	Kafka.Retry.NetworkTimeouts.WriteTimeout = 10s
orderer      | 	Kafka.Retry.Metadata.RetryMax = 3
orderer      | 	Kafka.Retry.Metadata.RetryBackoff = 250ms
orderer      | 	Kafka.Retry.Producer.RetryMax = 3
orderer      | 	Kafka.Retry.Producer.RetryBackoff = 100ms
orderer      | 	Kafka.Retry.Consumer.RetryBackoff = 2s
orderer      | 	Kafka.Verbose = false
orderer      | 	Kafka.Version = 0.10.2.0
orderer      | 	Kafka.TLS.Enabled = false
orderer      | 	Kafka.TLS.PrivateKey = ""
orderer      | 	Kafka.TLS.Certificate = ""
orderer      | 	Kafka.TLS.RootCAs = []
orderer      | 	Kafka.TLS.ClientAuthRequired = false
orderer      | 	Kafka.TLS.ClientRootCAs = []
orderer      | 	Kafka.SASLPlain.Enabled = false
orderer      | 	Kafka.SASLPlain.User = ""
orderer      | 	Kafka.SASLPlain.Password = ""
orderer      | 	Kafka.Topic.ReplicationFactor = 3
orderer      | 	Debug.BroadcastTraceDir = ""
orderer      | 	Debug.DeliverTraceDir = ""
orderer      | 	Consensus = map[WALDir:/var/hyperledger/production/orderer/etcdraft/wal SnapDir:/var/hyperledger/production/orderer/etcdraft/snapshot]
orderer      | 	Operations.ListenAddress = "127.0.0.1:8443"
orderer      | 	Operations.TLS.Enabled = false
orderer      | 	Operations.TLS.PrivateKey = ""
orderer      | 	Operations.TLS.Certificate = ""
orderer      | 	Operations.TLS.RootCAs = []
orderer      | 	Operations.TLS.ClientAuthRequired = false
orderer      | 	Operations.TLS.ClientRootCAs = []
orderer      | 	Metrics.Provider = "disabled"
orderer      | 	Metrics.Statsd.Network = "udp"
orderer      | 	Metrics.Statsd.Address = "127.0.0.1:8125"
orderer      | 	Metrics.Statsd.WriteInterval = 30s
orderer      | 	Metrics.Statsd.Prefix = ""
orderer      | 2018-12-18 12:42:35.534 UTC [fsblkstorage] newBlockfileMgr -> INFO 003 Getting block information from block storage
orderer      | 2018-12-18 12:42:35.573 UTC [orderer.commmon.multichannel] Initialize -> INFO 004 Starting system channel 'testchainid' with genesis block hash 5c47ff7e3151e90eafc201d5bd11390302d09239ea2f09f25b793c7208791ae9 and orderer type solo
orderer      | 2018-12-18 12:42:35.573 UTC [orderer.common.server] Start -> INFO 005 Starting orderer:
orderer      |  Version: 1.4.0-rc1
orderer      |  Commit SHA: eca1b14
orderer      |  Go version: go1.11.1
orderer      |  OS/Arch: linux/amd64
orderer      | 2018-12-18 12:42:35.574 UTC [orderer.common.server] Start -> INFO 006 Beginning to serve requests
cli          | /bin/bash: /opt/trade/setupChannel.sh: Permission denied
peer exited with code 1
cli exited with code 126

@progge-sol
Copy link
Author

I have no idea how to solve this

@VRamakrishna
Copy link
Collaborator

VRamakrishna commented Dec 19, 2018

First thing, can you confirm you downloaded and built Hyperledger Fabric and Fabric-CA version 1.1? The current default version is 1.4, and some commands might have changed.

(Our application code was written in the first half of 2018, and 1.1 was the default version when the book was published, so we omitted to specify the version in the chapters. But soon after the book's publication, we noticed the omission and submitted errata. I'm not sure if you got a chance to see that.)

Links:
https://github.com/hyperledger/fabric/tree/release-1.1
https://github.com/hyperledger/fabric-ca/tree/release-1.1

Once you confirm this, and if you still get the same errors, I can try to help you debug further.

@progge-sol
Copy link
Author

progge-sol commented Dec 19, 2018

I rechecked and both fabric-ca and fabric are release-1.1

root@test-VirtualBox:/home/test/go/go/src/trade-finance-logistics/network# cd fabric
root@test-VirtualBox:/home/test/go/go/src/trade-finance-logistics/network/fabric# git status
Auf Branch release-1.1
Ihr Branch ist auf dem selben Stand wie _'origin/release-1.1'_.
nichts zu committen, Arbeitsverzeichnis unverändert
root@test-VirtualBox:/home/test/go/go/src/trade-finance-logistics/network/fabric# cd ..
root@test-VirtualBox:/home/test/go/go/src/trade-finance-logistics/network# cd fabric-ca
root@test-VirtualBox:/home/test/go/go/src/trade-finance-logistics/network/fabric-ca# git status
Auf Branch release-1.1
Ihr Branch ist auf dem selben Stand wie _'origin/release-1.1'_.
nichts zu committen, Arbeitsverzeichnis unverändert

@woodyjon
Copy link

woodyjon commented Jan 2, 2019

I might have experienced same issues. I fixed my issues and proposed a PR: #43

@VRamakrishna
Copy link
Collaborator

@pstueven Sorry, I was out during the holidays and forgot about your issue. Can you see if the fix proposed by woodyjon works for you? Though he's using v1.2 (and you are using v1.1.)

@woodyjon Thanks for the PR. I'll take a look and apply sometime soon. (Generally, I don't have too much time to work on this project these days, with my day job.) And the 1.2 upgrade was only tested for net mode, not dev mode, which is why I retained the older version as the default.

@woodyjon
Copy link

woodyjon commented Jan 3, 2019

@VRamakrishna ok I see. Thanks.
So you advise to work on which version?
(And I do not see a 1.1 tag. Do you mean master? Or abac?)

@VRamakrishna
Copy link
Collaborator

Master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants