meteor Verifying Deployment - Connection refused - node.js

I am trying to deploy a meteor Application, But I am receiving this error message on the Verifying Deployment section with the following error message -
------------------------------------STDERR------------------------------------
: (7) Failed to connect to 172.17.0.2 port 3000: Connection refused
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (7) Failed to connect to 172.17.0.2 port 3000: Connection refused
=> Logs:
=> Setting node version
NODE_VERSION=14.17.4
v14.17.4 is already installed.
Now using node v14.17.4 (npm v6.14.14)
default -> 14.17.4 (-> v14.17.4 *)
=> Starting meteor app on port 3000
=> Redeploying previous version of the app
When I do the sudo netstat -tulpn | grep LISTEN in the server it shows this
tcp 0 0 10.0.3.1:53 0.0.0.0:* LISTEN 609/dnsmasq
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 406/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 745/sshd: /usr/sbin
tcp6 0 0 :::22 :::* LISTEN 745/sshd: /usr/sbin
When I run sudo docker ps i receive the following message -
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e51b1b4bf3a3 mup-appName:latest "/bin/sh -c 'exec $M…" About an hour ago Restarting (1) 49 seconds ago appName
68b723183f3d mongo:3.4.1 "/entrypoint.sh mong…" 9 days ago Restarting (100) 9 seconds ago mongodb
In my firewall i have also opened the Port 3000
If I check the Docker is running it seems like there is no docker running!!
Also in my mup.js file I am using http and not https
module.exports = {
servers: {
one: {
host: 'xx.xx.xxx.xxx',
username: 'ubuntu',
pem: '/home/runner/.ssh/id_rsa'
}
},
meteor: {
name: 'appName',
path: '../../',
docker: {
image: 'zodern/meteor:latest',
},
servers: {
one: {}
},
buildOptions: {
serverOnly: true
},
env: {
PORT: 3000,
ROOT_URL: 'http://dev-api.appName.com/',
NODE_ENV: 'production',
MAIL_URL: 'smtp://xxxx:xxx/eLPCB3nw3jubkq:#email-smtp.eu-north-1.amazonaws.com:587',
MONGO_URL: 'mongodb+srv://xxx:xx#xxx.iiitd.mongodb.net/Development?retryWrites=true&w=majority'
},
deployCheckWaitTime: 15
}
proxy: {
domains: 'dev.xxx.com',
ssl: {
letsEncryptEmail: 'info#xxx.com'
}
}
}
Any idea what might cause this issue?

I don't know why, but in the MUP docs the correct image name is zodern/meteor:root
If your app is slow to start, increase the deployCheckWaitTime . In my complex apps I put 600, just to ensure the app is up.

Related

Nodejs app running on localhost:3000 is not accessible on Linux server

I want to deploy my web app on cloud server, the OS is Centos 7, I got a static IP address like "34.80.XXX.XX", if I set my web app running on port 80, and I can see the page when I enter "34.80.XXX.XX:80".
But I if I running on port 3000, and enter "34.80.XXX.XX:3000", it not working.
I have tried to stop my firewall:
# systemctl stop firewalld
And use the command below to check there is no other program running on port 3000
# netstat -tnlp
Here is the code in app.js
const Koa = require('koa')
const json = require('koa-json')
const app = new Koa()
const PORT = 3000
// make JSON Prettier middleware
app.use(json())
// Simple middleware example
app.use(async ctx => {
ctx.body = {msg: 'Hello World'}
})
app.listen(PORT)
console.log(`server run at http://localhost:${PORT}`)
I use pm2 to run it in background
[root#instance-1 01-hello]# pm2 start app.js -n hello
[PM2] Starting /home/xing/01-hello/app.js in fork_mode (1 instance)
[PM2] Done.
┌─────┬──────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├─────┼──────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0 │ hello │ default │ N/A │ fork │ 3835 │ 0s │ 0 │ online │ 0% │ 12.6mb │ root │ disabled │
└─────┴──────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
And I enter the command netstat -tnlp to check app.js is running on port 3000
[root#instance-1 01-hello]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 15958/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1184/master
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 2421/mongod
tcp6 0 0 :::22 :::* LISTEN 15958/sshd
tcp6 0 0 :::3000 :::* LISTEN 3835/node /home/xin
tcp6 0 0 ::1:25 :::* LISTEN 1184/master
I have stuck on this point for long time, is there any good solution

issue connecting from sql developer to OracleVM virtualbox over port 1521

Hello I have used https://oracle-base.com/articles/12c/oracle-db-12cr2-installation-on-oracle-linux-6-and-7 to create a oracle DB in oracle virtualbox and I am trying to connect to it using sql developer on the same desktop. I have disabled the firewall already. Any help would be greatly appreciated.
Here is my tnsnames.ora and listener.ora files
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19.3.0.1/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_CDB1 =
(ADDRESS = (PROTOCOL = TCP)(HOST = ol7-122.localdomain)(PORT = 1521))
CDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ol7-122.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = cdb1)
)
)
[oracle#ol7-122 bin]$ cat /u01/app/oracle/product/19.3.0.1/db_1/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/19.3.0.1/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ol7-122.localdomain)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
Listener Status
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 20-APR-2021 11:15:43
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ol7-122.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 19-APR-2021 13:17:15
Uptime 0 days 21 hr. 58 min. 27 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/19.3.0.1/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/ol7-122/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ol7-122.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=ol7-122.localdomain)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/cdb1/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "bfcef1c73c025a39e0536a38a8c0e70d" has 1 instance(s).
Instance "cdb1", status READY, has 1 handler(s) for this service...
Service "cdb1" has 1 instance(s).
Instance "cdb1", status READY, has 1 handler(s) for this service...
Service "cdb1XDB" has 1 instance(s).
Instance "cdb1", status READY, has 1 handler(s) for this service...
Service "pdb1" has 1 instance(s).
Instance "cdb1", status READY, has 1 handler(s) for this service...
The command completed successfully
netstat of port 1521 in oracle VM
tcp 0 0 192.168.56.106:27356 192.168.56.106:1521 ESTABLISHED
tcp6 0 0 :::1521 :::* LISTEN
tcp6 0 0 192.168.56.106:1521 192.168.56.106:27356 ESTABLISHED
unix 2 [ ACC ] STREAM LISTENING 51182 /var/tmp/.oracle/sEXTPROC1521
telnet from windows to oracle VM over port 1521
Connecting To 192.168.56.106...Could not open connection to the host, on port 1521: Connect failed

How to install yugabyte-2.0.10.0 on CentOS7?

I am trying install yugabyte-2.0.10.0:
a) environment:
os: centos7.6
cpu Model: Intel(R) Core(TM) i7 CPU M 620
kernel: 3.10.0-957.el7.x86_64
gcc version 4.8.5
Python 2.7.5
b) commands:
cd ~
rm -rf /opt/yugabyte
mkdir -p /opt/yugabyte
mkdir -p /opt/yugabyte/data
wget https://downloads.yugabyte.com/yugabyte-2.0.10.0-linux.tar.gz
tar -xvzf /root/yugabyte/yugabyte-2.0.10.0-linux.tar.gz -C /opt/yugabyte
/opt/yugabyte/yugabyte-2.0.10.0/bin/post_install.sh
/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" destroy
/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" create
Error Logs:
[root#srvr0 ~]# /opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" create
Creating cluster.
Waiting for cluster to be ready.
Traceback (most recent call last):
File "/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl", line 1969, in <module>
control.run()
File "/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl", line 1946, in run
self.args.func()
File "/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl", line 1706, in create_cmd_impl
self.wait_for_cluster_or_raise()
File "/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl", line 1551, in wait_for_cluster_or_raise
raise RuntimeError("Timed out waiting for a YugaByte DB cluster!")
RuntimeError: Timed out waiting for a YugaByte DB cluster!
Viewing file /tmp/tmptCw8eu:
2020-01-09 21:21:18,413 INFO: Starting master-1 with:
/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-master --fs_data_dirs "/opt/yugabyte/data/node-1/disk-1" --webserver_interface 127.0.0.1 --rpc_bind_addresses 127.0.0.1 --v 0 --version_file_json_path=/opt/yugabyte/yugabyte-2.0.10.0 --webserver_doc_root "/opt/yugabyte/yugabyte-2.0.10.0/www" --replication_factor=1 --yb_num_shards_per_tserver 2 --ysql_num_shards_per_tserver=2 --master_addresses 127.0.0.1:7100 --enable_ysql=true >"/opt/yugabyte/data/node-1/disk-1/master.out" 2>"/opt/yugabyte/data/node-1/disk-1/master.err" &
2020-01-09 21:21:18,475 INFO: Starting tserver-1 with:
/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-tserver --fs_data_dirs "/opt/yugabyte/data/node-1/disk-1" --webserver_interface 127.0.0.1 --rpc_bind_addresses 127.0.0.1 --v 0 --version_file_json_path=/opt/yugabyte/yugabyte-2.0.10.0 --webserver_doc_root "/opt/yugabyte/yugabyte-2.0.10.0/www" --tserver_master_addrs=127.0.0.1:7100 --yb_num_shards_per_tserver=2 --redis_proxy_bind_address=127.0.0.1:6379 --cql_proxy_bind_address=127.0.0.1:9042 --local_ip_for_outbound_sockets=127.0.0.1 --use_cassandra_authentication=false --ysql_num_shards_per_tserver=2 --enable_ysql=true --pgsql_proxy_bind_address=127.0.0.1:5433 >"/opt/yugabyte/data/node-1/disk-1/tserver.out" 2>"/opt/yugabyte/data/node-1/disk-1/tserver.err" &
2020-01-09 21:21:18,483 INFO: Waiting for master and tserver processes to come up.
2020-01-09 21:21:18,627 INFO: Waiting for master leader election and tablet server registration.
2020-01-09 21:22:15,331 INFO: Master leader election still pending...
2020-01-09 21:22:16,333 ERROR: Failed waiting for None tservers, got None
^^^ Encountered errors ^^^
please help me in resolving the above issue!
Update1:
Info and Error Logs:
[root#srvr0 ~]# cat /opt/yugabyte/data/node-1/disk-1/master.out
[root#srvr0 ~]# cat /opt/yugabyte/data/node-1/disk-1/master.err
[root#srvr0 ~]# cat /opt/yugabyte/data/node-1/disk-1/tserver.out
The files belonging to this database system will be owned by user "root".
This user must also own the server process.
The database cluster will be initialized with locales
COLLATE: C
CTYPE: en_US.UTF-8
MESSAGES: en_US.UTF-8
MONETARY: en_US.UTF-8
NUMERIC: en_US.UTF-8
TIME: en_US.UTF-8
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
creating directory /opt/yugabyte/data/node-1/disk-1/pg_data ... ok
creating subdirectories ... ok
selecting default max_connections ... 300
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
syncing data to disk ... ok
[root#srvr0 ~]# cat /opt/yugabyte/data/node-1/disk-1/tserver.err
In YugaByte DB, setting LC_COLLATE to C and all other locale settings to en_US.UTF-8 by default. Locale support will be enhanced as part of addressing https://github.com/YugaByte/yugabyte-db/issues/15572020-01-13 15:07:18.447 UTC [12159] LOG: YugaByte is ENABLED in PostgreSQL. Transactions are enabled.
2020-01-13 15:07:18.488 UTC [12159] LOG: listening on IPv4 address "127.0.0.1", port 5433
2020-01-13 15:07:18.595 UTC [12159] LOG: redirecting log output to logging collector process
2020-01-13 15:07:18.595 UTC [12159] HINT: Future log output will appear in directory "/opt/yugabyte/data/node-1/disk-1/yb-data/tserver/logs".
Update 2:
[root#srvr0 ~]# cat /opt/yugabyte/data/node-1/disk-1/yb-data/master/logs/yb-master.WARNING
Log file created at: 2020/01/14 13:47:23
Running on machine: srvr0
Application fingerprint: version 2.0.10.0 build 4 revision 83610e77c7659c7587bc0c8aea76db47ff8e2df1 build_type RELEASE built at 06 Jan 2020 08:02:49 UTC
Running duration (h:mm:ss): 0:00:00
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
W0114 13:47:23.925465 12631 master_service.cc:108] Could not set master raft config : Illegal state (yb/master/catalog_manager.cc:6130): Node 1d36ad7c7b89457197595fc8f9e57f6f peer not initialized.
W0114 13:47:23.928180 12631 master_service.cc:108] Could not set master raft config : Illegal state (yb/master/catalog_manager.cc:6130): Node 1d36ad7c7b89457197595fc8f9e57f6f peer not initialized.
W0114 13:47:23.929930 12631 master_service.cc:108] Could not set master raft config : Illegal state (yb/master/catalog_manager.cc:6130): Node 1d36ad7c7b89457197595fc8f9e57f6f peer not initialized.
W0114 13:47:23.931773 12631 master_service.cc:108] Could not set master raft config : Illegal state (yb/master/catalog_manager.cc:6130): Node 1d36ad7c7b89457197595fc8f9e57f6f peer not initialized.
W0114 13:47:25.277549 12595 log.cc:702] Time spent Fsync log took a long time: real 0.289s user 0.000s sys 0.000s
W0114 13:47:27.635577 12595 log.cc:702] Time spent Fsync log took a long time: real 0.144s user 0.000s sys 0.000s
W0114 13:47:29.459060 12595 log.cc:702] Time spent Fsync log took a long time: real 0.088s user 0.000s sys 0.000s
...
W0114 13:48:17.587898 12595 log.cc:702] Time spent Fsync log took a long time: real 0.068s user 0.000s sys 0.000s
W0114 13:48:17.652386 12595 log.cc:702] Time spent Fsync log took a long time: real 0.064s user 0.000s sys 0.000s
W0114 13:48:18.864150 12595 log.cc:702] Time spent Fsync log took a long time: real 0.089s user 0.000s sys 0.000s
W0114 13:48:25.154635 12654 permissions_manager.cc:1050] Multiple security configs found when loading sys catalog
W0114 13:48:25.181205 12654 catalog_manager.cc:606] Time spent T 00000000000000000000000000000000 P 1d36ad7c7b89457197595fc8f9e57f6f: Loading metadata into memory: real 60.895s user 0.132s sys 0.026s
[root#srvr0 ~]# cat /opt/yugabyte/data/node-1/disk-1/yb-data/tserver/logs/yb-tserver.WARNING
Log file created at: 2020/01/14 13:47:23
Running on machine: srvr0
Application fingerprint: version 2.0.10.0 build 4 revision 83610e77c7659c7587bc0c8aea76db47ff8e2df1 build_type RELEASE built at 06 Jan 2020 08:02:49 UTC
Running duration (h:mm:ss): 0:00:00
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
W0114 13:47:23.926698 12628 heartbeater.cc:598] P 4bbca70b45944a7e9f66463471e11466: Failed to heartbeat to 127.0.0.1:7100: Service unavailable (yb/tserver/heartbeater.cc:479): master is no longer the leader tries=0, num=1, masters=0x00000000029c8d60 -> [[127.0.0.1:7100]], code=Service unavailable
W0114 13:47:23.928352 12628 heartbeater.cc:598] P 4bbca70b45944a7e9f66463471e11466: Failed to heartbeat to 127.0.0.1:7100: Service unavailable (yb/tserver/heartbeater.cc:479): master is no longer the leader tries=1, num=1, masters=0x00000000029c8d60 -> [[127.0.0.1:7100]], code=Service unavailable
W0114 13:47:23.930130 12628 heartbeater.cc:598] P 4bbca70b45944a7e9f66463471e11466: Failed to heartbeat to 127.0.0.1:7100: Service unavailable (yb/tserver/heartbeater.cc:479): master is no longer the leader tries=2, num=1, masters=0x00000000029c8d60 -> [[127.0.0.1:7100]], code=Service unavailable
W0114 13:47:23.930173 12628 heartbeater.cc:323] P 4bbca70b45944a7e9f66463471e11466: Failed 3 heartbeats in a row: no longer allowing fast heartbeat attempts.
...
W0114 13:48:22.868005 12628 heartbeater.cc:598] P 4bbca70b45944a7e9f66463471e11466: Failed to heartbeat to 127.0.0.1:7100: Service unavailable (yb/tserver/heartbeater.cc:479): master is no longer the leader tries=61, num=1, masters=0x00000000029c8d60 -> [[127.0.0.1:7100]], code=Service unavailable
W0114 13:48:23.869757 12628 heartbeater.cc:598] P 4bbca70b45944a7e9f66463471e11466: Failed to heartbeat to 127.0.0.1:7100: Service unavailable (yb/tserver/heartbeater.cc:479): master is no longer the leader tries=62, num=1, masters=0x00000000029c8d60 -> [[127.0.0.1:7100]], code=Service unavailable
W0114 13:48:24.915241 12628 heartbeater.cc:598] P 4bbca70b45944a7e9f66463471e11466: Failed to heartbeat to 127.0.0.1:7100: Service unavailable (yb/tserver/heartbeater.cc:479): master is no longer the leader tries=63, num=1, masters=0x00000000029c8d60 -> [[127.0.0.1:7100]], code=Service unavailable
Update 3:
last 20 lines master and tserver INFO files:
[root#srvr0 logs]# tail -20 /opt/yugabyte/data/node-1/disk-1/yb-data/master/logs/yb-master.INFO
}
}
table_type: TRANSACTION_STATUS_TABLE_TYPE
namespace {
name: "system"
}
I0121 07:00:23.625553 12478 catalog_manager.cc:1937] Setting default tablets to 2 with 1 primary servers
I0121 07:00:23.625607 12478 partition.cc:388] Creating partitions with num_tablets: 2
I0121 07:00:23.701505 12478 catalog_manager.cc:2155] Successfully created table transactions [id=ebe4eab3526e4030a8ef44796223f904] per request from internal request
I0121 07:00:23.701651 12478 catalog_manager.cc:741] Finished creating transaction status table asynchronously
I0121 07:00:23.701782 12478 catalog_manager.cc:3790] 5536e8fad1d04d52902a0d9488ab5b4e now has full report for 0 tablets.
I0121 07:00:23.701819 12478 catalog_manager.cc:3796] 5536e8fad1d04d52902a0d9488ab5b4e sent full tablet report with 0 tablets.
I0121 07:00:23.901152 12478 catalog_manager.cc:4037] Peer 5536e8fad1d04d52902a0d9488ab5b4e sent incremental report for 1bd70a13590146de9fa3feb16e90b120, prev state op id: -1, prev state term: 0, prev state has_leader_uuid: 0. Consensus state: current_term: 0 config { opid_index: -1 peers { permanent_uuid: "5536e8fad1d04d52902a0d9488ab5b4e" member_type: VOTER last_known_private_addr { host: "127.0.0.1" port: 9100 } cloud_info { placement_cloud: "cloud1" placement_region: "datacenter1" placement_zone: "rack1" } } }
I0121 07:00:24.024679 12478 catalog_manager.cc:4037] Peer 5536e8fad1d04d52902a0d9488ab5b4e sent incremental report for 1bd70a13590146de9fa3feb16e90b120, prev state op id: -1, prev state term: 0, prev state has_leader_uuid: 0. Consensus state: current_term: 1 config { opid_index: -1 peers { permanent_uuid: "5536e8fad1d04d52902a0d9488ab5b4e" member_type: VOTER last_known_private_addr { host: "127.0.0.1" port: 9100 } cloud_info { placement_cloud: "cloud1" placement_region: "datacenter1" placement_zone: "rack1" } } }
I0121 07:00:24.035790 12457 catalog_manager.cc:4037] Peer 5536e8fad1d04d52902a0d9488ab5b4e sent incremental report for ec9bb307331442b3b1fd7ba43a0199a0, prev state op id: -1, prev state term: 0, prev state has_leader_uuid: 0. Consensus state: current_term: 1 config { opid_index: -1 peers { permanent_uuid: "5536e8fad1d04d52902a0d9488ab5b4e" member_type: VOTER last_known_private_addr { host: "127.0.0.1" port: 9100 } cloud_info { placement_cloud: "cloud1" placement_region: "datacenter1" placement_zone: "rack1" } } }
I0121 07:00:24.035905 12457 catalog_manager.cc:4002] Tablet: 1bd70a13590146de9fa3feb16e90b120 reported consensus state change. New consensus state: current_term: 1 leader_uuid: "5536e8fad1d04d52902a0d9488ab5b4e" config { opid_index: -1 peers { permanent_uuid: "5536e8fad1d04d52902a0d9488ab5b4e" member_type: VOTER last_known_private_addr { host: "127.0.0.1" port: 9100 } cloud_info { placement_cloud: "cloud1" placement_region: "datacenter1" placement_zone: "rack1" } } } from 5536e8fad1d04d52902a0d9488ab5b4e
I0121 07:00:24.036085 12457 catalog_entity_info.cc:97] T 1bd70a13590146de9fa3feb16e90b120: Leader changed from <NULL> to 0x00000000038ee010 -> { permanent_uuid: 5536e8fad1d04d52902a0d9488ab5b4e registration: common { private_rpc_addresses { host: "127.0.0.1" port: 9100 } http_addresses { host: "127.0.0.1" port: 9000 } cloud_info { placement_cloud: "cloud1" placement_region: "datacenter1" placement_zone: "rack1" } placement_uuid: "" } capabilities: 2189743739 placement_id: cloud1:datacenter1:rack1 }
I0121 07:00:24.069538 12478 catalog_manager.cc:4002] Tablet: ec9bb307331442b3b1fd7ba43a0199a0 reported consensus state change. New consensus state: current_term: 1 leader_uuid: "5536e8fad1d04d52902a0d9488ab5b4e" config { opid_index: -1 peers { permanent_uuid: "5536e8fad1d04d52902a0d9488ab5b4e" member_type: VOTER last_known_private_addr { host: "127.0.0.1" port: 9100 } cloud_info { placement_cloud: "cloud1" placement_region: "datacenter1" placement_zone: "rack1" } } } from 5536e8fad1d04d52902a0d9488ab5b4e
I0121 07:00:24.069607 12478 catalog_entity_info.cc:97] T ec9bb307331442b3b1fd7ba43a0199a0: Leader changed from <NULL> to 0x00000000038ee010 -> { permanent_uuid: 5536e8fad1d04d52902a0d9488ab5b4e registration: common { private_rpc_addresses { host: "127.0.0.1" port: 9100 } http_addresses { host: "127.0.0.1" port: 9000 } cloud_info { placement_cloud: "cloud1" placement_region: "datacenter1" placement_zone: "rack1" } placement_uuid: "" } capabilities: 2189743739 placement_id: cloud1:datacenter1:rack1 }
I0121 07:00:28.951503 12447 reactor.cc:450] Master_R000: Timing out connection Connection (0x0000000002cc3690) server 127.0.0.1:49899 => 127.0.0.1:7100 - it has been idle for 65.0008s (delta: 65.0008, current time: 751.024, last activity time: 686.023)
[root#srvr0 logs]# tail -20 /opt/yugabyte/data/node-1/disk-1/yb-data/tserver/logs/yb_tserver.INFO
tail: cannot open ‘/opt/yugabyte/data/node-1/disk-1/yb-data/tserver/logs/yb_tserver.INFO’ for reading: No such file or directory
[root#srvr0 logs]# tail -20 /opt/yugabyte/data/node-1/disk-1/yb-data/tserver/logs/yb-tserver.INFO
I0121 07:00:24.024483 13021 consensus_meta.cc:275] T 1bd70a13590146de9fa3feb16e90b120 P 5536e8fad1d04d52902a0d9488ab5b4e: Updating active role from FOLLOWER to LEADER. Consensus state: current_term: 1 leader_uuid: "5536e8fad1d04d52902a0d9488ab5b4e" config { opid_index: -1 peers { permanent_uuid: "5536e8fad1d04d52902a0d9488ab5b4e" member_type: VOTER last_known_private_addr { host: "127.0.0.1" port: 9100 } cloud_info { placement_cloud: "cloud1" placement_region: "datacenter1" placement_zone: "rack1" } } }, has_pending_config = 0
I0121 07:00:24.024521 13021 raft_consensus.cc:2803] T 1bd70a13590146de9fa3feb16e90b120 P 5536e8fad1d04d52902a0d9488ab5b4e [term 1 LEADER]: Calling mark dirty synchronously for reason code NEW_LEADER_ELECTED
I0121 07:00:24.024586 13021 raft_consensus.cc:838] T 1bd70a13590146de9fa3feb16e90b120 P 5536e8fad1d04d52902a0d9488ab5b4e [term 1 LEADER]: Becoming Leader. State: Replica: 5536e8fad1d04d52902a0d9488ab5b4e, State: 1, Role: LEADER, Watermarks: {Received: 0.0 Committed: 0.0} Leader: 0.0
I0121 07:00:24.024760 13021 consensus_queue.cc:207] T 1bd70a13590146de9fa3feb16e90b120 P 5536e8fad1d04d52902a0d9488ab5b4e [LEADER]: Queue going to LEADER mode. State: All replicated op: 0.0, Majority replicated op: 0.0, Committed index: 0.0, Last appended: 0.0, Current term: 1, Majority size: 1, State: QUEUE_OPEN, Mode: LEADER, active raft config: opid_index: -1 peers { permanent_uuid: "5536e8fad1d04d52902a0d9488ab5b4e" member_type: VOTER last_known_private_addr { host: "127.0.0.1" port: 9100 } cloud_info { placement_cloud: "cloud1" placement_region: "datacenter1" placement_zone: "rack1" } }
I0121 07:00:24.024852 13021 raft_consensus.cc:856] Sending NO_OP at op { term: 0 index: 0 }
I0121 07:00:24.026254 13023 replica_state.cc:1268] T 1bd70a13590146de9fa3feb16e90b120 P 5536e8fad1d04d52902a0d9488ab5b4e [term 1 LEADER]: SetLeaderNoOpCommittedUnlocked(1)
I0121 07:00:24.026321 13023 replica_state.cc:725] T 1bd70a13590146de9fa3feb16e90b120 P 5536e8fad1d04d52902a0d9488ab5b4e [term 1 LEADER]: Advanced the committed_op_id across terms. Last committed operation was: { term: 0 index: 0 } New committed index is: { term: 1 index: 1 }
I0121 07:00:24.035311 13018 leader_election.cc:239] T ec9bb307331442b3b1fd7ba43a0199a0 P 5536e8fad1d04d52902a0d9488ab5b4e [CANDIDATE]: Term 1 election: Election decided. Result: candidate won.
I0121 07:00:24.035398 13018 raft_consensus.cc:2867] T ec9bb307331442b3b1fd7ba43a0199a0 P 5536e8fad1d04d52902a0d9488ab5b4e [term 1 FOLLOWER]: Snoozing failure detection for 3.178s
I0121 07:00:24.035445 13018 raft_consensus.cc:2773] T ec9bb307331442b3b1fd7ba43a0199a0 P 5536e8fad1d04d52902a0d9488ab5b4e [term 1 FOLLOWER]: Leader election won for term 1
I0121 07:00:24.035468 13018 replica_state.cc:1268] T ec9bb307331442b3b1fd7ba43a0199a0 P 5536e8fad1d04d52902a0d9488ab5b4e [term 1 FOLLOWER]: SetLeaderNoOpCommittedUnlocked(0)
I0121 07:00:24.035542 13018 consensus_meta.cc:275] T ec9bb307331442b3b1fd7ba43a0199a0 P 5536e8fad1d04d52902a0d9488ab5b4e: Updating active role from FOLLOWER to LEADER. Consensus state: current_term: 1 leader_uuid: "5536e8fad1d04d52902a0d9488ab5b4e" config { opid_index: -1 peers { permanent_uuid: "5536e8fad1d04d52902a0d9488ab5b4e" member_type: VOTER last_known_private_addr { host: "127.0.0.1" port: 9100 } cloud_info { placement_cloud: "cloud1" placement_region: "datacenter1" placement_zone: "rack1" } } }, has_pending_config = 0
I0121 07:00:24.035590 13018 raft_consensus.cc:2803] T ec9bb307331442b3b1fd7ba43a0199a0 P 5536e8fad1d04d52902a0d9488ab5b4e [term 1 LEADER]: Calling mark dirty synchronously for reason code NEW_LEADER_ELECTED
I0121 07:00:24.035641 13018 raft_consensus.cc:838] T ec9bb307331442b3b1fd7ba43a0199a0 P 5536e8fad1d04d52902a0d9488ab5b4e [term 1 LEADER]: Becoming Leader. State: Replica: 5536e8fad1d04d52902a0d9488ab5b4e, State: 1, Role: LEADER, Watermarks: {Received: 0.0 Committed: 0.0} Leader: 0.0
I0121 07:00:24.035706 13018 consensus_queue.cc:207] T ec9bb307331442b3b1fd7ba43a0199a0 P 5536e8fad1d04d52902a0d9488ab5b4e [LEADER]: Queue going to LEADER mode. State: All replicated op: 0.0, Majority replicated op: 0.0, Committed index: 0.0, Last appended: 0.0, Current term: 1, Majority size: 1, State: QUEUE_OPEN, Mode: LEADER, active raft config: opid_index: -1 peers { permanent_uuid: "5536e8fad1d04d52902a0d9488ab5b4e" member_type: VOTER last_known_private_addr { host: "127.0.0.1" port: 9100 } cloud_info { placement_cloud: "cloud1" placement_region: "datacenter1" placement_zone: "rack1" } }
I0121 07:00:24.035748 13018 raft_consensus.cc:856] Sending NO_OP at op { term: 0 index: 0 }
I0121 07:00:24.036341 13021 replica_state.cc:1268] T ec9bb307331442b3b1fd7ba43a0199a0 P 5536e8fad1d04d52902a0d9488ab5b4e [term 1 LEADER]: SetLeaderNoOpCommittedUnlocked(1)
I0121 07:00:24.036391 13021 replica_state.cc:725] T ec9bb307331442b3b1fd7ba43a0199a0 P 5536e8fad1d04d52902a0d9488ab5b4e [term 1 LEADER]: Advanced the committed_op_id across terms. Last committed operation was: { term: 0 index: 0 } New committed index is: { term: 1 index: 1 }
I0121 07:01:28.862228 12462 reactor.cc:450] TabletServer_R000: Timing out connection Connection (0x0000000003fb4490) server 127.0.0.1:49050 => 127.0.0.1:9100 - it has been idle for 65.0008s (delta: 65.0008, current time: 810.935, last activity time: 745.934)
I0121 07:01:28.862249 12463 reactor.cc:450] TabletServer_R001: Timing out connection Connection (0x0000000003fb47f0) server 127.0.0.1:33000 => 127.0.0.1:9100 - it has been idle for 65.0008s (delta: 65.0008, current time: 810.936, last activity time: 745.935)
Update 4:
Install Python 2.7.10 on CentOS7(Reference:https://myopswork.com/install-python-2-7-10-on-centos-rhel-75f90c5239a5), as follows:
cd /usr/src
wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
tar xzf Python-2.7.10.tgz
cd Python-2.7.10
./configure
make altinstall
python2.7
###Make python 2.7.10 as default
echo "alias python=\"/usr/local/bin/python2.7\"" >> /etc/profile
execute the following commands to install yugabyte 2.0.10.0
cd ~
rm -rf /opt/yugabyte
mkdir -p /opt/yugabyte
mkdir -p /opt/yugabyte/data
tar -xvzf /tmp/yugabyte/yugabyte-2.0.10.0-linux.tar.gz -C /opt/yugabyte
/opt/yugabyte/yugabyte-2.0.10.0/bin/post_install.sh
/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" destroy
/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" create
/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" setup_redis
/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" status
Note: 1st attempt to create db fails, destroy it and create it again.
Logs:
Python 2.7.10:
[root#srvr0 ~]# python
Python 2.7.10 (default, Jan 27 2020, 17:09:56)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit();
Installation:
[root#srvr0 ~]# cd ~
[root#srvr0 ~]# rm -rf /opt/yugabyte
[root#srvr0 ~]# mkdir -p /opt/yugabyte
[root#srvr0 ~]# mkdir -p /opt/yugabyte/data
[root#srvr0 ~]# ###cp /root/yugabyte-2.0.10.0-linux.tar.gz /index
[root#srvr0 ~]# tar -xvzf /index/yugabyte/yugabyte-2.0.10.0-linux.tar.gz -C /opt/yugabyte
yugabyte-2.0.10.0/
yugabyte-2.0.10.0/bin/
yugabyte-2.0.10.0/bin/ysqlsh
yugabyte-2.0.10.0/bin/psql
yugabyte-2.0.10.0/bin/bulk_load_cleanup.sh
yugabyte-2.0.10.0/bin/bulk_load_helper.sh
yugabyte-2.0.10.0/bin/log_cleanup.sh
yugabyte-2.0.10.0/bin/yb-check-failed-tablets.sh
yugabyte-2.0.10.0/bin/yb-check-consistency.py
yugabyte-2.0.10.0/bin/configure
...
yugabyte-2.0.10.0/ui/conf/evolutions/default/1.sql
yugabyte-2.0.10.0/ui/conf/application.conf
yugabyte-2.0.10.0/ui/conf/k8s-expose-all.yml
yugabyte-2.0.10.0/ui/conf/application.default.conf
yugabyte-2.0.10.0/ui/conf/default_cmk_policy.json
yugabyte-2.0.10.0/ui/conf/version.txt
yugabyte-2.0.10.0/ui/README.md
yugabyte-2.0.10.0/version_metadata.json
[root#srvr0 ~]# /opt/yugabyte/yugabyte-2.0.10.0/bin/post_install.sh
+ /opt/yugabyte/yugabyte-2.0.10.0/bin/patchelf --set-interpreter /opt/yugabyte/yugabyte-2.0.10.0/lib/ld.so log-dump
...
+ /opt/yugabyte/yugabyte-2.0.10.0/bin/patchelf --set-interpreter /opt/yugabyte/yugabyte-2.0.10.0/lib/ld.so vacuumlo
+ /opt/yugabyte/yugabyte-2.0.10.0/bin/patchelf --set-rpath /opt/yugabyte/yugabyte-2.0.10.0/lib/yb:/opt/yugabyte/yugabyte-2.0.10.0/lib/yb-thirdparty:/opt/yugabyte/yugabyte-2.0.10.0/linuxbrew/lib vacuumlo
[root#srvr0 ~]# /opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" destroy
Destroying cluster.
[root#srvr0 ~]# /opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" create
Creating cluster.
Waiting for cluster to be ready.
Traceback (most recent call last):
File "/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl", line 1969, in <module>
control.run()
File "/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl", line 1946, in run
self.args.func()
File "/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl", line 1706, in create_cmd_impl
self.wait_for_cluster_or_raise()
File "/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl", line 1551, in wait_for_cluster_or_raise
raise RuntimeError("Timed out waiting for a YugaByte DB cluster!")
RuntimeError: Timed out waiting for a YugaByte DB cluster!
Viewing file /tmp/tmpJb_KSP:
2020-01-27 19:09:25,732 INFO: Starting master-1 with:
/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-master --fs_data_dirs "/opt/yugabyte/data/node-1/disk-1" --webserver_interface 127.0.0.1 --rpc_bind_addresses 127.0.0.1 --v 0 --version_file_json_path=/opt/yugabyte/yugabyte-2.0.10.0 --webserver_doc_root "/opt/yugabyte/yugabyte-2.0.10.0/www" --replication_factor=1 --yb_num_shards_per_tserver 2 --ysql_num_shards_per_tserver=2 --master_addresses 127.0.0.1:7100 --enable_ysql=true >"/opt/yugabyte/data/node-1/disk-1/master.out" 2>"/opt/yugabyte/data/node-1/disk-1/master.err" &
2020-01-27 19:09:25,792 INFO: Starting tserver-1 with:
/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-tserver --fs_data_dirs "/opt/yugabyte/data/node-1/disk-1" --webserver_interface 127.0.0.1 --rpc_bind_addresses 127.0.0.1 --v 0 --version_file_json_path=/opt/yugabyte/yugabyte-2.0.10.0 --webserver_doc_root "/opt/yugabyte/yugabyte-2.0.10.0/www" --tserver_master_addrs=127.0.0.1:7100 --yb_num_shards_per_tserver=2 --redis_proxy_bind_address=127.0.0.1:6379 --cql_proxy_bind_address=127.0.0.1:9042 --local_ip_for_outbound_sockets=127.0.0.1 --use_cassandra_authentication=false --ysql_num_shards_per_tserver=2 --enable_ysql=true --pgsql_proxy_bind_address=127.0.0.1:5433 >"/opt/yugabyte/data/node-1/disk-1/tserver.out" 2>"/opt/yugabyte/data/node-1/disk-1/tserver.err" &
2020-01-27 19:09:25,800 INFO: Waiting for master and tserver processes to come up.
2020-01-27 19:09:25,934 INFO: Waiting for master leader election and tablet server registration.
2020-01-27 19:10:22,502 INFO: Master leader election still pending...
2020-01-27 19:10:23,504 ERROR: Failed waiting for None tservers, got None
^^^ Encountered errors ^^^
[root#srvr0 ~]# /opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" destroy
Destroying cluster.
[root#srvr0 ~]# /opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" create
Creating cluster.
Waiting for cluster to be ready.
.
----------------------------------------------------------------------------------------------------
| Node Count: 1 | Replication Factor: 1 |
----------------------------------------------------------------------------------------------------
| JDBC : jdbc:postgresql://127.0.0.1:5433/postgres |
| YSQL Shell : /opt/yugabyte/yugabyte-2.0.10.0/bin/ysqlsh |
| YCQL Shell : /opt/yugabyte/yugabyte-2.0.10.0/bin/cqlsh |
| YEDIS Shell : /opt/yugabyte/yugabyte-2.0.10.0/bin/redis-cli |
| Web UI : http://127.0.0.1:7000/ |
| Cluster Data : /opt/yugabyte/data |
----------------------------------------------------------------------------------------------------
For more info, please use: yb-ctl --data_dir /opt/yugabyte/data status
[root#srvr0 ~]# /opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" setup_redis
Setting up YugaByte DB support for Redis API.
Waiting for cluster to be ready.
Setup Redis successful.
You got it working in this issue How to run yugabyte-db yugastore application locally? .
Can you check these logs and report them:
/opt/yugabyte/data/node-1/disk-1/master.out, /opt/yugabyte/data/node-1/disk-1/master.err, /opt/yugabyte/data/node-1/disk-1/tserver.out, /opt/yugabyte/data/node-1/disk-1/tserver.err.
We are trying to reproduce this internally and will get back to you. In the meanwhile, could you please check the tserver.err file and the tserver.INFO logs (how to find yb-ctl tserver logs instructions) to see if anything bad is happening? Feels like the tservers are not up and running.

Connection refused when connecting to the exposed port on docker container

Dockerfile looks like this:
FROM ubuntu:latest
LABEL Spongebob Dockerpants "s.dockerpants#comcast.net"
RUN apt-get update -y
RUN apt-get install -y python3-pip python3-dev build-essential
#Add source files
COPY . /app
ENV HOME=/app
WORKDIR /app
# Install Python web server and dependencies
RUN pip3 install -r requirements.txt
ENV FLASK_APP=app.py
# Expose port
EXPOSE 8090
#ENTRYPOINT ["python3"]
CMD ["python3", "app.py"]
CMD tail -f /dev/null
I started the container like this:
docker run --name taskman -p 8090:8090 -d task-manager-app:latest
I see the container running, and my localhost listening on 8090:
CORP\n0118236 # a-33jxiw0rv8is5 in ~/docker_pete/flask-task-manager on master*
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c1ac5cb27698 task-manager-app:latest "/bin/sh -c 'tail -f…" About a minute ago Up About a minute 0.0.0.0:8090->8090/tcp taskman
CORP\n0118236 # a-33jxiw0rv8is5 in ~/docker_pete/flask-task-manager on master*
$ sudo netstat -nlp | grep 8090
tcp6 0 0 :::8090 :::* LISTEN 1154/docker-proxy
I tried to reach 8090 on the container via localhost per the docker run command I issued, but get 'connection refused'
CORP\n0118236 # a-33jxiw0rv8is5 in ~/docker_pete/flask-task-manager on master*
$ curl http://localhost:8090
curl: (56) Recv failure: Connection reset by peer
I then inspected the port-binding, and it looks ok:
CORP\n0118236 # a-33jxiw0rv8is5 in ~/docker_pete/flask-task-manager on master*
$ sudo docker port c1ac5cb27698 8090
0.0.0.0:8090
When I do a docker inspect , I see this:
$ docker inspect c1ac5cb27698 | grep -A 55 "NetworkSettings"
"NetworkSettings": {
"Bridge": "",
"SandboxID": "7c2249761e4f48eef373c6744161b0709f312863c94fdc17138913952be698a0",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"8090/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "8090"
}
]
},
"SandboxKey": "/var/run/docker/netns/7c2249761e4f",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "ea7552d0ba9e8f0c865fa4a0f24781811c7332a1e7473c48e88fa4dbe6e5e05d",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:02",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "cfb5be57fdeed8a08b1650b5706a00542c5249903ce33052ff3f0d3dab619675",
"EndpointID": "ea7552d0ba9e8f0c865fa4a0f24781811c7332a1e7473c48e88fa4dbe6e5e05d",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02",
"DriverOpts": null
}
}
}
}
I am able to ping the container from my localhost:
CORP\n0118236 # a-33jxiw0rv8is5 in ~/docker_pete/flask-task-manager on master*
$ ping 172.17.0.2
PING 172.17.0.2 (172.17.0.2) 56(84) bytes of data.
64 bytes from 172.17.0.2: icmp_seq=1 ttl=255 time=0.045 ms
64 bytes from 172.17.0.2: icmp_seq=2 ttl=255 time=0.042 ms
64 bytes from 172.17.0.2: icmp_seq=3 ttl=255 time=0.047 ms
^C
--- 172.17.0.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2053ms
rtt min/avg/max/mdev = 0.042/0.044/0.047/0.008 ms
Is there anything in the configuration that would be causing these connection refused? Is something wrong with the binding?
Your docker file contains two CMD line, but docker will only honor the latest one.
CMD ["python3", "app.py"]
CMD tail -f /dev/null
The actual command executed inside your container is the tail command, which doesn't bind and listen on the port. You can ping the container because the container is alive with the tail command.

Error while sending query request from client : No peer available to query

I am getting the following error while sending query request from my client.
FabricError: No peers available to query. Errors: ["Failed to connect before the deadline
URL:grpcs://localhost:12051","Failed to connect before the deadline
URL:grpcs://localhost:11051"].
Following is my the part of my connection-org3.json connection profile file
"organizations": {
"Org3": {
"mspid": "Org3MSP",
"peers": [
"peer0.org3.bc4scm.de",
"peer1.org3.bc4scm.de"
],
"certificateAuthorities": [
"ca.org3.bc4scm.de"
]
}
},
"peers": {
"peer0.org3.bc4scm.de": {
"url": "grpcs://localhost:11051",
"tlsCACerts": {
"path": "crypto-config/peerOrganizations/org3.bc4scm.de/tlsca/tlsca.org3.bc4scm.de-cert.pem"
},
"grpcOptions": {
"ssl-target-name-override": "peer0.org3.bc4scm.de"
}
},
"peer1.org3.bc4scm.de": {
"url": "grpcs://localhost:12051",
"tlsCACerts": {
"path": "crypto-config/peerOrganizations/supplier.bc4scm.de/tlsca/tlsca.org3.bc4scm.de-cert.pem"
},
"grpcOptions": {
"ssl-target-name-override": "peer1.org3.bc4scm.de"
}
}
},
"certificateAuthorities": {
"ca.org3.bc4scm.de": {
"url": "https://localhost:9054",
"caName": "ca-supplier",
"tlsCACerts": {
"path": "crypto-config/peerOrganizations/org3.bc4scm.de/tlsca/tlsca.org3.bc4scm.de-cert.pem"
},
"httpOptions": {
"verify": false
}
}
}
And following is a part of my docker composer file.
peer0.org3.bc4scm.de:
container_name: peer0.org3.bc4scm.de
extends:
file: peer-base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.org3.bc4scm.de
- CORE_PEER_ADDRESS=peer0.org3.bc4scm.de:11051
- CORE_PEER_LISTENADDRESS=0.0.0.0:11051
- CORE_PEER_CHAINCODEADDRESS=peer0.org3.bc4scm.de:11052
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:11052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org3.bc4scm.de:12051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org3.bc4scm.de:11051
- CORE_PEER_LOCALMSPID=Org3MSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/org3.bc4scm.de/peers/peer0.org3.bc4scm.de/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/org3.bc4scm.de/peers/peer0.org3.bc4scm.de/tls:/etc/hyperledger/fabric/tls
- peer0.org3.bc4scm.de:/var/hyperledger/production
ports:
- 11051:11051
peer1.org3.bc4scm.de:
container_name: peer1.org3.bc4scm.de
extends:
file: peer-base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.org3.bc4scm.de
- CORE_PEER_ADDRESS=peer1.org3.bc4scm.de:12051
- CORE_PEER_LISTENADDRESS=0.0.0.0:12051
- CORE_PEER_CHAINCODEADDRESS=peer1.org3.bc4scm.de:12052
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:12052
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org3.bc4scm.de:11051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org3.bc4scm.de:12051
- CORE_PEER_LOCALMSPID=Org3MSP
volumes:
- /var/run/:/host/var/run/
- ../crypto-config/peerOrganizations/org3.bc4scm.de/peers/peer1.org3.bc4scm.de/msp:/etc/hyperledger/fabric/msp
- ../crypto-config/peerOrganizations/supplier.bc4scm.de/peers/peer1.org3.bc4scm.de/tls:/etc/hyperledger/fabric/tls
- peer1.org3.bc4scm.de:/var/hyperledger/production
ports:
- 12051:12051
I got this code from Fabcar sample and tried to query from a client in Org3 instead of Org1. I created an admin user and then created a user in this organization successfully. According to my observations, I am getting the error from following code line execution.
const result = await contract.evaluateTransaction('queryAllProducts','123');
What is the possible reason for this issue? Appreciate your insights on this.
Updates:
I checked opened ports in peer0.prg3.bs4scm.de
root#e52992a76c3d:/opt/gopath/src/github.com/hyperledger/fabric/peer# netstat -tulpn | grep LISTEN
tcp 0 0 127.0.0.1:9443 0.0.0.0:* LISTEN 1/peer
tcp 0 0 127.0.0.11:46353 0.0.0.0:* LISTEN -
tcp6 0 0 :::11051 :::* LISTEN 1/peer
tcp6 0 0 :::6060 :::* LISTEN 1/peer
tcp6 0 0 :::11052 :::* LISTEN 1/peer
Here I can see ports 11051 and 11052 are open and listening.
Also, there is a container for the installed chain code.
cd0b165e5186 dev-peer0.org3.bc4scm.de-scmlogic-1.0-9c7e776aa8a752e530f79d0b456f1bda28aac3f5db0af734be2f315d8d1a4f53 "/bin/sh -c 'cd /usr…" 48 seconds ago Up 47 seconds dev-peer0.org3.bc4scm.de-scmlogic-1.0
When I look at the logs of that peer(peer0.org3) I can see floowing error log is print continuously. It is complaining about the connection with org1
019-07-06 10:26:52.278 UTC [gossip.discovery] expireDeadMembers -> WARN 164 Exiting
2019-07-06 10:26:56.381 UTC [gossip.comm] func1 -> WARN 165 peer1.org1.bc4scm.de:8051, PKIid:42214b7584f3fabcdb84e5770c62e4cf0f7c00b2a9d0441d772925882d4457a7 isn't responsive: EOF
2019-07-06 10:26:56.381 UTC [gossip.discovery] expireDeadMembers -> WARN 166 Entering [42214b7584f3fabcdb84e5770c62e4cf0f7c00b2a9d0441d772925882d4457a7]
2019-07-06 10:26:56.381 UTC [gossip.discovery] expireDeadMembers -> WARN 167 Closing connection to Endpoint: peer1.org1.bc4scm.de:8051, InternalEndpoint: , PKI-ID: 42214b7584f3fabcdb84e5770c62e4cf0f7c00b2a
You could check, if peer is accessible even using browser(Firefox). request on firefox - localhost:11051 if you could see the response means your peer is accessible or if not means your port is not open for the same, then go to the docker file and open the port for the same, and up the peer using docker compose , do the same for every peer you want to access.
Even you could check the logs of peers using following -
docker logs --follow peer0.org3.bc4scm.de
Update : ---
You could check CORE_PEER_GOSSIP_BOOTSTRAP & CORE_PEER_GOSSIP_EXTERNALENDPOINT for both peers
**CORE_PEER_GOSSIP_BOOTSTRAP=<a list of peer endpoints within the peer's org>
CORE_PEER_GOSSIP_EXTERNALENDPOINT=<the peer endpoint, as known outside the org>**
for peer0.org3.bc4scm.de
CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org3.bc4scm.de:12051
CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org3.bc4scm.de:11051
for peer1.org3.bc4scm.de :
CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org3.bc4scm.de:11051
CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org3.bc4scm.de:12051
Check Port accordingly your peers & up your docker file.
This could be due to multiple reasons:
Your peers are not accessible so first check if these ports are open or not.
You should confirm if the chaincode is installed on these peers or not.
If these are not the cases then you must check the logs inside the docker containers of the chaincode and these peers and for that you can use:
docker exec -it [container-name] bash
Do tell me if you find something there and you can't resolve it.
I had this same problem and realized the issue was I ha.d set the "asLocalhost" property to false and was trying to access peers at http://localhost/. Below is the working line with the property set correctly. (I pulled from an example using fabcar, which was great otherwise).
await gateway.connect(ccpPath, { wallet, identity: 'user1', discovery: { enabled: true, asLocalhost: true } });

Resources