Closed edbkei closed 2 years ago
Hi,
I still have the "Error initializing pool ledger" at localhost:9000, when following the instruction: The Production Writes Workshop, i.e. trying to run the network locally, accordingly to https://github.com/bcgov/von-network/blob/master/docs/Writing%20Transactions%20to%20a%20Ledger%20for%20an%20Un-privileged%20Author.md. It makes part of EDX course LinuxFoundationX LFS173x Becoming a Hyperledger Aries Developer.
In the enclosed file, I show that I tried the "workaround" of two Issues.
By using Play with Docker with browser, it has not happened in other exercises.
Regards
Eduardo
Looks like all the nodes are crashing due to a disk space issue; rocksdb.errors.RocksIOError: b'IO error: No space left on deviceWhile appending to file: /home/indy/ledger/sandbox/data/Node4/pool_merkleNodes/000003.log: No space left on device'
I´ve never got success trying to run locally. I´ve noticed that missing some python libraries: pip install python3_indy pip install indy-plenum. This faulty in Ubuntu 18.04 and 20.04. It looks requiring pip install python-rocksdb, that does not work. I´ve tried to fix python-rocksdb by a workaround given at https://github.com/baraiyaraj/python-rocksdb-/blob/master/install_steps, but also nor worked. von-network.log
How are you launching von-network
? You should be using the ./manage build
./manage start
approach. That will build and run von-network
in docker. The docker container will have all of the necessary dependencies.
Try resetting this as follows:
./manage rm
./manage build
./manage start
You could also try clearing the cached images, in case there is an issue there:
docker rmi bcgovimages/von-image:node-1.12-3
docker rmi von-network-base
docker image prune
./manage build
Results of the above steps and then running ./manage start --logs
:
I followed your recommendation, unfortunately still not good. Please, take a look in the log.
Now that things are rebuild try:
./manage stop
./manage rm
.manage start
Then give it a minute or so to startup completely the first time.
Previous was run on Ubuntu 18.04. On Ubuntu 20.04, the error is another. Probably, not prepared to. Fault_ledger_ubuntu20.txt
The other thing I can see in the logs is the webserver
(webserver_1
) may be starting up before the nodes are fully initialized and running. You can try increasing the sleep 10
to, say, sleep 20
here; https://github.com/bcgov/von-network/blob/master/docker-compose.yml#L25
You don't need to be installing any of the python dependencies directly on your machine. All of the dependancies will get installed in the container image during a ./manage build
.
On the Ubuntu 20.04 machine, it looks like you need to upgrade docker and docker-compose.
I´ve changed sleep to 20s, 40s, 80s in docker-compose.yml. The result is the same: "Error Initialization pool ledger" on url localhost:9000. The following error is also the same:
node4_1 | 2021-01-19 17:44:41,649|INFO|primary_connection_monitor_service.py|Node4:0 scheduling primary connection check in 60 sec node4_1 | 2021-01-19 17:44:41,825|INFO|cons_proof_service.py|Node4:ConsProofService:0 asking for ledger status of ledger 0 webserver_1 | 2021-01-19 17:44:52,192|WARNING|libindy.py|_indy_loop_callback: Function returned error webserver_1 | 2021-01-19 17:44:52,225|ERROR|anchor.py|Initialization error: webserver_1 | Traceback (most recent call last): webserver_1 | File "/home/indy/server/anchor.py", line 221, in _open_pool webserver_1 | self._pool = await pool.open_pool_ledger(pool_name, json.dumps(pool_cfg)) webserver_1 | File "/home/indy/.pyenv/versions/3.6.9/lib/python3.6/site-packages/indy/pool.py", line 88, in open_pool_ledger webserver_1 | open_pool_ledger.cb) webserver_1 | indy.error.PoolLedgerTimeout webserver_1 | webserver_1 | The above exception was the direct cause of the following exception: webserver_1 | webserver_1 | Traceback (most recent call last): webserver_1 | File "/home/indy/server/anchor.py", line 317, in open webserver_1 | await self._open_pool() webserver_1 | File "/home/indy/server/anchor.py", line 223, in _open_pool webserver_1 | raise AnchorException("Error opening pool ledger connection") from e webserver_1 | server.anchor.AnchorException: Error opening pool ledger connection webserver_1 | 2021-01-19 17:44:52,258|INFO|server.py|--- Trust anchor initialized ---
Is there any other option to try? Thanks.
Yes, try commenting out the following lines in the docker-compose file; https://github.com/bcgov/von-network/blob/master/docker-compose.yml#L48
- ./config:/home/indy/config
- ./server:/home/indy/server
Edited, sorry, originally pointed at the wrong line numbers.
status is the same. indy.error.PoolLedgerTimeout still happens, even changing sleep to 120s in docker-compose.yml.
Using GENESIS_FILE also not works.
ubu18@ubu18-VirtualBox:~/von-network$ ./manage build
Sending build context to Docker daemon 316.4kB
Step 1/9 : FROM bcgovimages/von-image:node-1.12-3
---> 860f94308216
Step 2/9 : ENV LOG_LEVEL ${LOG_LEVEL:-info}
---> Using cache
---> fa7e160e10eb
Step 3/9 : ENV RUST_LOG ${RUST_LOG:-warning}
---> Using cache
---> 48cbc6f28b18
Step 4/9 : ADD config ./config
---> Using cache
---> 666be3488de2
Step 5/9 : ADD server/requirements.txt server/
---> Using cache
---> bb190753acf0
Step 6/9 : RUN pip install --no-cache-dir -r server/requirements.txt
---> Using cache
---> d5baf37f8d96
Step 7/9 : ADD --chown=indy:indy indy_config.py /etc/indy/
---> Using cache
---> d417a69c980b
Step 8/9 : ADD --chown=indy:indy . $HOME
---> Using cache
---> fea2810ffc89
Step 9/9 : RUN mkdir -p $HOME/cli-scripts && chmod -R ug+rw $HOME/cli-scripts
---> Using cache
---> 5fe938bb493a
Successfully built 5fe938bb493a
Successfully tagged von-network-base:latest
ubu18@ubu18-VirtualBox:~/von-network$ cd genesis
ubu18@ubu18-VirtualBox:~/von-network/genesis$ ls
iiw_demo_genesis
ubu18@ubu18-VirtualBox:~/von-network/genesis$ cp iiw_demo_genesis some-genesis.txt
ubu18@ubu18-VirtualBox:~/von-network/genesis$ cd ..
ubu18@ubu18-VirtualBox:~/von-network$ GENESIS_FILE=/home/ubu18/von-network/genesis/some-genesis.txt PORT=9000 python3 -m server.server
Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/ubu18/von-network/server/server.py", line 14, in
What revision of von-network
are you running (example of what you should see below), and have you made any local modifications that are stopping you from pulling the latest version? Some of the issues you're having were fixed a long time ago.
$ git log
commit 9709df7c573d1d5118df8610cd3efbdd9fb814f3 (HEAD -> master, upstream/master, upstream/HEAD)
Merge: c778641 f2c1212
Author: Wade Barnes <wade.barnes@shaw.ca>
Date: Fri Nov 20 11:21:03 2020 -0800
Merge pull request #132 from WadeBarnes/master
Update certificate config
ubu18@ubu18-VirtualBox:~/von-network$ git log commit 9709df7c573d1d5118df8610cd3efbdd9fb814f3 (HEAD -> master, origin/master, origin/HEAD) Merge: c778641 f2c1212 Author: Wade Barnes wade.barnes@shaw.ca Date: Fri Nov 20 11:21:03 2020 -0800
Merge pull request #132 from WadeBarnes/master
Update certificate config
commit f2c12129aa944f3218a506892f07a635565fb42c Author: Wade Barnes wade.barnes@shaw.ca Date: Fri Nov 20 09:55:43 2020 -0800
Update certificate config
Signed-off-by: Wade Barnes <wade.barnes@shaw.ca>
commit c7786416c4d736ce7db0e7199f652dcbc52e64f2 Merge: 736de6d 947a9d1 Author: Wade Barnes wade.barnes@shaw.ca Date: Tue Sep 1 07:26:06 2020 -0700
Merge pull request #127 from TheArhaam/master
Added support for paths with spaces
commit 947a9d1a07d6af42eded4c8fd77e1fb5613f8bb6 Author: Arhaam Patvi thearhaam@gmail.com Date: Tue Sep 1 19:40:31 2020 +0530
Added support for paths with spaces
Signed-off-by: Arhaam Patvi <thearhaam@gmail.com>
commit 736de6da81df3a8e7409908acb8bef5819780acc :
Also, can you provide some details on the OS (I see Ubuntu 18.04. On Ubuntu 20.04) and the flavor of docker (and/or other virtualization) you are using
ubu18@ubu18-VirtualBox:~/von-network$ ubu18@ubu18-VirtualBox:~/von-network$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.5 LTS Release: 18.04 Codename: bionic ubu18@ubu18-VirtualBox:~/von-network$ docker --version Docker version 19.03.12, build 48a66213fe ubu18@ubu18-VirtualBox:~/von-network$ python --version Python 2.7.17 ubu18@ubu18-VirtualBox:~/von-network$ pip --version pip 20.3.3 from /home/ubu18/.local/lib/python3.6/site-packages/pip (python 3.6) ubu18@ubu18-VirtualBox:~/von-network$
ubu18@ubu18-VirtualBox:~/von-network$ python3 --version Python 3.6.9 ubu18@ubu18-VirtualBox:~/von-network$
VirtualBox 6.1.16 r140961 (Qt5.6.2)
ubu18@ubu18-VirtualBox:~/von-network$ sudo netstat -antp [sudo] password for ubu18: Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:2049 0.0.0.0: LISTEN - tcp 0 0 0.0.0.0:56133 0.0.0.0: LISTEN 737/rpc.mountd tcp 0 0 127.0.0.1:3306 0.0.0.0: LISTEN 802/mysqld tcp 0 0 0.0.0.0:59407 0.0.0.0: LISTEN 737/rpc.mountd tcp 0 0 0.0.0.0:111 0.0.0.0: LISTEN 409/rpcbind tcp 0 0 0.0.0.0:39761 0.0.0.0: LISTEN - tcp 0 0 10.94.190.1:53 0.0.0.0: LISTEN 1211/dnsmasq tcp 0 0 127.0.0.53:53 0.0.0.0: LISTEN 410/systemd-resolve tcp 0 0 0.0.0.0:22 0.0.0.0: LISTEN 742/sshd tcp 0 0 127.0.0.1:631 0.0.0.0: LISTEN 602/cupsd tcp 0 0 0.0.0.0:37979 0.0.0.0: LISTEN 737/rpc.mountd tcp 0 64 192.168.56.121:22 192.168.56.1:52044 ESTABLISHED 3715/sshd: ubu18 [p tcp 0 0 192.168.56.121:22 192.168.56.1:57477 ESTABLISHED 30162/sshd: ubu18 [ tcp 0 0 10.0.2.15:33804 54.69.126.142:443 ESTABLISHED 6554/firefox tcp 0 0 192.168.56.121:22 192.168.56.1:57497 ESTABLISHED 30280/sshd: ubu18 [ tcp6 0 0 :::2049 ::: LISTEN - tcp6 0 0 :::56867 ::: LISTEN 737/rpc.mountd tcp6 0 0 :::36335 ::: LISTEN 737/rpc.mountd tcp6 0 0 :::111 ::: LISTEN 409/rpcbind tcp6 0 0 fe80::d4f9:92ff:fe5a:53 ::: LISTEN 1211/dnsmasq tcp6 0 0 :::56373 ::: LISTEN 737/rpc.mountd tcp6 0 0 :::22 ::: LISTEN 742/sshd tcp6 0 0 :::35575 ::: LISTEN - tcp6 0 0 ::1:631 ::: LISTEN 602/cupsd tcp6 0 0 :::8443 :::* LISTEN 885/lxd ubu18@ubu18-VirtualBox:~/von-network$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ubu18@ubu18-VirtualBox:~/von-network$ cat /etc/os-release NAME="Ubuntu" VERSION="18.04.5 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.5 LTS" VERSION_ID="18.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic ubu18@ubu18-VirtualBox:~/von-network$
Is the host machine Ubuntu?
Windows10
Thanks a lot for helping me.
/Eduardo
Ok, you're dealing with known issues, read this; https://github.com/bcgov/von-network/issues/107
Hope that helps.
I think the issues are different. In #107, the module server.server is not encountered. You fixed this. It is not my case.
These instructions GENESIS_URL works fine. localhost:9000 is up and running well.
./manage build GENESIS_URL=https://raw.githubusercontent.com/sovrin-foundation/sovrin/master/sovrin/pool_transactions_sandbox_genesis ./manage start-web
It is not the case of GENESIS_FILE. GENESIS_FILE=/tmp/some-genesis.txt PORT=9000 python -m server.server
What results in: Traceback (most recent call last): File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/ubu18/von-network/server/server.py", line 14, in from .anchor import ( File "/home/ubu18/von-network/server/anchor.py", line 19, in from plenum.common.signer_simple import SimpleSigner ModuleNotFoundError: No module named 'plenum.common'
Notice that the script anchor.py declares "from plenum.common.signer simple import SimpleSigner". This´ never worked, because pip install indy-plenuym is faulty. Despite it is formalized in: https://pypi.org/project/indy-plenum/.
It is "faulty" because it depends on the library python-rocksdb, that looks faulty.
So, you should fix python library python-rocksdb (at least) and indy-plenum, so pip install should be working fine. Otherwise, statement with GENESIS_FILE will fail, at least in similar environment as mine. I don´t know, if in all cases. At least in Play with Docker, it works fine, apparently.
There seems to be some misunderstanding. You should not be trying to run von-network
directly on your machine (or vm) using commands like GENESIS_FILE=/tmp/some-genesis.txt PORT=9000 python -m server.server
, nor should you be using pip
to install any python packages in order to get von-network
to run. von-network
is designed to be run in a container has all of the code and dependencies already installed. That container is built using the ./manage build
command.
Typically running von-network
can be accomplished using just these steps:
1) clone the repository
2) cd into the main von-network folder
3) ./manage build
4) ./manage start --logs
Any issues from there are typically timing, docker environment, or docker networking related. Installing python packages using pip
will not help fix this process as the packages would be installed on the the machine running docker and not in the container(s) running von-network
.
Docker toolbox/Oracle VM Virtualbox add some additional layers of complexity that can get in the way. Have you tried using Docker Desktop on Windows 10? I use Docker Desktop on Windows 10 running using WSL2.
Yes. It might be my misunderstandings. The documentation would be a bit more clear, perhaps, but only as suggestion. Running on Windows10? Yes, I can try it. Thanks.
Good Morning Wade, Yes, I got it using Ubuntu 20.04 for Windows 10 Pro (I had to do upgrade from Windows home to Pro) .
See that running ports are accordingly to configuration: ubu20w@DESKTOP-CT0HBV1:~$ sudo netstat -antp | grep :9 tcp 0 0 0.0.0.0:9701 0.0.0.0: LISTEN 29619/docker-proxy tcp 0 0 0.0.0.0:9702 0.0.0.0: LISTEN 29578/docker-proxy tcp 0 0 0.0.0.0:9703 0.0.0.0: LISTEN 29425/docker-proxy tcp 0 0 0.0.0.0:9000 0.0.0.0: LISTEN 29439/docker-proxy tcp 0 0 0.0.0.0:9704 0.0.0.0: LISTEN 29411/docker-proxy tcp 0 0 0.0.0.0:9705 0.0.0.0: LISTEN 29397/docker-proxy tcp 0 0 0.0.0.0:9706 0.0.0.0: LISTEN 29382/docker-proxy tcp 0 0 0.0.0.0:9707 0.0.0.0: LISTEN 29540/docker-proxy tcp 0 0 0.0.0.0:9708 0.0.0.0:* LISTEN 29510/docker-proxy tcp 0 0 172.20.14.177:9701 172.19.0.5:37507 ESTABLISHED 29619/docker-proxy tcp 0 0 172.19.0.1:36086 172.19.0.3:9703 ESTABLISHED 29425/docker-proxy tcp 0 0 172.20.14.177:9701 172.19.0.3:38581 ESTABLISHED 29619/docker-proxy tcp 0 0 172.20.14.177:9703 172.19.0.5:42463 ESTABLISHED 29425/docker-proxy tcp 0 0 172.19.0.1:54578 172.19.0.2:9705 ESTABLISHED 29397/docker-proxy tcp 0 0 172.19.0.1:36088 172.19.0.3:9703 ESTABLISHED 29425/docker-proxy tcp 0 0 172.19.0.1:36108 172.19.0.3:9703 ESTABLISHED 29425/docker-proxy tcp 0 0 172.20.14.177:9705 172.19.0.3:42537 ESTABLISHED 29397/docker-proxy tcp 0 0 172.20.14.177:9703 172.19.0.6:42753 ESTABLISHED 29425/docker-proxy tcp 0 0 172.20.14.177:9705 172.19.0.5:44253 ESTABLISHED 29397/docker-proxy tcp 0 0 172.20.14.177:9707 172.19.0.2:42591 ESTABLISHED 29540/docker-proxy tcp 0 0 172.20.14.177:9703 172.19.0.2:32783 ESTABLISHED 29425/docker-proxy tcp 0 0 172.19.0.1:52558 172.19.0.5:9707 ESTABLISHED 29540/docker-proxy tcp 0 0 172.19.0.1:54590 172.19.0.2:9705 ESTABLISHED 29397/docker-proxy tcp 0 0 172.19.0.1:33830 172.19.0.6:9701 ESTABLISHED 29619/docker-proxy tcp 0 0 172.20.14.177:9701 172.19.0.2:42969 ESTABLISHED 29619/docker-proxy tcp 0 0 172.20.14.177:9707 172.19.0.3:46487 ESTABLISHED 29540/docker-proxy tcp 0 0 172.19.0.1:33848 172.19.0.6:9701 ESTABLISHED 29619/docker-proxy tcp 0 0 172.19.0.1:54558 172.19.0.2:9705 ESTABLISHED 29397/docker-proxy tcp 0 0 172.19.0.1:52550 172.19.0.5:9707 ESTABLISHED 29540/docker-proxy tcp 0 0 172.20.14.177:9707 172.19.0.6:37951 ESTABLISHED 29540/docker-proxy tcp 0 0 172.19.0.1:52554 172.19.0.5:9707 ESTABLISHED 29540/docker-proxy tcp 0 0 172.20.14.177:9705 172.19.0.6:36827 ESTABLISHED 29397/docker-proxy tcp 0 0 172.19.0.1:33826 172.19.0.6:9701 ESTABLISHED 29619/docker-proxy ubu20w@DESKTOP-CT0HBV1:~$
I took too long to understand that the fault was due to OS. Running Ubuntu on VB NOK, and running Ubuntu 20.04 on Windows WLS2 is OK.
It should be a good idea to let OS issue clear in documentation.
Thanks and have a good day.
/Eduardo
@edbkei, Great news. Would you like to submit a PR with your recommended updates to the documentation? We're always happy to have contributions.
Hi Wade,
No ideia how to submit a PR, If you explain me, I can try. I will be happy with that.
I have other concerns (e.g. doubts, questions, etc) and I am wondering if there is proper forums to participate. I am quite interested in generic use cases, room to clarify doubts, etc. Thanks for advicing me.
Regards
Eduardo
@edbkei,
Fork the repository into your GitHub account. Clone your Fork. Make the changes. Push to your fork Create a PR from your fork.
Sorry for the delayed reply.
I am getting the same error in Ubuntu 18.04, natively installed. @edbkei can you tell what was the solution here? I didn't get the solution from the discussion.
The solution in this case was switching from Docker toolbox/Oracle VM Virtualbox to Docker Desktop.
As suggested by Wade, by installing WSL2 on Windows10, and not using VB. But, installing WSL2 in Windows10 Home is not allowed, then I´ve bought license to upgrade to Windows 10 PRO. Then I´ve installed Ubuntu 20.04, and now it is working fine, and very stable.
I have the same error, plz help me to figure it out
I think you need to explain more about your configuration. If you are using VB, I suspect it might have an issue.
@edbkei Got the similar issue "Error initializing pool ledger"
I am running on virtual box -> ubuntu 18.04. Host machine -> windows 10 pro.
Is there no workaround to make von-network to run in Ubuntu 18.04( in VB).
I don´t know what happens when using VB, I´ve tried ubuntu 16.x-20.x. None of them works. I have an collegue that uses a machine with native Linux, also never faced this problem. As I said, I upgraded to Windows 10 PRO, installed WSL, then Ubuntu20.04. And, it works fine. There is, possibly, integration issue with VB.
This issue keeps happening. Now, I have a VM in University Labs Cloud and another VM in Google Cloud. In University, we use openstack, processor KVM, Ubuntu 20.04 LTS. The processor is different in Google Cloud, it is Intel (R) Xeon(R), 2200.206 MHz, Before both was up and running. Now, only Google Cloud works. After installing Hyperledger Fabric in University VM, NPM, LVM, something wrong started to happen. Local Ledger with von-network apparently works, but "Error initializing pool ledger" when http://xxx.xxx.xxx.xxx:9000 is issued at web browser. This not happen with LEDGER_URL=http://dev.greenlight.bcovrin.vonx.io ./run_demo, but the performance is low, compared with Google cloud VM. I increased the timeout RESYNC_TIME in anchor.py, but the result is the same. In the log, this is persistent:
node2_1 | 2022-04-12 18:17:24,454|INFO|ledger.py|Starting ledger... webserver_1 | 2022-04-12 18:17:29,098|WARNING|libindy.py|_indy_loop_callback: Function returned error webserver_1 | 2022-04-12 18:17:29,107|ERROR|anchor.py|Initialization error: webserver_1 | Traceback (most recent call last): webserver_1 | File "/home/indy/server/anchor.py", line 221, in _open_pool webserver_1 | self._pool = await pool.open_pool_ledger(pool_name, json.dumps(pool_cfg)) webserver_1 | File "/home/indy/.pyenv/versions/3.6.13/lib/python3.6/site-packages/indy/pool.py", line 88, in open_pool_ledger webserver_1 | open_pool_ledger.cb) webserver_1 | indy.error.PoolLedgerTimeout webserver_1 | webserver_1 | The above exception was the direct cause of the following exception: webserver_1 | webserver_1 | Traceback (most recent call last): webserver_1 | File "/home/indy/server/anchor.py", line 317, in open webserver_1 | await self._open_pool() webserver_1 | File "/home/indy/server/anchor.py", line 223, in _open_pool webserver_1 | raise AnchorException("Error opening pool ledger connection") from e webserver_1 | server.anchor.AnchorException: Error opening pool ledger connection webserver_1 | 2022-04-12 18:17:29,112|INFO|server.py|--- Trust anchor initialized --- node2_1 | 2022-04-12 18:17:30,737|INFO|ledger.py|Recovering tree from transaction log
From the log above the web server is starting before the nodes have finished initializing. You can adjust the delay of the web server in the docker-compose.yml
file; https://github.com/bcgov/von-network/blob/main/docker-compose.yml#L25. Change sleep 10;
to something like sleep 60;
and try again.
Once again, thanks. That´s it. In my case, I´ve changed to 240. Under 120, "Error initializing pool ledger", always. This might be my environment. Best Regards. /Eduardo
Faced the same issue due to timeout. Once all the nodes are running, then removed the webserver instance and executed ./manage start again to spin the webserver again. Worked perfectly on Mac M1.
ledger_error.txt