HelloZeroNet / HelloZeroNet/ZeroNet

UnboundLocalError: local variable 'err' referenced before assignment

オープン
#2,824 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
18.8k
フォーク
2.3k
PR マージ指標
30日以内にマージされた PR はありません

説明

### 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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
cli
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。