HelloZeroNet / HelloZeroNet/ZeroNet
UnboundLocalError: local variable 'err' referenced before assignment
- Ngôn ngữ chính
- JavaScript
- Star
- 18.8k
- Fork
- 2.3k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
### Step 1: Please describe your environment
* ZeroNet version: 0.7.2 r4555
* Operating system: Devuan Chimaera 4.0
* Web browser: Firefox ESC
* Tor status: enabled/available
* Opened port: yes
* Special configuration: `$ cat zeronet.conf
[global]
open_browser = False
threads_crypt = 3
threads_fs_write = 2
threads_fs_read = 4
language = en
fileserver_ip_type = ipv4`
### Step 2: Describe the problem: While running `siteVerify` on a large site, I get the said error message:
````
$ python3 ./core/zeronet.py siteVerify 1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT
- Starting ZeroNet...
PluginManager Plugin Bigfile load error: ModuleNotFoundError: No module named 'merkletools' in PluginManager.py line 138 > Bigfile/__init__.py line 1 > BigfilePlugin.py line 20
PluginManager Plugin CryptMessage load error: ModuleNotFoundError: No module named 'base58' in PluginManager.py line 138 > CryptMessage/__init__.py line 1 > CryptMessagePlugin.py line 7 > CryptBitcoin.py line 14 > lib/sslcrypto/__init__.py line 4 > lib/sslcrypto/openssl/__init__.py line 1 > lib/sslcrypto/openssl/aes.py line 4 > lib/sslcrypto/fallback/__init__.py line 2 > lib/sslcrypto/fallback/ecc.py line 4 > lib/sslcrypto/_ecc.py line 4
- Version: 0.7.2 r4555, Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110], Gevent: 22.10.2
SiteManager Loading sites... (cleanup: True, startup: False)
SiteManager Added 44 sites in 0.098s
Db#2:ContentDb Loaded 257792 optional files: 1191006.56MB, downloaded: 290.05MB in 0.464s
- Verifing site: 1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT...
- Verifing content.json signature...
- Unhandled exception: local variable 'err' referenced before assignment
Traceback (most recent call last):
File "/home/quix0r/ZeroNet-linux-dist-linux64/./core/zeronet.py", line 17, in main
main.start()
File "/home/quix0r/ZeroNet-linux-dist-linux64/core/src/main.py", line 602, in start
actions.call(config.action, action_kwargs)
File "/home/quix0r/ZeroNet-linux-dist-linux64/core/src/main.py", line 133, in call
back = func(**kwargs)
File "/home/quix0r/ZeroNet-linux-dist-linux64/core/src/main.py", line 263, in siteVerify
logging.error("[ERROR] %s: invalid file: %s!" % (content_inner_path, err))
UnboundLocalError: local variable 'err' referenced before assignment
````
PS: I had to install missing `gevent` through `pip` before. The version from my distribution is rather old (20.9.0-2 versus 22.10.2) or otherwise a simple `$ python3 ./core/zeronet.py --version` doesn't work.
#### Steps to reproduce:
1. Just execute the above command, or try an other site white ZeroNet is running.
#### Observed Results:
* I got the above error message.
#### Expected Results:
* The command runs through without any error messages.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Start in core/src/main.py at siteVerify, especially the logging statement on line 263 where the traceback reports the unbound err variable. Run the reported siteVerify command and inspect the surrounding verification path and its error handling. Done means the command no longer raises UnboundLocalError and reports verification failures without crashing.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- cli
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100