I'm setting up a Hyperledger Fabric network and encountering an error when trying to connect to the orderer. The error message I'm getting is:
Error: failed to create deliver client for orderer: orderer client failed to connect to orderer.trackandtrace.com:7050: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 45.35.38.138:7050: connect: connection refused"
It happens when i try to execute the following command:
peer channel create -o orderer.trackandtrace.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --cafile crypto-config/ordererOrganizations/trackandtrace.com/orderers/orderer.trackandtrace.com/msp/tlscacerts/tlsca.trackandtrace.com-cert.pem
I have 4 config files in my home dir: crypto-config.yaml, configtx.yaml, docker-compose.yaml and core.yaml. My docker containers are all running and i can also reach my orderer via telnet from inside the container.
configtx.yaml:
---
Organizations:
- &Orderer
Name: Orderer
ID: OrdererMSP
MSPDir: crypto-config/ordererOrganizations/trackandtrace.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('OrdererMSP.member')"
Writers:
Type: Signature
Rule: "OR('OrdererMSP.member')"
Admins:
Type: Signature
Rule: "OR('OrdererMSP.admin')"
OrdererEndpoints:
- orderer.example.com:7050
- &Consignor
Name: ConsignorMSP
ID: ConsignorMSP
MSPDir: crypto-config/peerOrganizations/consignor.trackandtrace.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('ConsignorMSP.member')"
Writers:
Type: Signature
Rule: "OR('ConsignorMSP.member')"
Admins:
Type: Signature
Rule: "OR('ConsignorMSP.admin')"
AnchorPeers:
- Host: peer0.consignor.trackandtrace.com
Port: 7051
- &Consignee
Name: ConsigneeMSP
ID: ConsigneeMSP
MSPDir: crypto-config/peerOrganizations/consignee.trackandtrace.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('ConsigneeMSP.member')"
Writers:
Type: Signature
Rule: "OR('ConsigneeMSP.member')"
Admins:
Type: Signature
Rule: "OR('ConsigneeMSP.admin')"
AnchorPeers:
- Host: peer0.consignee.trackandtrace.com
Port: 7051
- &PreCarriageShipper
Name: PreCarriageShipperMSP
ID: PreCarriageShipperMSP
MSPDir: crypto-config/peerOrganizations/precarriageshipper.trackandtrace.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('PreCarriageShipperMSP.member')"
Writers:
Type: Signature
Rule: "OR('PreCarriageShipperMSP.member')"
Admins:
Type: Signature
Rule: "OR('PreCarriageShipperMSP.admin')"
AnchorPeers:
- Host: peer0.precarriageshipper.trackandtrace.com
Port: 7051
- &MainCarrier
Name: MainCarrierMSP
ID: MainCarrierMSP
MSPDir: crypto-config/peerOrganizations/maincarrier.trackandtrace.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('MainCarrierMSP.member')"
Writers:
Type: Signature
Rule: "OR('MainCarrierMSP.member')"
Admins:
Type: Signature
Rule: "OR('MainCarrierMSP.admin')"
AnchorPeers:
- Host: peer0.maincarrier.trackandtrace.com
Port: 7051
- &OnCarriageShipper
Name: OnCarriageShipperMSP
ID: OnCarriageShipperMSP
MSPDir: crypto-config/peerOrganizations/oncarriageshipper.trackandtrace.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('OnCarriageShipperMSP.member')"
Writers:
Type: Signature
Rule: "OR('OnCarriageShipperMSP.member')"
Admins:
Type: Signature
Rule: "OR('OnCarriageShipperMSP.admin')"
AnchorPeers:
- Host: peer0.oncarriageshipper.trackandtrace.com
Port: 7051
- &Customs
Name: CustomsMSP
ID: CustomsMSP
MSPDir: crypto-config/peerOrganizations/customs.trackandtrace.com/msp
Policies:
Readers:
Type: Signature
Rule: "OR('CustomsMSP.member')"
Writers:
Type: Signature
Rule: "OR('CustomsMSP.member')"
Admins:
Type: Signature
Rule: "OR('CustomsMSP.admin')"
AnchorPeers:
- Host: peer0.customs.trackandtrace.com
Port: 7051
Capabilities:
Channel: &ChannelCapabilities
V2_0: true
Orderer: &OrdererCapabilities
V2_0: true
Application: &ApplicationCapabilities
V2_0: true
Application: &ApplicationDefaults
Organizations:
- *Consignor
- *Consignee
- *PreCarriageShipper
- *MainCarrier
- *OnCarriageShipper
- *Customs
Policies:
Readers:
Type: ImplicitMeta
Rule: "ANY Readers"
Writers:
Type: ImplicitMeta
Rule: "ANY Writers"
Admins:
Type: ImplicitMeta
Rule: "MAJORITY Admins"
Capabilities:
<<: *ApplicationCapabilities
Orderer: &OrdererDefaults
OrdererType: etcdraft
EtcdRaft:
Consenters:
- Host: orderer.trackandtrace.com
Port: 7050
ClientTLSCert: crypto-config/ordererOrganizations/trackandtrace.com/orderers/orderer.trackandtrace.com/tls/server.crt
ServerTLSCert: crypto-config/ordererOrganizations/trackandtrace.com/orderers/orderer.trackandtrace.com/tls/server.crt
Addresses:
- orderer.trackandtrace.com:7050
Organizations:
- *Orderer
Policies:
Readers:
Type: ImplicitMeta
Rule: "ANY Readers"
Writers:
Type: ImplicitMeta
Rule: "ANY Writers"
Admins:
Type: ImplicitMeta
Rule: "MAJORITY Admins"
BlockValidation:
Type: ImplicitMeta
Rule: "ANY Writers"
Capabilities:
<<: *OrdererCapabilities
Channel: &ChannelDefaults
Policies:
Readers:
Type: ImplicitMeta
Rule: "ANY Readers"
Writers:
Type: ImplicitMeta
Rule: "ANY Writers"
Admins:
Type: ImplicitMeta
Rule: "MAJORITY Admins"
Capabilities:
<<: *ChannelCapabilities
Profiles:
SampleMultiNodeEtcdRaft:
<<: *ChannelDefaults
Orderer:
<<: *OrdererDefaults
Organizations:
- *Orderer
Capabilities:
<<: *OrdererCapabilities
Application:
<<: *ApplicationDefaults
Organizations:
- *Consignor
- *Consignee
- *PreCarriageShipper
- *MainCarrier
- *OnCarriageShipper
- *Customs
Capabilities:
<<: *ApplicationCapabilities
Consortiums:
SampleConsortium:
Organizations:
- *Consignor
- *Consignee
- *PreCarriageShipper
- *MainCarrier
- *OnCarriageShipper
- *Customs
Frachtverfolgung:
Consortium: SampleConsortium
Application:
<<: *ApplicationDefaults
Organizations:
- *Consignor
- *Consignee
- *PreCarriageShipper
- *MainCarrier
- *OnCarriageShipper
- *Customs
Policies:
Readers:
Type: ImplicitMeta
Rule: "ANY Readers"
Writers:
Type: ImplicitMeta
Rule: "ANY Writers"
Admins:
Type: ImplicitMeta
Rule: "MAJORITY Admins"
crypto-config.yaml:
OrdererOrgs:
- Name: Orderer
Domain: trackandtrace.com
Specs:
- Hostname: orderer
PeerOrgs:
- Name: Consignor
Domain: consignor.trackandtrace.com
Template:
Count: 2
Users:
Count: 1
- Name: Consignee
Domain: consignee.trackandtrace.com
Template:
Count: 2
Users:
Count: 1
- Name: PreCarriageShipper
Domain: precarriageshipper.trackandtrace.com
Template:
Count: 2
Users:
Count: 1
- Name: MainCarrier
Domain: maincarrier.trackandtrace.com
Template:
Count: 2
Users:
Count: 1
- Name: OnCarriageShipper
Domain: oncarriageshipper.trackandtrace.com
Template:
Count: 2
Users:
Count: 1
- Name: Customs
Domain: customs.trackandtrace.com
Template:
Count: 2
Users:
Count: 1
docker-compose.yaml:
version: '2'
services:
orderer.trackandtrace.com:
container_name: orderer.trackandtrace.com
image: hyperledger/fabric-orderer:latest
environment:
- ORDERER_GENERAL_LOGLEVEL=debug
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
- ORDERER_GENERAL_TLS_ENABLED=true
- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/orderer
command: orderer
volumes:
- ./system-genesis-block/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
- ./crypto-config/ordererOrganizations/trackandtrace.com/orderers/orderer.trackandtrace.com/msp:/var/hyperledger/orderer/msp
- ./crypto-config/ordererOrganizations/trackandtrace.com/orderers/orderer.trackandtrace.com/tls:/var/hyperledger/orderer/tls
ports:
- 7050:7050
# Definieren Sie ähnliche Dienste für die Peers jeder Organisation. Sie können diesen Block kopieren und für jeden Peer anpassen.
peer0.consignor.trackandtrace.com:
container_name: peer0.consignor.trackandtrace.com
image: hyperledger/fabric-peer:latest
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_PEER_ID=peer0.consignor.trackandtrace.com
- CORE_PEER_ADDRESS=peer0.consignor.trackandtrace.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.consignor.trackandtrace.com:7051
- CORE_PEER_LOCALMSPID=ConsignorMSP
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/consignor.trackandtrace.com/peers/peer0.consignor.trackandtrace.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/consignor.trackandtrace.com/peers/peer0.consignor.trackandtrace.com/tls:/etc/hyperledger/fabric/tls
ports:
- 7051:7051
peer1.consignor.trackandtrace.com:
container_name: peer1.consignor.trackandtrace.com
image: hyperledger/fabric-peer:latest
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_PEER_ID=peer1.consignor.trackandtrace.com
- CORE_PEER_ADDRESS=peer1.consignor.trackandtrace.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.consignor.trackandtrace.com:7052
- CORE_PEER_LOCALMSPID=ConsignorMSP
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/consignor.trackandtrace.com/peers/peer1.consignor.trackandtrace.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/consignor.trackandtrace.com/peers/peer1.consignor.trackandtrace.com/tls:/etc/hyperledger/fabric/tls
ports:
- 7052:7052
peer1.consignor.trackandtrace.com:
container_name: peer1.consignor.trackandtrace.com
image: hyperledger/fabric-peer:latest
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_PEER_ID=peer1.consignor.trackandtrace.com
- CORE_PEER_ADDRESS=peer1.consignor.trackandtrace.com:7052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.consignor.trackandtrace.com:7052
- CORE_PEER_LOCALMSPID=ConsignorMSP
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/consignor.trackandtrace.com/peers/peer1.consignor.trackandtrace.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/consignor.trackandtrace.com/peers/peer1.consignor.trackandtrace.com/tls:/etc/hyperledger/fabric/tls
ports:
- 7052:7052
peer0.consignee.trackandtrace.com:
container_name: peer0.consignee.trackandtrace.com
image: hyperledger/fabric-peer:latest
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_PEER_ID=peer0.consignee.trackandtrace.com
- CORE_PEER_ADDRESS=peer0.consignee.trackandtrace.com:7053
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.consignee.trackandtrace.com:7053
- CORE_PEER_LOCALMSPID=ConsigneeMSP
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/consignee.trackandtrace.com/peers/peer0.consignee.trackandtrace.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/consignee.trackandtrace.com/peers/peer0.consignee.trackandtrace.com/tls:/etc/hyperledger/fabric/tls
ports:
- 7053:7053
#(same for peer1 with port 7054)
peer0.precarriageshipper.trackandtrace.com:
container_name: peer0.precarriageshipper.trackandtrace.com
image: hyperledger/fabric-peer:latest
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_PEER_ID=peer0.precarriageshipper.trackandtrace.com
- CORE_PEER_ADDRESS=peer0.precarriageshipper.trackandtrace.com:7055
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.precarriageshipper.trackandtrace.com:7055
- CORE_PEER_LOCALMSPID=PreCarriageShipperMSP
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/precarriageshipper.trackandtrace.com/peers/peer0.precarriageshipper.trackandtrace.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/precarriageshipper.trackandtrace.com/peers/peer0.precarriageshipper.trackandtrace.com/tls:/etc/hyperledger/fabric/tls
ports:
- 7055:7055
#(same for peer1 with port 7056)
peer0.maincarrier.trackandtrace.com:
container_name: peer0.maincarrier.trackandtrace.com
image: hyperledger/fabric-peer:latest
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_PEER_ID=peer0.maincarrier.trackandtrace.com
- CORE_PEER_ADDRESS=peer0.maincarrier.trackandtrace.com:7057
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.maincarrier.trackandtrace.com:7057
- CORE_PEER_LOCALMSPID=MainCarrierMSP
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/maincarrier.trackandtrace.com/peers/peer0.maincarrier.trackandtrace.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/maincarrier.trackandtrace.com/peers/peer0.maincarrier.trackandtrace.com/tls:/etc/hyperledger/fabric/tls
ports:
- 7057:7057
#(same for peer1 with port 7058)
peer0.oncarriageshipper.trackandtrace.com:
container_name: peer0.oncarriageshipper.trackandtrace.com
image: hyperledger/fabric-peer:latest
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_PEER_ID=peer0.oncarriageshipper.trackandtrace.com
- CORE_PEER_ADDRESS=peer0.oncarriageshipper.trackandtrace.com:7059
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.oncarriageshipper.trackandtrace.com:7059
- CORE_PEER_LOCALMSPID=OnCarriageShipperMSP
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/oncarriageshipper.trackandtrace.com/peers/peer0.oncarriageshipper.trackandtrace.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/oncarriageshipper.trackandtrace.com/peers/peer0.oncarriageshipper.trackandtrace.com/tls:/etc/hyperledger/fabric/tls
ports:
- 7059:7059
#(same for peer1 with port 7060)
peer0.customs.trackandtrace.com:
container_name: peer0.customs.trackandtrace.com
image: hyperledger/fabric-peer:latest
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_PEER_ID=peer0.customs.trackandtrace.com
- CORE_PEER_ADDRESS=peer0.customs.trackandtrace.com:7061
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.customs.trackandtrace.com:7061
- CORE_PEER_LOCALMSPID=CustomsMSP
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/customs.trackandtrace.com/peers/peer0.customs.trackandtrace.com/msp:/etc/hyperledger/fabric/msp
- ./crypto-config/peerOrganizations/customs.trackandtrace.com/peers/peer0.customs.trackandtrace.com/tls:/etc/hyperledger/fabric/tls
ports:
- 7061:7061
#(same for peer1 with port 7062)
core.yml:
peer:
id: jdoe
networkId: dev
listenAddress: '0.0.0.0:7051'
address: '0.0.0.0:7051'
addressAutoDetect: false
gateway:
enabled: true
endorsementTimeout: 30s
broadcastTimeout: 30s
dialTimeout: 2m
keepalive:
interval: 7200s
timeout: 20s
minInterval: 60s
client:
interval: 60s
timeout: 20s
deliveryClient:
interval: 60s
timeout: 20s
gossip:
bootstrap: '127.0.0.1:7051'
useLeaderElection: false
orgLeader: true
membershipTrackerInterval: 5s
endpoint: null
maxBlockCountToStore: 10
maxPropagationBurstLatency: 10ms
maxPropagationBurstSize: 10
propagateIterations: 1
propagatePeerNum: 3
pullInterval: 4s
pullPeerNum: 3
requestStateInfoInterval: 4s
publishStateInfoInterval: 4s
stateInfoRetentionInterval: null
publishCertPeriod: 10s
skipBlockVerification: false
dialTimeout: 3s
connTimeout: 2s
recvBuffSize: 20
sendBuffSize: 200
digestWaitTime: 1s
requestWaitTime: 1500ms
responseWaitTime: 2s
aliveTimeInterval: 5s
aliveExpirationTimeout: 25s
reconnectInterval: 25s
maxConnectionAttempts: 120
msgExpirationFactor: 20
externalEndpoint: null
election:
startupGracePeriod: 15s
membershipSampleInterval: 1s
leaderAliveThreshold: 10s
leaderElectionDuration: 5s
pvtData:
pullRetryThreshold: 60s
transientstoreMaxBlockRetention: 1000
pushAckTimeout: 3s
btlPullMargin: 10
reconcileBatchSize: 10
reconcileSleepInterval: 1m
reconciliationEnabled: true
skipPullingInvalidTransactionsDuringCommit: false
implicitCollectionDisseminationPolicy:
requiredPeerCount: 0
maxPeerCount: 1
state:
enabled: false
checkInterval: 10s
responseTimeout: 3s
batchSize: 10
blockBufferSize: 20
maxRetries: 3
tls:
enabled: false
clientAuthRequired: false
cert:
file: tls/server.crt
key:
file: tls/server.key
rootcert:
file: tls/ca.crt
clientRootCAs:
files:
- tls/ca.crt
clientKey:
file: null
clientCert:
file: null
authentication:
timewindow: 15m
fileSystemPath: /var/hyperledger/production
BCCSP:
Default: SW
SW:
Hash: SHA2
Security: 256
FileKeyStore:
KeyStore: null
PKCS11:
Library: null
Label: null
Pin: null
Hash: null
Security: null
SoftwareVerify: null
Immutable: null
AltID: null
KeyIds: null
mspConfigPath: >-
crypto-config/peerOrganizations/consignor.trackandtrace.com/peers/peer0.consignor.trackandtrace.com/msp
localMspId: ConsignorMSP
client:
connTimeout: 3s
deliveryclient:
blockGossipEnabled: true
reconnectTotalTimeThreshold: 3600s
connTimeout: 3s
reConnectBackoffThreshold: 3600s
addressOverrides: null
localMspType: bccsp
profile:
enabled: false
listenAddress: '0.0.0.0:6060'
handlers:
authFilters:
- name: DefaultAuth
- name: ExpirationCheck
decorators:
- name: DefaultDecorator
endorsers:
escc:
name: DefaultEndorsement
library: null
validators:
vscc:
name: DefaultValidation
library: null
validatorPoolSize: null
discovery:
enabled: true
authCacheEnabled: true
authCacheMaxSize: 1000
authCachePurgeRetentionRatio: 0.75
orgMembersAllowedAccess: false
limits:
concurrency:
endorserService: 2500
deliverService: 2500
gatewayService: 500
maxRecvMsgSize: 104857600
maxSendMsgSize: 104857600
vm:
endpoint: 'unix:///var/run/docker.sock'
docker:
tls:
enabled: false
ca:
file: docker/ca.crt
cert:
file: docker/tls.crt
key:
file: docker/tls.key
attachStdout: false
hostConfig:
NetworkMode: host
Dns: null
LogConfig:
Type: json-file
Config:
max-size: 50m
max-file: '5'
Memory: 2147483648
chaincode:
id:
path: null
name: null
builder: '$(DOCKER_NS)/fabric-ccenv:$(TWO_DIGIT_VERSION)'
pull: false
golang:
runtime: '$(DOCKER_NS)/fabric-baseos:$(TWO_DIGIT_VERSION)'
dynamicLink: false
java:
runtime: '$(DOCKER_NS)/fabric-javaenv:$(TWO_DIGIT_VERSION)'
node:
runtime: '$(DOCKER_NS)/fabric-nodeenv:$(TWO_DIGIT_VERSION)'
externalBuilders:
- name: ccaas_builder
path: /opt/hyperledger/ccaas_builder
propagateEnvironment:
- CHAINCODE_AS_A_SERVICE_BUILDER_CONFIG
installTimeout: 300s
startuptimeout: 300s
executetimeout: 30s
mode: net
keepalive: 0
system:
_lifecycle: enable
cscc: enable
lscc: enable
qscc: enable
logging:
level: info
shim: warning
format: >-
%{color}%{time:2006-01-02 15:04:05.000 MST} [%{module}] %{shortfunc} ->
%{level:.4s} %{id:03x}%{color:reset} %{message}
ledger:
blockchain: null
state:
stateDatabase: goleveldb
totalQueryLimit: 100000
couchDBConfig:
couchDBAddress: '127.0.0.1:5984'
username: null
password: null
maxRetries: 3
maxRetriesOnStartup: 10
requestTimeout: 35s
internalQueryLimit: 1000
maxBatchUpdateSize: 1000
createGlobalChangesDB: false
cacheSize: 64
history:
enableHistoryDatabase: true
pvtdataStore:
collElgProcMaxDbBatchSize: 5000
collElgProcDbBatchesInterval: 1000
deprioritizedDataReconcilerInterval: 60m
purgeInterval: 100
purgedKeyAuditLogging: true
snapshots:
rootDir: /var/hyperledger/production/snapshots
operations:
listenAddress: '127.0.0.1:9443'
tls:
enabled: false
cert:
file: null
key:
file: null
clientAuthRequired: false
clientRootCAs:
files: []
metrics:
provider: disabled
statsd:
network: udp
address: '127.0.0.1:8125'
writeInterval: 10s
prefix: null
I now figured out the answer myself. The problem can appear if you try to create the channel out of your local file system. But in order to create the channel, you have to do it out of the peer network. So in my case I had to enter my docker container with docker exec -it <container-id> /bin/bash/
first and then run the command.