ZeroNetX / ZeroNet

ZeroNetX - Decentralized websites using Bitcoin crypto and BitTorrent network
https://zeronet.dev
Other
225 stars 32 forks source link

"git checkout zeronet-enhanced" not works #120

Closed slrslr closed 2 years ago

slrslr commented 2 years ago

I have deleted my orignal zeronet directory (having backup) git clone --recursive

cd into zeronet directory and run:

git checkout zeronet-enhanced

Branch 'zeronet-enhanced' set up to track remote branch 'zeronet-enhanced' from 'origin'.
Switched to a new branch 'zeronet-enhanced'

$ python3 zeronet.py

- Starting ZeroNet...
[14:43:00] - Unhandled exception: expected str, bytes or os.PathLike object, not NoneType
Traceback (most recent call last):
  File "/home/user/apps/zeronet/zeronet.py", line 16, in main
    import main
  File "/home/user/apps/zeronet/src/main.py", line 75, in <module>
    from Plugin import PluginManager
  File "/home/user/apps/zeronet/src/Plugin/PluginManager.py", line 211, in <module>
    plugin_manager = PluginManager()  # Singletone
  File "/home/user/apps/zeronet/src/Plugin/PluginManager.py", line 19, in __init__
    self.path_plugins = os.path.abspath(os.path.dirname(plugins.__file__))
  File "/usr/lib/python3.10/posixpath.py", line 152, in dirname
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType
---
Please report it: https://github.com/HelloZeroNet/ZeroNet/issues/new?assignees=&labels=&template=bug-report.md

$ git checkout py3-internal

Previous HEAD position was 0bbf19aa Update Donation Link
Branch 'py3-internal' set up to track remote branch 'py3-internal' from 'origin'.
Switched to a new branch 'py3-internal'

$ python3 zeronet.py --version ..similar error...

$ git checkout master

warning: unable to rmdir 'plugins': Directory not empty
Branch 'master' set up to track remote branch 'master' from 'origin'.
Switched to a new branch 'master'

$ python3 zeronet.py --version

  File "/home/user/apps/zeronet/zeronet.py", line 10
    print "- Starting ZeroNet..."
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

$ git checkout py3-latest

Switched to branch 'py3-latest'
Your branch is up to date with 'origin/py3-latest'.

$ python3 zeronet.py --version

- Starting ZeroNet...
- Libsecpk256k1 loaded: Lib in 0.045s
ZeroNet 0.7.5 r4560

So it is weird somehow zeronet enhanced thing does not work. What to try?

canewsin commented 2 years ago

Unhandled exception: expected str, bytes or os.PathLike object, not NoneType

Happens when plugins dir missing.

canewsin commented 2 years ago

git clone --recursive doesn't work here because master branch has still doesn't has submodule.

first checkout zeronet-enhanced branch

delete `plugins' dir if exists.

then

git submodule init && git submodule update

slrslr commented 2 years ago

$ cd zeronet $ git checkout zeronet-enhanced

M   plugins
Switched to branch 'zeronet-enhanced'
Your branch is up to date with 'origin/zeronet-enhanced'.

$ rm -rf plugins $ git submodule init && git submodule update Submodule path 'plugins': checked out '9cadd0c69f5af06739cc34cc79dc650053a9b4bd'

$ ./zeronet.py

...
[21:13:06] - Unhandled exception: AttributeError: 'ContentDb' object has no attribute 'getSites' in <gevent>/greenlet.py line 906 > SiteManager.py line 223 > ContentFilterPlugin.py line 43 > SiteManager.py line 205 > Site.py line 221 > ContentManager.py line 55 > PeerDbPlugin.py line 91 > OptionalManager/ContentDbPlugin.py line 60 > ContentDb.py line 85
Traceback (most recent call last):
...

... SAME ERROR REPEATED MANY TIMES...

[21:13:06] - Unhandled exception: 'ContentDb' object has no attribute 'getSites'
...

what to try please?

canewsin commented 2 years ago

what is output of git log ?

git log

slrslr commented 2 years ago

On the top is this...

canewsin commented 2 years ago

tried ?

git submodule update

slrslr commented 2 years ago

Yes, as shown in the output in this comment above. I have tried again, output is empty. Nothing...

canewsin commented 2 years ago

okay found a bug

canewsin commented 2 years ago

Open src/Content/ContentDb.py and replace line 85 : with this self.sites[site.address] = site line 100: with this del self.sites[site.address]

maintain spacing

canewsin commented 2 years ago

report results

slrslr commented 2 years ago

I have updated these files as instructed and ran ZN. Result:

[21:38:16] - Unhandled exception: inconsistent use of tabs and spaces in indentation (ContentDb.py, line 85)

i will show you that file content.. in a minute

canewsin commented 2 years ago

inconsistent use of tabs and spaces in indentation (ContentDb.py, line 85)

This will happen if you use spaces instead of tabs viceversa only modify text there or wait for chages, i will push in a minute

canewsin commented 2 years ago

see the difference dotted lines and arrows in line 100 and 85 they are different

slrslr commented 2 years ago

I'm sorry, notepadqq shows "This file is indented with spaces, but your current settings specify to use tabs", on above image the arrows are tabs and dots are spaces... i have tried to paste the code from github repository manually and now shows different error (due to no plugins dir.?) Maybe i should start by removing the zeronet directory and clone again?

canewsin commented 2 years ago

wait i will push some changes

canewsin commented 2 years ago

git reset --hard 36adb63f6129d1c89a80c801219244a82926d726

then

git pull git submodule update

canewsin commented 2 years ago

Any Success ?

slrslr commented 2 years ago

yes, that apparently worked and ZN is starting. Looks like it is rebuilding content.db or something, so it can take some time. Then it returned errors, please check here

canewsin commented 2 years ago

I will be back with bug fixes

canewsin commented 2 years ago

try now

canewsin commented 2 years ago

git reset --hard 36adb63

then

git pull git submodule update

follow this

slrslr commented 2 years ago

yes, it worked, ZN started without errors :)

I see that the log shows new kind of messages:

[22:29:26] Db#2:ContentDb Loaded ...
[22:29:27] FileServer passive mode is OFF
[22:29:27] FileServer active mode is ON
[22:29:27] FileServer keepAliveThread started
[22:29:27] FileServer wakeupWatcherThread started
[22:29:27] FileServer sitesVerificationThread started
[22:29:27] FileServer reloadTrackerFilesThread started
[22:29:27] FileServer sitesMaintenanceThread(full) started
[22:29:27] FileServer sitesMaintenanceThread(short) started
[22:29:27] FileServer updateSites [#1]: started
[22:29:27] FileServer Server port opened based on configuration ipv4:
...
22:31:33] FileServer running <update> for 1fzncz..csTD
[22:31:34] Site:1SunAW..JN9a CheckModification

ZN works, publishing to 10 peers instead of 5

and seen some errors:

[22:32:58] Ui.UiServer Error 500: UiWSGIHandler error: AttributeError: 'UiServer' object has no attribute 'getSites'

[22:33:13] ConnServer GetFile exception: AttributeError: 'NoneType' object has no attribute 'write' in FileRequest.py line 250 > 46 > Connection.py line 599 > <gevent>/_ssl3.py line 537 > ...

[22:33:14] Site:1HELLo..Ri9d WebSocket handleRequest error: AttributeError: 'UiServer' object has no attribute 'getSites' in UiWebsocket.py line 80 > 238 > UiPluginManagerPlugin.py line 88 
 {"cmd":"pluginList","params":[],"wrapper_nonce":"....anon...","id":3}

the last error seems to be tied to opening http://127.0.0.1:43110/Plugins/ which does not show any plugins and indeed my ZN is missing plugins directory (was instructed to delete it).

canewsin commented 2 years ago

fIXED

canewsin commented 2 years ago

after deleting plugins you have to invoke

git submodule init git submodule update

slrslr commented 2 years ago

Thank you, i will try, yet on merger site like peeper is error:

Internal error: AttributeError("'UiServer' object has no attribute 'getSites'"): 'UiServer' object has no attribute 'getSites'
UiWebsocket.py line 190 > MergerSitePlugin.py line 159 > 144

on gitcenter i have seen:

[22:59:05] Site:1GitLi..MQ4t WebSocket handleRequest error: AttributeError: 'UiServer' object has no attribute 'getSites' in UiWebsocket.py line 80 > 238 > MergerSitePlugin.py line 118 
 {"cmd":"mergerSiteList","params":[true],"wrapper_nonce":"...anon...","id":2}

but maybe that is fixed by you already, i will try to git pull, update, but when i try to quit ZN from dashboard/zerohello, it says:

[23:02:33] Site:1HELLo..Ri9d WebSocket handleRequest error: TypeError: FileServerPlugin.stop() got an unexpected keyword argument 'ui_websocket' in UiWebsocket.py line 80 > 216 > 342 > 1204 
 {"cmd":"response","to":24321,"result":1,"id":1000003}

so i guess i will terminate it

canewsin commented 2 years ago

plugin changes are yet to be merged from ze version so this error occured while shutting down.

slrslr commented 2 years ago

I have updated from ZNE branch

#!/bin/bash
cd ~/zeronet/||exit
rm -rf plugins
git reset --hard 36adb63
git pull
git submodule init
git submodule update
./zeronet.py --version

and errors was fixed. I have also seen a few of these errors: ...removed and moved to separate issues...

Should i continue reporting these errors in ZNE branch? or move to main branch?

canewsin commented 2 years ago

Close this issue and open new issue with errors you have.