Failed connecting to Steam in Docker using host network - docker

I want to host dedicated steam servers for a multiplayer game I'm currently working on in docker containers.
My Dockerfile:
FROM ubuntu:22.04
RUN useradd -m steam
COPY --chown=steam:steam LinuxServer /home/steam/
COPY --chown=steam:steam steamclient.so /home/steam/.steam/sdk64/steamclient.so
USER steam
WORKDIR /home/steam
CMD ./Server.sh
My docker-compose.yml:
services:
server:
image: server
network_mode: host
When starting the container, the dedicated server isn't able to logon to steam.
In Steam/logs/connection_log.txt it reports OK messages:
[2022-10-11 10:04:10] Connectivity test: Starting test, fetching 'http://test.steampowered.com/204'
[2022-10-11 10:04:10] Connectivity test: OK!
[2022-10-11 10:04:10] Connectivity test: result=Connected (since 0.0s ago), prev=Unknown, in progress=0
[2022-10-11 10:04:22] Connectivity test: Starting test, fetching 'http://test.steampowered.com/204'
[2022-10-11 10:04:22] Connectivity test: OK!
[2022-10-11 10:04:22] Connectivity test: result=Connected (since 11.5s ago), prev=Unknown, in progress=0
[2022-10-11 10:04:23] Connectivity test: Starting test, fetching 'http://test.steampowered.com/204'
[2022-10-11 10:04:23] Connectivity test: OK!
However, in Steam/logs/connection_log_7777.txt it repeats the following errors:
[2022-10-11 10:04:10] IPv6 HTTP connectivity test (ipv6check-http.steamcontent.com / [2a01:bc80:8:103::9b85:fc12]:80 ([2a01:bc80:8:103::9b85:fc12]:80)) - TIMEOUT
[2022-10-11 10:04:12] IPv6 UDP connectivity test (ipv6check-udp.steamcontent.com / 2a01:bc80:a:100::b919:b604) - TIMEOUT
[2022-10-11 10:04:21] [0,0] SetSteamID( [G:1:0] )
[2022-10-11 10:04:21] CCMInterface::YieldingConnect -- calling ISteamDirectory/GetCMListForConnect web api
[2022-10-11 10:04:21] [0,0] SetSteamID( [G:1:0] )
[2022-10-11 10:04:21] GetCMListForConnect -- web API call failed (status = 0)
[2022-10-11 10:04:21] [0,0] PingWebSocketCM() (cm2-iad1.cm.steampowered.com.:443) starting...
[2022-10-11 10:04:21] [0,0] PingWebSocketCM() (cm2-lax1.cm.steampowered.com:27021) starting...
[2022-10-11 10:04:21] [0,0] PingWebSocketCM() (cm1-lax1.cm.steampowered.com:27021) starting...
[2022-10-11 10:04:21] [0,0] PingWebSocketCM() (cm2-iad1.cm.steampowered.com.:443) failed talking to cm (timeout/neterror - Invalid)
[2022-10-11 10:04:21] [0,0] PingWebSocketCM() (cm2-lax1.cm.steampowered.com:27021) failed talking to cm (timeout/neterror - Invalid)
[2022-10-11 10:04:21] [0,0] PingWebSocketCM() (cm1-lax1.cm.steampowered.com:27021) failed talking to cm (timeout/neterror - Invalid)
[2022-10-11 10:04:21] [1,3] Connect() starting connection (eNetQOSLevelMedium, cm2-iad1.cm.steampowered.com.:443, WebSocket)
[2022-10-11 10:04:21] [1,0] ConnectFailed('Connection Failed':0) (0.0.0.0:0, WebSocket)
[2022-10-11 10:04:21] [1,0] Client thinks it can connect via: UDP - yes, TCP - yes, WebSocket:443 - yes, WebSocket:Non443 - yes
[2022-10-11 10:04:21] [0,0] StartAutoReconnect() will start in 4.0 seconds (attempt 1)
[2022-10-11 10:04:22] [0,0] SetSteamID( [G:1:0] )
When starting the dedicated server on my local machine I don't have these problems. I would assume it would work the same in a docker container as I'm using the "host" network mode. Does anyone have any idea what I'm doing wrong here?
Any help is appreciated!

If someone ever has the same issue, I fixed it by adding the following commands to the Dockerfile:
RUN apt-get update && \
apt-get install -y openssl iproute2 ca-certificates && \
apt-get clean

Related

Python Error when testing uWSGI in basic way

I'm just testing uWSGI by following the quick-start guide in official web site. But, I am facing a problem.
This is what I did. It's exactly same as the steps in quick guide.
$ uwsgi --http :9090 --wsgi-file foobar.py
*** Starting uWSGI 2.0.19.1 (64bit) on [Sat Mar 12 09:28:41 2022] ***
compiled with version: Clang 11.0.0 on 18 January 2021 21:53:23
os: Darwin-21.3.0 Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_X86_64
nodename: mac-brian.local
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 16
current working directory: /Users/brian/Documents/project/uwsgi_test
detected binary path: /opt/anaconda3/envs/price_analysis/bin/uwsgi
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 5568
your memory page size is 4096 bytes
detected max file descriptor number: 256
lock engine: OSX spinlocks
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on :9090 fd 4
spawned uWSGI http 1 (pid: 10349)
uwsgi socket 0 bound to TCP address 127.0.0.1:59738 (port auto-assigned) fd 3
Python version: 3.9.1 | packaged by conda-forge | (default, Jan 10 2021, 02:52:42) [Clang 11.0.0 ]
Fatal Python error: init_import_site: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/opt/anaconda3/envs/price_analysis/lib/python3.9/site.py", line 73, in <module>
import os
File "/opt/anaconda3/envs/price_analysis/lib/python3.9/os.py", line 29, in <module>
from _collections_abc import _check_methods
File "/opt/anaconda3/envs/price_analysis/lib/python3.9/_collections_abc.py", line 416, in <module>
class _CallableGenericAlias(GenericAlias):
TypeError: type 'types.GenericAlias' is not an acceptable base type
And this is my foobar.py:
def application(env, start_response):
start_response('200 OK', [('Content-Type','text/html')])
return [b"Hello World"]
After this I tried to connect to the http://localhost:9090 in this way.
curl -v 127.0.0.1:9090
These are the responses.
curl -v 127.0.0.1:9090
* Trying 127.0.0.1:9090...
* Connected to 127.0.0.1 (127.0.0.1) port 9090 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1:9090
> User-Agent: curl/7.77.0
> Accept: */*
>
[uwsgi-http] unable to connect() to node "127.0.0.1:59738" (0 retries): Connection refused
[uwsgi-http] unable to connect() to node "127.0.0.1:59738" (1 retries): Connection refused
[uwsgi-http] unable to connect() to node "127.0.0.1:59738" (2 retries): Connection refused
[uwsgi-http] unable to connect() to node "127.0.0.1:59738" (3 retries): Connection refused
* Empty reply from server
* Closing connection 0
curl: (52) Empty reply from server
I expected Hello World but I get empty messages from the server.
How can I solve this?

Hyperledger Blockchain Explorer-Fail to connect before the deadline on Endorser, fail to connect to remote gRPC server

I am trying to set up a Hyperledger Fabric Network with Hyperledger Explorer. I spin up a VM on the digital ocean cloud with ubuntu OS. From there, I spin up 3 orderers node, and 2 peers node. Which result in total of 5 nodes. (I am using RAFT setup).
However, I encounter the error as below when trying to start the hyperledger fabric explorer docker-container images.
Error:
> hyperledger-explorer#1.1.4 app-start /opt/explorer
> ./start.sh
[2021-02-18T07:32:21.828] [INFO] PgService - SSL to Postgresql disabled
[2021-02-18T07:32:21.829] [INFO] PgService - connecting to Postgresql postgres://hppoc:******#explorerdb.mynetwork.com:5432/fabricexplorer
[2021-02-18T07:32:21.898] [INFO] Platform - network_config.id test-network network_config.profile ./connection-profile/test-network.json
[2021-02-18T07:32:22.013] [INFO] FabricConfig - config.client.tlsEnable true
[2021-02-18T07:32:22.013] [INFO] FabricConfig - FabricConfig, this.config.channels airlinechannel
[2021-02-18T07:32:22.016] [INFO] FabricGateway - enrollUserIdentity: userName : exploreradmin
2021-02-18T07:32:25.221Z - error: [ServiceEndpoint]: Error: Failed to connect before the deadline on Endorser- name: peer1.acme.com, url:grpcs://peer1.acme.com:7051, connected:false, connectAttempted:true
2021-02-18T07:32:25.222Z - error: [ServiceEndpoint]: waitForReady - Failed to connect to remote gRPC server peer1.acme.com url:grpcs://peer1.acme.com:7051 timeout:3000
2021-02-18T07:32:25.223Z - info: [NetworkConfig]: buildPeer - Unable to connect to the endorser peer1.acme.com due to Error: Failed to connect before the deadline on Endorser- name: peer1.acme.com, url:grpcs://peer1.acme.com:7051, connected:false, connectAttempted:true
2021-02-18T07:32:28.250Z - error: [ServiceEndpoint]: Error: Failed to connect before the deadline on Discoverer- name: peer1.acme.com, url:grpcs://peer1.acme.com:7051, connected:false, connectAttempted:true
2021-02-18T07:32:28.250Z - error: [ServiceEndpoint]: waitForReady - Failed to connect to remote gRPC server peer1.acme.com url:grpcs://peer1.acme.com:7051 timeout:3000
2021-02-18T07:32:28.250Z - error: [ServiceEndpoint]: ServiceEndpoint grpcs://peer1.acme.com:7051 reset connection failed :: Error: Failed to connect before the deadline on Discoverer- name: peer1.acme.com, url:grpcs://peer1.acme.com:7051, connected:false, connectAttempted:true
2021-02-18T07:32:28.251Z - error: [DiscoveryService]: send[airlinechannel] - no discovery results
[2021-02-18T07:32:28.251] [ERROR] FabricClient - Error: DiscoveryService has failed to return results
at DiscoveryService.send (/opt/explorer/node_modules/fabric-network/node_modules/fabric-common/lib/DiscoveryService.js:370:10)
at process._tickCallback (internal/process/next_tick.js:68:7)
[2021-02-18T07:32:28.252] [INFO] FabricClient - ********* call to initializeDetachClient **********
[2021-02-18T07:32:28.253] [INFO] FabricClient - initializeDetachClient, network config) { name: 'test-network',
version: '1.0.0',
client:
{ tlsEnable: true,
adminCredential: { id: 'exploreradmin', password: 'exploreradminpw' },
enableAuthentication: true,
organization: 'AcmeMSP',
connection: { timeout: [Object] } },
channels: { airlinechannel: { peers: [Object] } },
organizations:
{ AcmeMSP:
{ mspid: 'AcmeMSP',
adminPrivateKey: [Object],
peers: [Array],
signedCert: [Object] } },
peers:
{ 'peer1.acme.com': { tlsCACerts: [Object], url: 'grpcs://peer1.acme.com:7051' } } }
[2021-02-18T07:32:28.253] [INFO] FabricClient - ************************************* initializeDetachClient *************************************************
[2021-02-18T07:32:28.254] [INFO] FabricClient - Error : Failed to connect client peer, please check the configuration and peer status
[2021-02-18T07:32:28.254] [INFO] FabricClient - Info : Explorer will continue working with only DB data
[2021-02-18T07:32:28.254] [INFO] FabricClient - ************************************** initializeDetachClient ************************************************
[2021-02-18T07:32:28.259] [INFO] Platform - initializeListener, network_id, network_client test-network { name: 'test-network',
version: '1.0.0',
client:
{ tlsEnable: true,
adminCredential: { id: 'exploreradmin', password: 'exploreradminpw' },
enableAuthentication: true,
organization: 'AcmeMSP',
connection: { timeout: [Object] } },
channels: { airlinechannel: { peers: [Object] } },
organizations:
{ AcmeMSP:
{ mspid: 'AcmeMSP',
adminPrivateKey: [Object],
peers: [Array],
signedCert: [Object] } },
peers:
{ 'peer1.acme.com': { tlsCACerts: [Object], url: 'grpcs://peer1.acme.com:7051' } } }
[2021-02-18T07:32:28.260] [INFO] main - Please open web browser to access :http://localhost:8080/
[2021-02-18T07:32:28.261] [INFO] main - pid is 20
[2021-02-18T07:32:28.263] [ERROR] main - <<<<<<<<<<<<<<<<<<<<<<<<<< Explorer Error >>>>>>>>>>>>>>>>>>>>>
[2021-02-18T07:32:28.263] [ERROR] main - Error : [ 'Default client peer is down and no channel details available database' ]
[2021-02-18T07:32:30.264] [INFO] main - Received kill signal, shutting down gracefully
[2021-02-18T07:32:30.266] [INFO] Platform - <<<<<<<<<<<<<<<<<<<<<<<<<< Closing explorer >>>>>>>>>>>>>>>>>>>>>
[2021-02-18T07:32:30.266] [INFO] main - Closed out connections
Version Detail
Hyperledger Fabric: 2.3.1
Hyperledger Explorer: v1.1.1 (latest tag)
Part 1: Docker Container Setup
a) Docker PS
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9e8768914140 hyperledger/explorer:latest "docker-entrypoint.s…" 3 minutes ago Up 3 minutes 0.0.0.0:8080->8080/tcp explorer.mynetwork.com
903c8c4a4326 hyperledger/explorer-db:latest "docker-entrypoint.s…" 3 minutes ago Up 3 minutes (healthy) 5432/tcp explorerdb.mynetwork.com
9fed267ae9b1 dev-peer1.budget.com-gocc1.1.0-1.0-2593f1a95def85c64fdfed35e3d3b1051b92ed91549cfe789292ec5475d7db86-e014c6d933da036b6c79b53d29a800d8a6886e374ceb435a30642b885735f8f5 "chaincode -peer.add…" 21 minutes ago Up 21 minutes dev-peer1.budget.com-gocc1.1.0-1.0-2593f1a95def85c64fdfed35e3d3b1051b92ed91549cfe789292ec5475d7db86
12407497fa4c dev-peer1.acme.com-gocc1.1.0-1.0-2593f1a95def85c64fdfed35e3d3b1051b92ed91549cfe789292ec5475d7db86-a3b6caa9293bb826d231b1a31cc47437e58764abe5169a20ed0ee43f25c16b24 "chaincode -peer.add…" 21 minutes ago Up 21 minutes dev-peer1.acme.com-gocc1.1.0-1.0-2593f1a95def85c64fdfed35e3d3b1051b92ed91549cfe789292ec5475d7db86
0448e71f68e1 hyperledger/fabric-peer:latest "peer node start" 22 minutes ago Up 22 minutes 0.0.0.0:8051->7051/tcp, 0.0.0.0:8052->7052/tcp peer1.budget.com
3266ec37b360 hyperledger/fabric-peer:latest "peer node start" 22 minutes ago Up 22 minutes 0.0.0.0:7051-7052->7051-7052/tcp peer1.acme.com
47ebe9ad79d1 hyperledger/fabric-orderer:latest "orderer" 22 minutes ago Up 22 minutes 0.0.0.0:8050->7050/tcp orderer2.acme.com
09a5f771f47f hyperledger/fabric-tools:latest "/bin/bash" 22 minutes ago Up 22 minutes tools
e132bb01ce22 hyperledger/fabric-orderer:latest "orderer" 22 minutes ago Up 22 minutes 0.0.0.0:9050->7050/tcp orderer3.acme.com
3c61b0316385 hyperledger/fabric-orderer:latest "orderer" 22 minutes ago Up 22 minutes
b) I use 3 docker-compose files for my configuration setting.
$ docker-compose -f ./config/docker-compose-base.yaml -f ./tls/docker-compose-tls.yaml -f ./raft/docker-compose-raft.yaml up -d
docker-compose-base.yaml
https://gist.github.com/Skyquek/03d1ffad5643d67d8da5b268a4814a7d
docker-compose-tls.yaml
https://gist.github.com/Skyquek/b3b314cb2152ab541e822f72c60a2cbd
docker-compose-raft.yaml
https://gist.github.com/Skyquek/7f8ec2d4d1876283f4a9444675971be8
c) Core.yaml
acme core.yaml
https://gist.github.com/Skyquek/8cdcbc4ee3d53a2277b1c34bb2fca704
Part 2: Blockchain Explorer Setting
1. connection-profile.json
{
"name": "test-network",
"version": "1.0.0",
"client": {
"tlsEnable": true,
"adminCredential": {
"id": "exploreradmin",
"password": "exploreradminpw"
},
"enableAuthentication": true,
"organization": "AcmeMSP",
"connection": {
"timeout": {
"peer": {
"endorser": "300"
},
"orderer": "300"
}
}
},
"channels": {
"airlinechannel": {
"peers": {
"peer1.acme.com": {}
}
}
},
"organizations": {
"AcmeMSP": {
"mspid": "AcmeMSP",
"adminPrivateKey": {
"path": "/tmp/crypto/peerOrganizations/acme.com/users/Admin#acme.com/msp/keystore/priv_sk"
},
"peers": ["peer1.acme.com"],
"signedCert": {
"path": "/tmp/crypto/peerOrganizations/acme.com/users/Admin#acme.com/msp/signcerts/Admin#acme.com-cert.pem"
}
}
},
"peers": {
"peer1.acme.com": {
"tlsCACerts": {
"path": "/tmp/crypto/peerOrganizations/acme.com/tlsca/tlsca.acme.com-cert.pem"
},
"url": "grpcs://peer1.acme.com:7051"
}
}
}
2. docker-compose.yaml
# SPDX-License-Identifier: Apache-2.0
version: '2.1'
volumes:
pgdata:
walletstore:
networks:
mynetwork.com:
external:
name: acloudfan_airline
services:
explorerdb.mynetwork.com:
image: hyperledger/explorer-db:latest
container_name: explorerdb.mynetwork.com
hostname: explorerdb.mynetwork.com
environment:
- DATABASE_DATABASE=fabricexplorer
- DATABASE_USERNAME=hppoc
- DATABASE_PASSWORD=password
healthcheck:
test: "pg_isready -h localhost -p 5432 -q -U postgres"
interval: 30s
timeout: 10s
retries: 5
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- mynetwork.com
explorer.mynetwork.com:
image: hyperledger/explorer:latest
container_name: explorer.mynetwork.com
hostname: explorer.mynetwork.com
environment:
- DATABASE_HOST=explorerdb.mynetwork.com
- DATABASE_DATABASE=fabricexplorer
- DATABASE_USERNAME=hppoc
- DATABASE_PASSWD=password
- LOG_LEVEL_APP=debug
- LOG_LEVEL_DB=debug
- LOG_LEVEL_CONSOLE=info
- LOG_CONSOLE_STDOUT=true
- DISCOVERY_AS_LOCALHOST=true
volumes:
- ./config.json:/opt/explorer/app/platform/fabric/config.json
- ./connection-profile:/opt/explorer/app/platform/fabric/connection-profile
- ./organizations:/tmp/crypto
- walletstore:/opt/explorer/wallet
ports:
- 8080:8080
depends_on:
explorerdb.mynetwork.com:
condition: service_healthy
networks:
- mynetwork.com
Solution that I tried
1. Change the tlscs certs path
As stated in
Hyperledger Fabric 2.0.1: Error: Failed to connect before the deadline on Discoverer- name:
The problem most likely is due to the error from the path. But the problem still persists.
2. Change the env variable DISCOVERY_AS_LOCALHOST=true to false
Some of them mention that this will fixed the problem. But I can't seem to fix it this way.
3. Tried with hyperledger fabric 2.0 test-network
I tried to run with fabric sample test-network and its run perfectly fine.
4. docker exec -it sh to the explorer.mynetwork.com to ping the peer
The ping can run perfectly fine.
/opt/explorer # ping peer1.acme.com:7051
PING peer1.acme.com:7051 (172.23.0.6): 56 data bytes
64 bytes from 172.23.0.6: seq=0 ttl=64 time=0.138 ms
64 bytes from 172.23.0.6: seq=1 ttl=64 time=0.087 ms
64 bytes from 172.23.0.6: seq=2 ttl=64 time=0.090 ms
64 bytes from 172.23.0.6: seq=3 ttl=64 time=0.089 ms
64 bytes from 172.23.0.6: seq=4 ttl=64 time=0.101 ms
64 bytes from 172.23.0.6: seq=5 ttl=64 time=0.088 ms
^C
--- peer1.acme.com:7051 ping statistics ---
6 packets transmitted, 6 packets received, 0% packet loss
round-trip min/avg/max = 0.087/0.098/0.138 ms
Its keep on showing that the peer is down or the connection to the peer is fail
I am struggling with this error for few days now. Hope someone can help me to identify the problem. Thank you very much.
I think you should double-check your network. Explorer should be spun up on the same network with Fabric, so that the peers and other nodes can be connected. To check the Fabric network name, you should check in the docker-compose file which set it up and look for CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE or you can navigate to you CLI and run docker network ls. You should be able to find your fabric network name with the DRIVER which should be bridge
Also, you should make sure that your Fabric network is up and running properly before bringing Explorer up.
With a similar error, the problem I had was that the keys and certificates for the network had gotten out of sync with the keys and certs for the blockchain explorer. This is a particularly significant problem when running a test network, because the keys and certs will (AFAICT) be regenerated whenever you restart a network, and a test network restarts much more often than a production network.
Copy over everything into the organizations directory, or whatever you call it; repeat this every time you bring up the network you want to use the explorer on. Symlinks also work, though that is probably more brittle and I wouldn't want to rely on it in production.
All configurations seems good, however you have to upgrade explorer version to be compatible with hyperledger fabric version.
So please use v1.1.4 instead of v1.1.1
Also make sure that you have mounted crypto config correctly, try to access this path inside the container /tmp/crypto/peerOrganizations/acme.com/tlsca/tlsca.acme.com-cert.pem
Try to change tlsCACerts path to use peer tls ca.crt
/tmp/crypto/peerOrganizations/acme.com/peers/peer1.acme.com/tls/ca.crt
You have mentioned that the same configurations works with hyperledger fabric v2, if you have tried it locally not on the same server so I please disable the firewall on the server and give it a try
To check if you can reach domain and port please try this
cat > /dev/tcp/peer1.acme.com/7051
Check this
https://support.bluemedora.com/s/article/Using-Bash-to-test-if-a-TCP-port-on-a-remote-system-is-open
I've had this error
[INFO] FabricClient - Error : Failed to connect client peer, please check the configuration and peer status
...
Error : [ 'Default client peer is down and no channel details available database' ]
What I found was that when we use 256-bit vs 384-bit key length, the error occurs.
Setting local/host made no difference.
I'm using v1.1.4. Will likely test the same with v1.1.5 soon enough and suspect it'll have the same issue.

Hyperledger Composer: command composer network start failing

I am trying to deploy a business network using command:
composer network start -c PeerAdmin#hlfv1 -n test-bna -V 0.0.1 -A admin -S adminpw
And it is failing with error:
Error trying to start business network. Error: Failed to connect to
any peer event hubs. It is required that at least 1 event hub has been
connected to receive the commit event.
On checking the composer logs, it says:
2018-11-08T13:30:59.190Z WARN :HLFConnection
:_connectToEventHubs() event hub localhost:7051 failed to connect:
12 UNIMPLEMENTED: unknown service protos.Deliver {}$
2018-11-08T13:31:46.763Z WARN :HLFConnection
:_connectToEventHubs() event hub localhost:7051 failed to connect:
12 UNIMPLEMENTED: unknown service protos.Deliver {}$
Could someone please help with resolving this?

Unable to Register Chaincode & Successfully Start Blockchain Network

I am following hyperledger fabric tutorial, and am having trouble registering my chaincode and possibly starting the docker image:
https://www.ibm.com/developerworks/library/j-chaincode-for-java-developers/
The following is the error I am getting when I try to register my chaincode:
$ ./Example
Hello world! starting [Ljava.lang.String;#5fd0d5ae
May 10, 2017 9:40:34 PM example.Example main
INFO: starting
May 10, 2017 9:40:34 PM io.grpc.internal.TransportSet$1 call
INFO: Created transport io.grpc.netty.NettyClientTransport#7269e694(/127.0.0.1:7051) for /127.0.0.1:7051
May 10, 2017 9:40:36 PM io.grpc.internal.TransportSet$TransportListener transportShutdown
INFO: Transport io.grpc.netty.NettyClientTransport#7269e694(/127.0.0.1:7051) for /127.0.0.1:7051 is being shutdown
May 10, 2017 9:40:36 PM io.grpc.internal.TransportSet$TransportListener transportTerminated
INFO: Transport io.grpc.netty.NettyClientTransport#7269e694(/127.0.0.1:7051) for /127.0.0.1:7051 is terminated
May 10, 2017 9:40:36 PM org.hyperledger.java.shim.ChaincodeBase$1 onError
SEVERE: Unable to connect to peer server: UNAVAILABLE
My blockchain network via docker is up and running, but the last log message is different than the expected log message (It says Connected to: [], which I assume is a null):
05:47:30.205 [peer] chatWithSomePeers -> DEBU 02f Starting up the first peer of a new network
05:47:30.205 [nodeCmd] serve -> INFO 030 Starting peer with ID=name:"vp0" , network ID=dev, address=172.17.0.3:7051, rootnodes=, validator=true
05:47:30.206 [consensus/statetransfer] verifyAndRecoverBlockchain -> DEBU 031 Validating existing blockchain, highest validated block is 0, valid through 0
05:47:30.206 [consensus/statetransfer] blockThread -> INFO 032 Validated blockchain to the genesis block
05:47:30.206 [consensus/handler] 1 -> DEBU 033 Starting up message thread for consenter
05:47:30.207 [peer] ensureConnected -> DEBU 034 Starting Peer reconnect service (touch service), with period = 6s
05:47:30.207 [rest] StartOpenchainRESTServer -> INFO 035 Initializing the REST service on 0.0.0.0:7050, TLS is disabled.
05:47:36.209 [peer] ensureConnected -> DEBU 036 Touch service indicates no dropped connections
05:47:36.209 [peer] ensureConnected -> DEBU 037 Connected to: []
05:47:36.209 [peer] ensureConnected -> DEBU 038 Discovery knows about: []
When I check for containers that are running docker shows me both of them are up, see below:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7dec77752d52 hyperledger/fabric-peer "sh -c 'sleep 5; peer" 20 minutes ago Up 20 minutes 0.0.0.0:7050-7051->7050-7051/tcp, 0.0.0.0:7053->7053/tcp blockchain_vp0_1
ac91e9bc1b0e hyperledger/fabric-membersrvc "membersrvc" 24 hours ago Up 20 minutes 0.0.0.0:7054->7054/tcp blockchain_membersrvc_1
The following git command was used:
git clone https://github.com/hyperledger/fabric.git -b v0.6
I copied and pasted the exact values for the docker-compose.yml, see below:
membersrvc:
image: hyperledger/fabric-membersrvc
ports:
- "7054:7054"
command: membersrvc
vp0:
image: hyperledger/fabric-peer
ports:
- "7050:7050"
- "7051:7051"
- "7053:7053"
environment:
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_VM_ENDPOINT=unix:///var/run/docker.sock
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_ID=vp0
- CORE_PEER_PKI_ECA_PADDR=membersrvc:7054
- CORE_PEER_PKI_TCA_PADDR=membersrvc:7054
- CORE_PEER_PKI_TLSCA_PADDR=membersrvc:7054
- CORE_SECURITY_ENABLED=false
- CORE_SECURITY_ENROLLID=test_vp0
- CORE_SECURITY_ENROLLSECRET=MwYpmSRjupbT
links:
- membersrvc
command: sh -c "sleep 5; peer node start --peer-chaincodedev"
Is there something I am missing here? Any help is appreciated, thank you.
Seems you are working on Windows environment and did everything right except not defined any port forwarding into Oracle VM virtual box. you will have to configure
Oracle VM VirtualBox Manager - > Setting - > Network -> Advance - > port forwarding -- and define as per attached image, run and enjoy.... enter image description here
Happy Coding!

ERRO : Error trying to connect to local peer: grpc: timed out trying to connect

Unable to deploy chaincode example in my local hyperledger fabric.
system config: mac osx, Docker toolbox for mac
One validating peer is up and running using docker-compose.yaml
membersrvc:
image: hyperledger/fabric-membersrvc
command: membersrvc
vp0:
image: hyperledger/fabric-peer
environment:
- CORE_PEER_ADDRESSAUTODETECT=false
- CORE_VM_ENDPOINT=http://172.17.0.1:2375
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_ID=vp0
- CORE_SECURITY_ENROLLID=test_vp0
- CORE_SECURITY_ENROLLSECRET=MwYpmSRjupbT
links:
- membersrvc
command: sh -c "sleep 5; peer node start --peer-chaincodedev"
While deploying chaincode by running
CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=0.0.0.0:30303 ./test
Its showing the error as [shim] ERRO : Error trying to connect to local peer: grpc: timed out trying to connect
I tried replacing CORE_PEER_ADDRESS as suggested by grep timeout solution but no change in error.
First Validating peer output
Chaincode deployment error window
You need to use the correct port number on which peer process is listening to.
instead of using the following command,
CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=0.0.0.0:30303 ./test
try this instead,
CORE_CHAINCODE_ID_NAME=mycc CORE_PEER_ADDRESS=0.0.0.0:7052 ./test
if it doesn't work then run the following command to check your listening port and use that instead,
netstat -atp tcp | grep -i "listen"

Resources