HelloZeroNet / HelloZeroNet/ZeroNet

KeyError - sidebarGetHtmlTag - SidebarPlugin.py

未关闭
#1,935 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
JavaScript
星标
18.8k
派生
2.3k
PR 合并指标
30 天内没有已合并 PR

描述

### Step 1: Please describe your environment

* ZeroNet version: 3853
* Operating system: W10
* Web browser: Firefox
* Tor status: available
* Opened port: no
* Special configuration: multiuser_local

### Step 2: Describe the problem:

Hello, i visited a hub zite several times in last days and its zeronet menu (corner button) shows nothing in the menu, only black and debug.log shows this site relevant entry:

> ERROR Site:abc..def WebSocket handleRequest error: KeyError: u'folder/subfolder /content.json' in UiWebsocket.py line 83 > UiWebsocket.py line 267 > SidebarPlugin.py line 531 > SidebarPlugin.py line 196 > ContentManager.py line 322 > ContentManager.py line 322 > ContentManager.py line 320 > ContentDbDict.py line 61 > ContentDbDict.py line 34
{"cmd":"sidebarGetHtmlTag","params":{},"id":1000002}

(subfolder name contains ":" and there is space at the end. I checked and that folder does not exist on my end.

When i deleted site and opened again, menu started opening. If anyone interested here how i deleted the site while preserving all optional files i downloaded:

> 1. I backed up "folder"
> 2. deleted site
> 3. visited site
> 4. copied back "folder" (and skipped files that existed on newly downloaded site)
> 5. on ZeroHello i "Check files" of that site
> 6. site menu now opens

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 SidebarPlugin.py 中的 sidebarGetHtmlTag 请求开始,然后沿着 traceback 依次检查 UiWebsocket.py 和 ContentManager.py,直到 ContentDbDict.py 中的查找逻辑。复现文件夹/子文件夹 content.json 格式错误的情况,并确定缺失的键是如何传递到侧边栏的。对于所报告的站点状态,侧边栏菜单能够在不出现此 KeyError 的情况下打开,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。