ZeroNetX / ZeroNet

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

ZeroNetX enhanced branch: Unhandled exception: FileNotFoundError: [Errno 2] content.json' in <gevent>/threadpool.py line 167 > SiteStorage.py line 391 > 277 #128

Closed slrslr closed 2 years ago

slrslr commented 2 years ago

Hi, in recent ZNE branch of ZeronetX when saving site description, title from site side menu (button in corner) i have seen following:

[00:14:17] - Unhandled exception: FileNotFoundError: [Errno 2] No such file or directory: './data/17wJpDZK6eLKPNwBAcFmYPyEUeTdrMaEeB/data/users/17bYaJETQ6d72PKvUzo6ZpcwJyVW6xWtmV/content.json' in <gevent>/threadpool.py line 167 > SiteStorage.py line 391 > 277
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/gevent/threadpool.py", line 167, in __run_task
    thread_result.set(func(*args, **kwargs))
  File "/home/user/zeronet/src/Site/SiteStorage.py", line 391, in loadJson
    with self.open(inner_path, "r", encoding="utf8") as file:
  File "/home/user/zeronet/src/Site/SiteStorage.py", line 277, in open
    return open(file_path, mode, **kwargs)
FileNotFoundError: [Errno 2] No such file or directory: './data/17wJpDZK6eLKPNwBAcFmYPyEUeTdrMaEeB/data/users/17bYaJETQ6d72PKvUzo6ZpcwJyVW6xWtmV/content.json'

if you do any fix attempt, let me know and i will try to update and try to reproduce it again

canewsin commented 2 years ago

try now https://github.com/ZeroNetX/ZeroNet/commit/5e61fe8b0698c7afaf0a681609447571d2e3bc5e

slrslr commented 2 years ago

Thank you, now the error upon saving that site title/description or even upon opening site's side menu (corner button) is:

Site:17wJpD..aEeB Json load error: FileNotFoundError: [Errno 2] No such file or directory: './data/17wJpDZK6eLKPNwBAcFmYPyEUeTdrMaEeB/data/users/17bYaJETQ6d72PKvUzo6ZpcwJyVW6xWtmV/content.json' in SiteStorage.py line 392 > 277

that file indeed does not exist, inside that data/users is no folder only content.json I do not know whether this is normal or ZN bug.

canewsin commented 2 years ago

Those both are same errors but new one is handled compared to prev unhandled error. We cannot suppress it, as it may be essential in some cases.

slrslr commented 2 years ago

Btw., anyone knows why that error is there while that site directory files does not contain 17bYaJETQ6d72PKvUzo6ZpcwJyVW6xWtmV nor any file name in that site files contains it nor main content.db contains it. Actually no file/directory on my drives contains that phrase in its name. 🤔

slrslr commented 2 years ago

I no longer see the error now, so i will close this.

canewsin commented 2 years ago

Possible case might be user is muted via blocklist, at initial stages his data might not reach most users or he himself remove data on his own failed to sign and publish data to network.

slrslr commented 2 years ago

I have attempted to update zeronetx zne branch (git pull), launch download of a new site and this site reports following errors which is a bit strange to me @canewsin

[21:07:41] Site:1JjXZn..kG4m Json load error: FileNotFoundError: [Errno 2] No such file or directory: './data/1JjXZnEKKm7sLpFj3J7DiSRBLnjMVkkG4m/data/users/1HGiNSHwxEMyh5XPP22V3PFAK6RXHkQKq8/content.json' in SiteStorage.py line 392 > 277
[21:07:43] Site:1JjXZn..kG4m Json load error: FileNotFoundError: [Errno 2] No such file or directory: './data/1JjXZnEKKm7sLpFj3J7DiSRBLnjMVkkG4m/data/users/1HGiNSHwxEMyh5XPP22V3PFAK6RXHkQKq8/content.json' in SiteStorage.py line 392 > 277

i am reporting it here since the lines in SiteStorage.py are similar to what is described in this issue.

canewsin commented 2 years ago

This is site issue, But I will take note of it for future reference for better dealing missing files.