dashpay / sentinel

DashCore Sentinel Engine
https://www.dash.org
MIT License
32 stars 193 forks source link

sentinel runs error #108

Closed lcgogo closed 2 years ago

lcgogo commented 2 years ago
Traceback (most recent call last):
  File "bin/sentinel.py", line 5, in <module>
    import init
  File "/root/dash-sentinel-6/lib/init.py", line 112, in <module>
    main()
  File "/root/dash-sentinel-6/lib/init.py", line 99, in main
    if not is_database_correctly_configured():
  File "/root/dash-sentinel-6/lib/init.py", line 48, in is_database_correctly_configured
    db.connect(reuse_if_open=True)
TypeError: connect() got an unexpected keyword argument 'reuse_if_open'
lcgogo commented 2 years ago

@PastaPastaPasta Need some help.

nmarley commented 2 years ago

@lcgogo What version of Python are you running and what git commit are you on? Can you share the exact command you are running to get this error, and your OS and version?

lcgogo commented 2 years ago

@lcgogo What version of Python are you running and what git commit are you on? Can you share the exact command you are running to get this error, and your OS and version?

root@iZbp17v35sjxeflcl9419zZ:~# cd /root/dash-sentinel-1 && ./venv/bin/python --version
Python 3.8.10
root@iZbp17v35sjxeflcl9419zZ:~/dash-sentinel-1# cd /root/dash-sentinel-6 && ./venv/bin/python bin/sentinel.py
Traceback (most recent call last):
  File "bin/sentinel.py", line 5, in <module>
    import init
  File "/root/dash-sentinel-6/lib/init.py", line 112, in <module>
    main()
  File "/root/dash-sentinel-6/lib/init.py", line 99, in main
    if not is_database_correctly_configured():
  File "/root/dash-sentinel-6/lib/init.py", line 48, in is_database_correctly_configured
    db.connect(reuse_if_open=True)
TypeError: connect() got an unexpected keyword argument 'reuse_if_open'
root@iZbp17v35sjxeflcl9419zZ:~/dash-sentinel-6# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.2 LTS"
nmarley commented 2 years ago

Thanks for the info. I'm still not sure what git commit you are on for the Sentinel repo, and not sure what is in /root/dash-sentinel-1 or /root/dash-sentinel-6. Why the different versions? Is the Python version in /root/dash-sentinel-6 different from the one in /root/dash-sentinel-1? I can't tell from your output above.

lcgogo commented 2 years ago

I run multi dash nodes in one host, so use /root/dash-sentinel-1(2,3,4...) for them.

I use the latest commit except add sentinel.conf.

root@iZbp17v35sjxeflcl9419zZ:~/dash-sentinel-6# git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   sentinel.conf

no changes added to commit (use "git add" and/or "git commit -a")
root@iZbp17v35sjxeflcl9419zZ:~/dash-sentinel-6# git log --oneline
4ced483 (HEAD -> master, tag: v1.7.1, origin/master, origin/develop, origin/HEAD) chore: bump sentinel version (#107)
5989c34 Add p2sh support in superblocks (#106)
0e3ea75 (tag: v1.7.0) chore: bump sentinel version (#104)
72e5a73 ci: python 3.10 updates and tidy up (#103)
fa50bc1 Remove Sentinel network variable (#102)
nmarley commented 2 years ago

Thanks. Looks like you might have an old version of Peewee. Did you update the dependencies per the install instructions here?

https://github.com/dashpay/sentinel/blob/4ced4833ee3374e76e71a0d0a6359b5180c0e761/README.md#install-sentinel

Specifically this line: ./venv/bin/pip install -r requirements.txt

Could you run that and see if it fixes the problem? You'll have to run that for each separate Sentinel directory.

lcgogo commented 2 years ago

Thanks. Looks like you might have an old version of Peewee. Did you update the dependencies per the install instructions here?

https://github.com/dashpay/sentinel/blob/4ced4833ee3374e76e71a0d0a6359b5180c0e761/README.md#install-sentinel

Specifically this line: ./venv/bin/pip install -r requirements.txt

Could you run that and see if it fixes the problem? You'll have to run that for each separate Sentinel directory.

Did it, but the error is same.

root@iZbp17v35sjxeflcl9419zZ:~/dash-sentinel-6# ./venv/bin/pip install -r requirements.txt

Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Requirement already satisfied: deprecation==2.1.0 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from -r requirements.txt (line 1)) (2.1.0)
Requirement already satisfied: packaging==21.3 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from -r requirements.txt (line 2)) (21.3)
Requirement already satisfied: peewee==3.14.10 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from -r requirements.txt (line 3)) (3.14.10)
Requirement already satisfied: py==1.10.0 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from -r requirements.txt (line 4)) (1.10.0)
Requirement already satisfied: pycodestyle==2.4.0 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from -r requirements.txt (line 5)) (2.4.0)
Requirement already satisfied: pytest==7.0.1 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from -r requirements.txt (line 6)) (7.0.1)
Requirement already satisfied: pyparsing==3.0.9 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from -r requirements.txt (line 7)) (3.0.9)
Requirement already satisfied: python-bitcoinrpc==1.0 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from -r requirements.txt (line 8)) (1.0)
Requirement already satisfied: simplejson==3.8.2 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from -r requirements.txt (line 9)) (3.8.2)
Requirement already satisfied: tomli>=1.0.0 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from pytest==7.0.1->-r requirements.txt (line 6)) (2.0.1)
Requirement already satisfied: iniconfig in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from pytest==7.0.1->-r requirements.txt (line 6)) (1.1.1)
Requirement already satisfied: pluggy<2.0,>=0.12 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from pytest==7.0.1->-r requirements.txt (line 6)) (1.0.0)
Requirement already satisfied: attrs>=19.2.0 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from pytest==7.0.1->-r requirements.txt (line 6)) (22.1.0)
root@iZbp17v35sjxeflcl9419zZ:~/dash-sentinel-6#
root@iZbp17v35sjxeflcl9419zZ:~/dash-sentinel-6#
root@iZbp17v35sjxeflcl9419zZ:~/dash-sentinel-6# ./venv/bin/python bin/sentinel.py
Traceback (most recent call last):
  File "bin/sentinel.py", line 5, in <module>
    import init
  File "/root/dash-sentinel-6/lib/init.py", line 112, in <module>
    main()
  File "/root/dash-sentinel-6/lib/init.py", line 99, in main
    if not is_database_correctly_configured():
  File "/root/dash-sentinel-6/lib/init.py", line 48, in is_database_correctly_configured
    db.connect(reuse_if_open=True)
TypeError: connect() got an unexpected keyword argument 'reuse_if_open'
root@iZbp17v35sjxeflcl9419zZ:~/dash-sentinel-6#
root@iZbp17v35sjxeflcl9419zZ:~/dash-sentinel-6# cat requirements.txt
deprecation==2.1.0
packaging==21.3
peewee==3.14.10
py==1.10.0
pycodestyle==2.4.0
pytest==7.0.1
pyparsing==3.0.9
python-bitcoinrpc==1.0
simplejson==3.8.2
lcgogo commented 2 years ago

@nmarley Can you give more suggestion? Now all my dash node are offline.

nmarley commented 2 years ago

@lcgogo Sure. It looks strange to me that your output from pip install in dash-sentinel-6 is showing things installed in root/dash-sentinel-1, e.g.:

root@iZbp17v35sjxeflcl9419zZ:~/dash-sentinel-6# ./venv/bin/pip install -r requirements.txt

Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Requirement already satisfied: deprecation==2.1.0 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from -r requirements.txt (line 1)) (2.1.0)
Requirement already satisfied: packaging==21.3 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from -r requirements.txt (line 2)) (21.3)
Requirement already satisfied: peewee==3.14.10 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from -r requirements.txt (line 3)) (3.14.10)

Not sure if you are symlinking things around or what. My advice would be to completely remove your virtualenv and re-initialize it, and not try to symlink things if that is what is going on. Again, it's really strange to see this output above where you are installing in dash-sentinel-6 but then the output is saying you have things already installed in dash-sentinel-1/venv/....

So, try something like this, and it should hopefully be a cleaner install:

cd /root/dash-sentinel-6
rm -fr venv

virtualenv -p $(which python3) ./venv
./venv/bin/pip install -r requirements.txt

If that works for dash-sentinel-6, then you can repeat for all the installations. But something is wrong with your current setup as-is, from what I see in the output above. Somehow your different versions are getting mixed together and that's not good. One of them seems to have an outdated version of peewee, causing this error.

lcgogo commented 2 years ago

@lcgogo Sure. It looks strange to me that your output from pip install in dash-sentinel-6 is showing things installed in root/dash-sentinel-1, e.g.:

root@iZbp17v35sjxeflcl9419zZ:~/dash-sentinel-6# ./venv/bin/pip install -r requirements.txt

Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Requirement already satisfied: deprecation==2.1.0 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from -r requirements.txt (line 1)) (2.1.0)
Requirement already satisfied: packaging==21.3 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from -r requirements.txt (line 2)) (21.3)
Requirement already satisfied: peewee==3.14.10 in /root/dash-sentinel-1/venv/lib/python3.8/site-packages (from -r requirements.txt (line 3)) (3.14.10)

Not sure if you are symlinking things around or what. My advice would be to completely remove your virtualenv and re-initialize it, and not try to symlink things if that is what is going on. Again, it's really strange to see this output above where you are installing in dash-sentinel-6 but then the output is saying you have things already installed in dash-sentinel-1/venv/....

So, try something like this, and it should hopefully be a cleaner install:

cd /root/dash-sentinel-6
rm -fr venv

virtualenv -p $(which python3) ./venv
./venv/bin/pip install -r requirements.txt

If that works for dash-sentinel-6, then you can repeat for all the installations. But something is wrong with your current setup as-is, from what I see in the output above. Somehow your different versions are getting mixed together and that's not good. One of them seems to have an outdated version of peewee, causing this error.

Thanks. It works for me now!