Unable to instantiate the chaincode while running in docker swarm - docker-swarm

On instantiating the installed chaincode in Hyperldeger fabric network, setup in docker swarm, following error occurs:
Error: Error endorsing chaincode: rpc error: code = Unknown desc = Timeout expired while starting chaincode
mycc:1.0(networkid:fabricnetwork,peerid:peer0,tx:778dacf55114a5a26c6602f8fe7e3f326cdef8afbd897f4e5bacdd522033c08a)

Related

Error starting daemon: Error initializing network controller: Error creating default network: HNS failed with error : The object already exists

I am getting a Daemon error while start starting docker services.
- System
- Provider
[ Name] docker
- EventID 4
[ Qualifiers] 0
Level 2
Task 0
Keywords 0x80000000000000
- TimeCreated
[ SystemTime] 2021-05-20T11:56:33.780842300Z
EventRecordID 404284
Channel Application
Computer Computer.Name
Security
- EventData
Error starting daemon: Error initializing network controller: Error creating default network: HNS failed with error: The object already exists.
Error details from event viewer:
fatal: Error starting daemon: Error initializing network controller: Error creating default network: HNS failed with error: The object already exists.
Docker Command: start-service docker
This might be caused due to a custom NAT entry. Try removing the NAT then the issue would be resolved
Check-in PowerShell:
Get-NetNat, if anything is returned,
try removing with the command Remove-NetNat

Connection error with Docker Swarm in Gitlab Runner - half bare - half containers

I'm trying to use Docker Swarm with a Gitlab Runner to roll out deployments on 5-6 servers.
The swarm atm consists of 1 manager (call it M1), 2 workers (W1 and W2). My Gitlab Runner is using a docker executor with a docker in docker image. When a commit occurs, the Runner tries to register as a manager in the swarm (so it can start jobs / services). However I get the following error:
Error response from daemon: manager stopped: can't initialize raft node: rpc error: code = Unknown desc = could not connect to prospective new cluster member using its advertised address: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp: IPADDRESS connect: connection refused"
Interestingly, the ipaddress in the error is not the ip address of any of the servers. They are in sequence, and the one in the error message is the direct next address.
Is there a better way to issue commands to my swarm from my runner / a computer not connected to the server?

Failed to pull image "levm38/server:latest": rpc error: code = Unknown desc = Error response from daemon: Get https://registry-1.docker.io/v2/: EOF

I am trying to deploy a docker image on my minikube using a specific image:
But I always get this error
Failed to pull image "levm38/server:latest": rpc error: code = Unknown desc = Error response from daemon: Get https://registry-1.docker.io/v2/: EOF
I am behind a firewall but I already pushed the image, so I am not sure whats failing
There are a couple of problems and solutions related to
Firewall
Proxy
Restarting and re-configuring docker
in this post:
https://forums.docker.com/t/error-response-from-daemon-get-https-registry-1-docker-io-v2/23741/13
also,
do minikush ssh to the VM and see if you can connect/pull from registry on minikube VM.

Why do I get an authentication error when trying to join docker swarm

I am trying to run
docker-machine ssh myvm2 "docker swarm join --token SwMTKN-1-<cut> 192.168.161.163:2376"
to join mymv2 as a worker to the cluster, but I get this error
Error response from daemon: rpc error: code = Unavailable desc = all Subconns are in TransientFailure,
latest connection error: connection error: desc = "transport: authentication handshake failed: remote error: tls: bad certificate" exit status 1
I am following the docker course at :https://docs.docker.com/v17.09/get-started/part4/#create-a-cluster
Change the port to 2377 in --advertise-addr while creating swarm and join the other managers and workers using the same port to solve this problem.

use docker container composer-rest-server to generate rest api appears:REQUEST_TIMEOUT

I want to use composer-rest-server to generate rest api.
1,I run composer network ping -c admin#trade-network
the result is :
```The connection to the network was successfully tested: trade-network
Business network version: 0.2.6-20180530153450
Composer runtime version: 0.19.8
participant: org.hyperledger.composer.system.NetworkAdmin#admin
identity: org.hyperledger.composer.system.Identity#8633aef10e9d998be8bec4bb4ab535eb74e3d6832cb21286b89cadf0e95863c5
Command succeeded
2,run `docker run -e COMPOSER_CARD=admin#trade-network -e COMPOSER_NAMESPACES=never --name rest -p 3000:3000 hyperledger/composer-rest-server`
while error appears:
[2018-06-15 08:18:17] PM2 log: Launching in no daemon mode
[2018-06-15 08:18:17] PM2 log: Starting execution sequence in -fork mode- for app name:composer-rest-server id:0
[2018-06-15 08:18:17] PM2 log: App name:composer-rest-server id:0 online
WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
Discovering types from business network definition ...
Exception: Error: Error trying to ping. Error: REQUEST_TIMEOUT
Connection fails: Error: Error trying to ping. Error: REQUEST_TIMEOUT
It will be retried for the next request.
Error: Error trying to ping. Error: REQUEST_TIMEOUT
at _checkRuntimeVersions.then.catch (/home/composer/.npm-global/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:790:34)
at
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
[2018-06-15 08:23:21] PM2 log: App [composer-rest-server] with id [0] and pid [15], exited with code [1] via signal [SIGINT]
[2018-06-15 08:23:21] PM2 log: Starting execution sequence in -fork mode- for app name:composer-rest-server id:0
[2018-06-15 08:23:21] PM2 log: App name:composer-rest-server id:0 online
WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
Discovering types from business network definition ...
Connection fails: Error: Error trying to ping. Error: REQUEST_TIMEOUT
It will be retried for the next request.
Exception: Error: Error trying to ping. Error: REQUEST_TIMEOUT
Error: Error trying to ping. Error: REQUEST_TIMEOUT
```
so I want to ask why?
This is a networking issue ... The URL values in your connection.json (part of the "Card") have localhost in them which works fine from the command line of your computer where Docker sets up Port forwarding into the containers of the Fabric. When you use the same card inside a rest container localhost loops back into the container and does not "see" the Fabric.
Step 6 of this tutorial deals with the problem by creating a special restadmin card, and modifying the addresses in the connection.json to 'find' the Fabric - Google Oauth2 Tutorial.
I assume you are already sharing a volume on the docker run command so that the Rest Container can find the folder with the cards. E.g. -v ~/.composer:/home/composer/.composer

Resources