ZeroNetX / ZeroNet

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

Unhandled exception: AttributeError: 'FileServer' object has no attribute 'getSites' #131

Closed rex4539 closed 2 years ago

rex4539 commented 2 years ago

py3-internal branch

Unhandled exception: AttributeError: 'FileServer' object has no attribute 'getSites' in <gevent>/greenlet.py line 906 > ChartCollector.py line 171 > 30
Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 906, in gevent._gevent_cgreenlet.Greenlet.run
  File "/Users/rex/ZeroNet/plugins/Chart/ChartCollector.py", line 171, in collector
    collectors = self.getCollectors()
  File "/Users/rex/ZeroNet/plugins/Chart/ChartCollector.py", line 30, in getCollectors
    sites = file_server.getSites()
AttributeError: 'FileServer' object has no attribute 'getSites'
canewsin commented 2 years ago

it might be zeronet-enhanced branch, because getSites not exists in internal-branch code yet https://github.com/ZeroNetX/ZeroNet-Plugins/blob/7bb1715ce030352ff46ddd43ad58b7ab90ef978b/Chart/ChartCollector.py#L171

rex4539 commented 2 years ago

I have gone back and forth between those branches quite a bit.

Is there a chance there are stuff written while on zeronet-enhanced branch that later persist when I switch to py3-internal?

canewsin commented 2 years ago

since plugins folder is submodule, you have to switch that too to zeronet-enchanced

canewsin commented 2 years ago

or master branch if you want py3-internal of ZeroNetX

slrslr commented 2 years ago

since plugins folder is submodule, you have to switch that too to zeronet-enchanced

maybe asking too much, but can be handy if someone mention Linux commands to

  1. git clone zn repo+plugin repo and command to make sure i am on main or enhanced branch
  2. commands to update local from github (main + plugins, correct branch)
  3. how to switch branch maybe here or README.

I am asking because i have reported several bugs from enhanced branch yet as user not knowing right git commands i usually end up with fail launching ZN eventualy need to manually delete folder, download everything (git clone --recursive) and copy my zeronet.conf and data folder which is annoying to do on every update.

canewsin commented 2 years ago

I recommend to have separate dir for ZeroNetData.

git status will give you branch name and some info

git pull updates your local repo with new changes

git checkout "BRANCH NAME" changes branch to "BRANCH NAME"

PS : I Pushed some plugin changes now, could you test them ?

rex4539 commented 2 years ago

The zeronet-enhanced branch is unusable for me.

Thousands of errors and constantly failing to update sites, checking fails, verification fails.

The py3-internal branch works like a charm.

canewsin commented 2 years ago

are main repo and plugin repo have same branch names ? i.e zeronet-enhanced

rex4539 commented 2 years ago
% git status          
On branch zeronet-enhanced
Your branch is up to date with 'origin/zeronet-enhanced'.
% git submodule status
 585d1c91bdda4aa92d057b396c38895a3644ccce plugins (remotes/origin/zeronet-enchanced)
canewsin commented 2 years ago

could you provide full error log.

rex4539 commented 2 years ago

Sure, let me do a fresh run and I'll attach them here.

slrslr commented 2 years ago

I have it different from rex4539. Can i ask how to set submodule branch to zeronet-enhanced please? If i have it wrong?:

$ git status
On branch zeronet-enhanced

$ git submodule set-branch --branch zeronet-enhanced plugins

$ git submodule status plugins
+61c87e86f96559f39da92d2543cef0699963d477 plugins (heads/master-7-g61c87e8)

UPDATE: after "git pull" it changed to "585d1c91bdda4aa92d057b396c38895a3644ccce plugins (remotes/origin/zeronet-enchanced)"

rex4539 commented 2 years ago

zeronet-enhanced.log.zip

canewsin commented 2 years ago

Are these files exists on your client with error verify error: VerifyError ?

rex4539 commented 2 years ago

Nope

canewsin commented 2 years ago

so all those errors are related to missing files in that case, is it ?

rex4539 commented 2 years ago

The directories don't even exist, not just the content.json

I'm assuming those must be sites I visited once upon a time and then deleted. But somehow this branch likes to still search for them...

By the way, this is just one type of the errors.

In this branch, I have never been able to update all sites. There are always errors updating various sites.

canewsin commented 2 years ago

Ok I will patch it soon

slrslr commented 2 years ago

Error reported in initial post also appears to me in py3-internal with plugins set as:

$ git submodule +585d1c91bdda4aa92d057b396c38895a3644ccce plugins (remotes/origin/zeronet-enchanced)

which is possibly wrong (ZN py3-internal and plugins enhanced branch). So i did:

$ git submodule update Submodule path 'plugins': checked out 'd3cbe172712951f43bb6589e92e9e9eeb86c3172'

$ git submodule d3cbe172712951f43bb6589e92e9e9eeb86c3172 plugins (remotes/origin/HEAD)

$ git pull Already up to date.

and launched ZN. This time i do not see that error, but i do not know what trigger it in order to be sure. So this issue MAY be just mismatch described. I would be interested if @rex4539 can verify what i did and try to reproduce.