ValueError: list.remove(x): x not in list

未关闭
#7 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
python

调研方向

从 /shared/letsencrypt/hook_script.py 中的 clean_challenge 和第 62 行开始,然后重现涉及两个 challenge token 的完整日志序列。比较 ACME response 记录的 token 与放置在 challenge iRule 中的 token,并在每次 cleanup 前检查 virtual server 的规则。当 challenge response 成功且 cleanup 完成时没有出现 list.remove 错误,即表示完成。

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

描述

I figure we'll start with what I believe is the main error and everything I'm using is what you have as current from March 21st :)

File "/shared/letsencrypt/hook_script.py", line 62, in clean_challenge
vip.properties['rules'].remove('/Common/le_challenge_rule')
ValueError: list.remove(x): x not in list
ERROR: clean_challenge hook returned with non-zero exit code

I see the files created on my Apache server using "watch ls" since it creates then removes them quickly. They did happen so that's working.
The iRule fails to delete per the error and it remains on the box. I've deleted it manually and re-run various times trying various things and still no luck.
I've commented out a few sections of the hook script and it still fails but it gives some insight. I'm not going to explain that now unless ya'll ask.

The other thing I'm seeing but this might be the issue w/ the iRule deletion failure.
The tokens seem to mismatch from what's in the log in the CLI vs. the token stored in the challenge iRule.
I can share most anything since this is my personal web server/F5.
Thoughts?

Here's a full log example below:

INFO: Using main config file /shared/letsencrypt/config
Processing projectbaiu.org with alternative names: www.projectbaiu.org

Signing domains...
Generating private key...
Generating signing request...
Requesting new certificate order from CA...
Received 2 authorizations URLs from the CA
Handling authorization for www.projectbaiu.org
Handling authorization for projectbaiu.org
2 pending challenge(s)
Deploying challenge tokens...
(hook) Deploying Challenge
(hook) Challenge rule added to virtual.
(hook) Deploying Challenge
(hook) Challenge rule added to virtual.
Responding to challenge for www.projectbaiu.org authorization...
(hook) Invalid Challenge
(hook) Invalid Challenge Args: ['www.projectbaiu.org', '["type"]\t"http-01"\n["status"]\t"invalid"\n["error","type"]\t"urn:ietf:params:acme:error:unauthorized"\n["error","detail"]\t"63.226.21.50: Invalid response from http://www.projectbaiu.org/.well-known/acme-challenge/oQL3Lr39uV-G-Bp4xq54VG4OQD7sexwc1uV2DmWsXHQ: 404"\n["error","status"]\t403\n["error"]\t{"type":"urn:ietf:params:acme:error:unauthorized","detail":"63.226.21.50: Invalid response from http://www.projectbaiu.org/.well-known/acme-challenge/oQL3Lr39uV-G-Bp4xq54VG4OQD7sexwc1uV2DmWsXHQ: 404","status":403}\n["url"]\t"https://acme-staging-v02.api.letsencrypt.org/acme/chall-v3/2306706054/wc9l2A"\n["token"]\t"oQL3Lr39uV-G-Bp4xq54VG4OQD7sexwc1uV2DmWsXHQ"\n["validationRecord",0,"url"]\t"http://www.projectbaiu.org/.well-known/acme-challenge/oQL3Lr39uV-G-Bp4xq54VG4OQD7sexwc1uV2DmWsXHQ"\n["validationRecord",0,"hostname"]\t"www.projectbaiu.org"\n["validationRecord",0,"port"]\t"80"\n["validationRecord",0,"addressesResolved",0]\t"63.226.21.50"\n["validationRecord",0,"addressesResolved"]\t["63.226.21.50"]\n["validationRecord",0,"addressUsed"]\t"63.226.21.50"\n["validationRecord",0]\t{"url":"http://www.projectbaiu.org/.well-known/acme-challenge/oQL3Lr39uV-G-Bp4xq54VG4OQD7sexwc1uV2DmWsXHQ","hostname":"www.projectbaiu.org","port":"80","addressesResolved":["63.226.21.50"],"addressUsed":"63.226.21.50"}\n["validationRecord"]\t[{"url":"http://www.projectbaiu.org/.well-known/acme-challenge/oQL3Lr39uV-G-Bp4xq54VG4OQD7sexwc1uV2DmWsXHQ","hostname":"www.projectbaiu.org","port":"80","addressesResolved":["63.226.21.50"],"addressUsed":"63.226.21.50"}]\n["validated"]\t"2022-04-28T17:12:46Z"']
Cleaning challenge tokens...
(hook) Cleaning Challenge
(hook) Challenge rule removed from virtual.
(hook) Cleaning Challenge
Traceback (most recent call last):
File "/shared/letsencrypt/hook_script.py", line 120, in
clean_challenge(sys.argv[2:])
File "/shared/letsencrypt/hook_script.py", line 62, in clean_challenge
vip.properties['rules'].remove('/Common/le_challenge_rule')
ValueError: list.remove(x): x not in list
ERROR: clean_challenge hook returned with non-zero exit code

主要语言
Shell
星标
50
派生
12
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

f5devcentral/lets-encrypt-python 的其他 Issue

查看 f5devcentral/lets-encrypt-python 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

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