[GH-ISSUE #1137] [Bug] 版本升级后已有有效证书却重复申请 #769

Closed
opened 2026-03-03 01:05:51 +03:00 by kerem · 17 comments
Owner

Originally created by @KudaYoung on GitHub (Jan 1, 2026).
Original GitHub issue: https://github.com/certimate-go/certimate/issues/1137

Release Version / 软件版本

v0.4.12

Description / 缺陷描述

已有同一个工作流之前申请的证书,有效时间还有80天,但是今天早上定时执行工作流时日志显示没找到证书,重新申请了一个

Image

Steps to reproduce / 复现步骤

这是从v0.4.10更新到v0.4.12后的第一次定时执行工作流

Logs / 日志

[2026-01-01 06:00:00]
ready to request certificate ...
[2026-01-01 06:00:00]
no found last issued certificate, begin to apply

Miscellaneous / 其他

No response

Contribution / 贡献代码

  • I am interested in contributing a PR for this! / 我乐意为此提交代码并发起 PR!
Originally created by @KudaYoung on GitHub (Jan 1, 2026). Original GitHub issue: https://github.com/certimate-go/certimate/issues/1137 ### Release Version / 软件版本 v0.4.12 ### Description / 缺陷描述 已有同一个工作流之前申请的证书,有效时间还有80天,但是今天早上定时执行工作流时日志显示没找到证书,重新申请了一个 ![Image](https://github.com/user-attachments/assets/292fd454-3224-449e-a8d3-26f76297b95a) ### Steps to reproduce / 复现步骤 这是从v0.4.10更新到v0.4.12后的第一次定时执行工作流 ### Logs / 日志 <details> ```console [2026-01-01 06:00:00] ready to request certificate ... [2026-01-01 06:00:00] no found last issued certificate, begin to apply ``` </details> ### Miscellaneous / 其他 _No response_ ### Contribution / 贡献代码 - [ ] I am interested in contributing a PR for this! / 我乐意为此提交代码并发起 PR!
kerem 2026-03-03 01:05:51 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@fudiwei commented on GitHub (Jan 4, 2026):

http://127.0.0.1:8090/_/ 登录一下数据库面板,看下 certificate 这张表里,图里这俩的 workflowNodeId 字段是同一个吗?

<!-- gh-comment-id:3708077253 --> @fudiwei commented on GitHub (Jan 4, 2026): `http://127.0.0.1:8090/_/` 登录一下数据库面板,看下 `certificate` 这张表里,图里这俩的 workflowNodeId 字段是同一个吗?
Author
Owner

@KudaYoung commented on GitHub (Jan 4, 2026):

http://127.0.0.1:8090/_/ 登录一下数据库面板,看下 certificate 这张表里,图里这俩的 workflowNodeId 字段是同一个吗?

刚刚确认了一下,是同一个

<!-- gh-comment-id:3708114286 --> @KudaYoung commented on GitHub (Jan 4, 2026): > `http://127.0.0.1:8090/_/` 登录一下数据库面板,看下 `certificate` 这张表里,图里这俩的 workflowNodeId 字段是同一个吗? 刚刚确认了一下,是同一个
Author
Owner

@fudiwei commented on GitHub (Jan 4, 2026):

奇怪…… 😕

把新的这个证书、和对应的运行记录删掉,观察下还能复现吗?

<!-- gh-comment-id:3708145340 --> @fudiwei commented on GitHub (Jan 4, 2026): 奇怪…… 😕 把新的这个证书、和对应的运行记录删掉,观察下还能复现吗?
Author
Owner

@KudaYoung commented on GitHub (Jan 4, 2026):

奇怪…… 😕

把新的这个证书、和对应的运行记录删掉,观察下还能复现吗?

复现了,又重新申请了一张

Image Image Image
<!-- gh-comment-id:3708161654 --> @KudaYoung commented on GitHub (Jan 4, 2026): > 奇怪…… 😕 > > 把新的这个证书、和对应的运行记录删掉,观察下还能复现吗? 复现了,又重新申请了一张 <img width="488" height="84" alt="Image" src="https://github.com/user-attachments/assets/0ed846a7-fcea-40eb-80d6-698053a22dd6" /> <img width="1111" height="148" alt="Image" src="https://github.com/user-attachments/assets/8002379a-c303-4de2-8457-76130eaa5b17" /> <img width="697" height="214" alt="Image" src="https://github.com/user-attachments/assets/531b3fda-6048-4a94-8057-8298f5998787" />
Author
Owner

@fudiwei commented on GitHub (Jan 5, 2026):

麻烦在数据库面板的页面上打开浏览器开发者工具,在控制台输入(注意替换一下第一个常量值):

const WORKFLOW_ID = "<your-workflow-id>" // <---- 替换为你的工作流ID,可在数据库面板中看到
const token = JSON.parse(localStorage.getItem('__pb_superuser_auth__')).token
const workflows = (await (await fetch(`/api/collections/workflow/records?page=1&perPage=65535&filter=id%3D%27${WORKFLOW_ID}%27`, { headers: { Authorization: token } })).json()).items
const workflowRuns = (await (await fetch(`/api/collections/workflow_run/records?page=1&perPage=65535&filter=workflowRef%3D%27${WORKFLOW_ID}%27`, { headers: { Authorization: token } })).json()).items
const workflowOutputs = (await (await fetch(`/api/collections/workflow_output/records?page=1&perPage=65535&filter=workflowRef%3D%27${WORKFLOW_ID}%27`, { headers: { Authorization: token } })).json()).items
const workflowLogs = (await (await fetch(`/api/collections/workflow_logs/records?page=1&perPage=65535&filter=workflowRef%3D%27${WORKFLOW_ID}%27`, { headers: { Authorization: token } })).json()).items
const certificates = (await (await fetch(`/api/collections/certificate/records?page=1&perPage=65535&filter=workflowRef%3D%27${WORKFLOW_ID}%27`, { headers: { Authorization: token } })).json()).items

const dumps = [];
workflows.forEach((e) => { dumps.push(e) })
workflowRuns.forEach((e) => { dumps.push(e) })
workflowOutputs.forEach((e) => { dumps.push(e) })
workflowLogs.filter((e) => e.level >= 0).forEach((e) => { dumps.push(e) })
certificates.forEach((e) => { ['acmeAcctUrl', 'acmeCertStableUrl', 'acmeCertUrl', 'certificate', 'issuerCertificate', 'privateKey'].forEach((f) => delete e[f]); dumps.push(e) })
console.log(JSON.stringify(dumps))

按回车后把控制台打印出来的的数据库 dump 内容复制到一个 txt 文件中上传到评论区。(已剔除证书私钥等敏感字段,请放心复制)

<!-- gh-comment-id:3708861300 --> @fudiwei commented on GitHub (Jan 5, 2026): 麻烦在数据库面板的页面上打开浏览器开发者工具,在控制台输入(注意替换一下第一个常量值): ```js const WORKFLOW_ID = "<your-workflow-id>" // <---- 替换为你的工作流ID,可在数据库面板中看到 const token = JSON.parse(localStorage.getItem('__pb_superuser_auth__')).token const workflows = (await (await fetch(`/api/collections/workflow/records?page=1&perPage=65535&filter=id%3D%27${WORKFLOW_ID}%27`, { headers: { Authorization: token } })).json()).items const workflowRuns = (await (await fetch(`/api/collections/workflow_run/records?page=1&perPage=65535&filter=workflowRef%3D%27${WORKFLOW_ID}%27`, { headers: { Authorization: token } })).json()).items const workflowOutputs = (await (await fetch(`/api/collections/workflow_output/records?page=1&perPage=65535&filter=workflowRef%3D%27${WORKFLOW_ID}%27`, { headers: { Authorization: token } })).json()).items const workflowLogs = (await (await fetch(`/api/collections/workflow_logs/records?page=1&perPage=65535&filter=workflowRef%3D%27${WORKFLOW_ID}%27`, { headers: { Authorization: token } })).json()).items const certificates = (await (await fetch(`/api/collections/certificate/records?page=1&perPage=65535&filter=workflowRef%3D%27${WORKFLOW_ID}%27`, { headers: { Authorization: token } })).json()).items const dumps = []; workflows.forEach((e) => { dumps.push(e) }) workflowRuns.forEach((e) => { dumps.push(e) }) workflowOutputs.forEach((e) => { dumps.push(e) }) workflowLogs.filter((e) => e.level >= 0).forEach((e) => { dumps.push(e) }) certificates.forEach((e) => { ['acmeAcctUrl', 'acmeCertStableUrl', 'acmeCertUrl', 'certificate', 'issuerCertificate', 'privateKey'].forEach((f) => delete e[f]); dumps.push(e) }) console.log(JSON.stringify(dumps)) ``` 按回车后把控制台打印出来的的数据库 dump 内容复制到一个 txt 文件中上传到评论区。(已剔除证书私钥等敏感字段,请放心复制)
Author
Owner

@lazyyz commented on GitHub (Jan 5, 2026):

麻烦在数据库面板的页面上打开浏览器开发者工具,在控制台输入(注意替换一下第一个常量值):

const WORKFLOW_ID = "" // <---- 替换为你的工作流ID,可在数据库面板中看到
const token = JSON.parse(localStorage.getItem('pb_superuser_auth')).token
const workflows = (await (await fetch(/api/collections/workflow/records?page=1&perPage=65535&filter=id%3D%27${WORKFLOW_ID}%27, { headers: { Authorization: token } })).json()).items
const workflowRuns = (await (await fetch(/api/collections/workflow_run/records?page=1&perPage=65535&filter=workflowRef%3D%27${WORKFLOW_ID}%27, { headers: { Authorization: token } })).json()).items
const workflowOutputs = (await (await fetch(/api/collections/workflow_output/records?page=1&perPage=65535&filter=workflowRef%3D%27${WORKFLOW_ID}%27, { headers: { Authorization: token } })).json()).items
const workflowLogs = (await (await fetch(/api/collections/workflow_logs/records?page=1&perPage=65535&filter=workflowRef%3D%27${WORKFLOW_ID}%27, { headers: { Authorization: token } })).json()).items
const certificates = (await (await fetch(/api/collections/certificate/records?page=1&perPage=65535&filter=workflowRef%3D%27${WORKFLOW_ID}%27, { headers: { Authorization: token } })).json()).items

const dumps = [];
workflows.forEach((e) => { dumps.push(e) })
workflowRuns.forEach((e) => { dumps.push(e) })
workflowOutputs.forEach((e) => { dumps.push(e) })
workflowLogs.filter((e) => e.level >= 0).forEach((e) => { dumps.push(e) })
certificates.forEach((e) => { ['acmeAcctUrl', 'acmeCertStableUrl', 'acmeCertUrl', 'certificate', 'issuerCertificate', 'privateKey'].forEach((f) => delete e[f]); dumps.push(e) })
console.log(JSON.stringify(dumps))
按回车后把控制台打印出来的的数据库 dump 内容复制到一个 txt 文件中上传到评论区。(已剔除证书私钥等敏感字段,请放心复制)

昨晚更新到0.4.12后遇到同样的问题,workflow-id已修改,但是回车后控制台只显示undefined,没有其他内容

<!-- gh-comment-id:3711936728 --> @lazyyz commented on GitHub (Jan 5, 2026): > 麻烦在数据库面板的页面上打开浏览器开发者工具,在控制台输入(注意替换一下第一个常量值): > > const WORKFLOW_ID = "<your-workflow-id>" // <---- 替换为你的工作流ID,可在数据库面板中看到 > const token = JSON.parse(localStorage.getItem('__pb_superuser_auth__')).token > const workflows = (await (await fetch(`/api/collections/workflow/records?page=1&perPage=65535&filter=id%3D%27${WORKFLOW_ID}%27`, { headers: { Authorization: token } })).json()).items > const workflowRuns = (await (await fetch(`/api/collections/workflow_run/records?page=1&perPage=65535&filter=workflowRef%3D%27${WORKFLOW_ID}%27`, { headers: { Authorization: token } })).json()).items > const workflowOutputs = (await (await fetch(`/api/collections/workflow_output/records?page=1&perPage=65535&filter=workflowRef%3D%27${WORKFLOW_ID}%27`, { headers: { Authorization: token } })).json()).items > const workflowLogs = (await (await fetch(`/api/collections/workflow_logs/records?page=1&perPage=65535&filter=workflowRef%3D%27${WORKFLOW_ID}%27`, { headers: { Authorization: token } })).json()).items > const certificates = (await (await fetch(`/api/collections/certificate/records?page=1&perPage=65535&filter=workflowRef%3D%27${WORKFLOW_ID}%27`, { headers: { Authorization: token } })).json()).items > > const dumps = []; > workflows.forEach((e) => { dumps.push(e) }) > workflowRuns.forEach((e) => { dumps.push(e) }) > workflowOutputs.forEach((e) => { dumps.push(e) }) > workflowLogs.filter((e) => e.level >= 0).forEach((e) => { dumps.push(e) }) > certificates.forEach((e) => { ['acmeAcctUrl', 'acmeCertStableUrl', 'acmeCertUrl', 'certificate', 'issuerCertificate', 'privateKey'].forEach((f) => delete e[f]); dumps.push(e) }) > console.log(JSON.stringify(dumps)) > 按回车后把控制台打印出来的的数据库 dump 内容复制到一个 txt 文件中上传到评论区。(已剔除证书私钥等敏感字段,请放心复制) 昨晚更新到0.4.12后遇到同样的问题,workflow-id已修改,但是回车后控制台只显示undefined,没有其他内容
Author
Owner

@fudiwei commented on GitHub (Jan 6, 2026):

昨晚更新到0.4.12后遇到同样的问题,workflow-id已修改,但是回车后控制台只显示undefined,没有其他内容

麻烦截个图我看下

<!-- gh-comment-id:3712961483 --> @fudiwei commented on GitHub (Jan 6, 2026): > 昨晚更新到0.4.12后遇到同样的问题,workflow-id已修改,但是回车后控制台只显示undefined,没有其他内容 麻烦截个图我看下
Author
Owner

@lazyyz commented on GitHub (Jan 6, 2026):

Image 刚刚重新执行了一次,还是一样
<!-- gh-comment-id:3713669688 --> @lazyyz commented on GitHub (Jan 6, 2026): <img width="1530" height="550" alt="Image" src="https://github.com/user-attachments/assets/ff6414a7-fa9f-4bf4-b5b7-190362c92eaa" /> 刚刚重新执行了一次,还是一样
Author
Owner

@fudiwei commented on GitHub (Jan 6, 2026):

ImageImage
刚刚重新执行了一次,还是一样

工作流 ID,不是证书 ID 哈。在 workflow 那张表里。

<!-- gh-comment-id:3713765762 --> @fudiwei commented on GitHub (Jan 6, 2026): > <details><summary>Image</summary><img alt="Image" width="1530" height="550" src="https://private-user-images.githubusercontent.com/4423665/532290259-ff6414a7-fa9f-4bf4-b5b7-190362c92eaa.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Njc2ODk5MjIsIm5iZiI6MTc2NzY4OTYyMiwicGF0aCI6Ii80NDIzNjY1LzUzMjI5MDI1OS1mZjY0MTRhNy1mYTlmLTRiZjQtYjViNy0xOTAzNjJjOTJlYWEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDEwNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAxMDZUMDg1MzQyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjA4Y2NjYzQ4MDJhYzhiYjYwNWZjNTU2YWY5M2E2NTE5NmVjMGRmYjQ3MmJiMjBiOTdkNDc5ODQyYzY0ZTdlYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.lz9rzMj8-F_ypgsaRne71uNAmaFgN4-NgF5SQQfwqrA"></details> > 刚刚重新执行了一次,还是一样 工作流 ID,不是证书 ID 哈。在 `workflow` 那张表里。
Author
Owner

@lazyyz commented on GitHub (Jan 6, 2026):

已执行,dump里的域名和路径我替换掉了,详见临时文件分享 https://d.tmpfile.link/public/2026-01-06/68025579-d712-4133-9ba3-2b658a930487/dump.txt

<!-- gh-comment-id:3713811007 --> @lazyyz commented on GitHub (Jan 6, 2026): 已执行,dump里的域名和路径我替换掉了,详见临时文件分享 https://d.tmpfile.link/public/2026-01-06/68025579-d712-4133-9ba3-2b658a930487/dump.txt
Author
Owner

@fudiwei commented on GitHub (Jan 6, 2026):

@lazyyz 请问你还有升级前的低版本数据库备份吗?我发现你的 dump 中有一些诡异的数据截断,但我本地的各个版本的备份均无法复现。如果你还有保留的话,麻烦使用低版本的 Certimate 再 dump 一次。

<!-- gh-comment-id:3714654744 --> @fudiwei commented on GitHub (Jan 6, 2026): @lazyyz 请问你还有升级前的低版本数据库备份吗?我发现你的 dump 中有一些诡异的数据截断,但我本地的各个版本的备份均无法复现。如果你还有保留的话,麻烦使用低版本的 Certimate 再 dump 一次。
Author
Owner

@lazyyz commented on GitHub (Jan 6, 2026):

没有备份,一直是下新版本然后直接启动的。我定时任务是在凌晨,等明天看看会不会还申请新的

<!-- gh-comment-id:3714691047 --> @lazyyz commented on GitHub (Jan 6, 2026): 没有备份,一直是下新版本然后直接启动的。我定时任务是在凌晨,等明天看看会不会还申请新的
Author
Owner

@lazyyz commented on GitHub (Jan 7, 2026):

昨天申请过的没有重新申请了,另外一个域名昨天申请失败的,今天凌晨也申请了一个新的证书。
这是另外一个工作流的dump:https://d.tmpfile.link/public/2026-01-07/a9e2d91a-0923-4289-98e0-3ab726c3f738/dump2.txt

<!-- gh-comment-id:3717278974 --> @lazyyz commented on GitHub (Jan 7, 2026): 昨天申请过的没有重新申请了,另外一个域名昨天申请失败的,今天凌晨也申请了一个新的证书。 这是另外一个工作流的dump:https://d.tmpfile.link/public/2026-01-07/a9e2d91a-0923-4289-98e0-3ab726c3f738/dump2.txt
Author
Owner

@lazyyz commented on GitHub (Jan 8, 2026):

同步一下,我的两个工作流今天凌晨都没有申请新证书了,运行正常。目前使用的版本是v0.4.13

Image
<!-- gh-comment-id:3722438307 --> @lazyyz commented on GitHub (Jan 8, 2026): 同步一下,我的两个工作流今天凌晨都没有申请新证书了,运行正常。目前使用的版本是v0.4.13 <img width="466" height="950" alt="Image" src="https://github.com/user-attachments/assets/eba44a72-66c3-423c-8aa8-7f99400952e3" />
Author
Owner

@Qmli04 commented on GitHub (Jan 16, 2026):

@fudiwei 这个问题我在 v0.4.5升级到v0.4.13也碰到了。
刚刚debug了下,是workflow中的nodeid与上次执行的workflow_output中的nodeid不一致,导致执行各工作流节点时,查不到上次执行结果,最后重新触发apply。

至于nodeid不一致的原因我还未排查,猜测可能是在migration中有操作改掉了?

目前我的解决办法是 导出升级前备份的老workflow_output表,匹配新老表的id,并将老表中nodeid的值更新至新表中。这在我的环境中可以解决重复申请和部署的问题。

<!-- gh-comment-id:3757885267 --> @Qmli04 commented on GitHub (Jan 16, 2026): @fudiwei 这个问题我在 v0.4.5升级到v0.4.13也碰到了。 刚刚debug了下,是workflow中的nodeid与上次执行的workflow_output中的nodeid不一致,导致执行各工作流节点时,查不到上次执行结果,最后重新触发apply。 至于nodeid不一致的原因我还未排查,猜测可能是在migration中有操作改掉了? 目前我的解决办法是 导出升级前备份的老workflow_output表,匹配新老表的id,并将老表中nodeid的值更新至新表中。这在我的环境中可以解决重复申请和部署的问题。
Author
Owner

@fudiwei commented on GitHub (Jan 16, 2026):

这个问题我在 v0.4.5升级到v0.4.13也碰到了。 刚刚debug了下,是workflow中的nodeid与上次执行的workflow_output中的nodeid不一致,导致执行各工作流节点时,查不到上次执行结果,最后重新触发apply。

是的,直接原因就是这个。而且 NodeId 还不是完全不一致、是被截断了,这就是我前面提到的“诡异的数据截断”。

但我本地的各个版本的数据备份都无法复现这个问题。

@Qmli04 你能按照前面 https://github.com/certimate-go/certimate/issues/1137#issuecomment-3708861300 提到的方式 dump 一下数据,或者按照 https://github.com/certimate-go/certimate/issues/1155#issuecomment-3736779092 的方式将数据库文件发送给我吗?需要旧版备份和升级后的两个文件。我来尝试定位一下问题。

<!-- gh-comment-id:3758344007 --> @fudiwei commented on GitHub (Jan 16, 2026): > 这个问题我在 v0.4.5升级到v0.4.13也碰到了。 刚刚debug了下,是workflow中的nodeid与上次执行的workflow_output中的nodeid不一致,导致执行各工作流节点时,查不到上次执行结果,最后重新触发apply。 是的,直接原因就是这个。而且 NodeId 还不是完全不一致、是被截断了,这就是我前面提到的“诡异的数据截断”。 但我本地的各个版本的数据备份都无法复现这个问题。 @Qmli04 你能按照前面 https://github.com/certimate-go/certimate/issues/1137#issuecomment-3708861300 提到的方式 dump 一下数据,或者按照 https://github.com/certimate-go/certimate/issues/1155#issuecomment-3736779092 的方式将数据库文件发送给我吗?需要旧版备份和升级后的两个文件。我来尝试定位一下问题。
Author
Owner

@Qmli04 commented on GitHub (Jan 16, 2026):

这个问题我在 v0.4.5升级到v0.4.13也碰到了。 刚刚debug了下,是workflow中的nodeid与上次执行的workflow_output中的nodeid不一致,导致执行各工作流节点时,查不到上次执行结果,最后重新触发apply。

是的,直接原因就是这个。而且 NodeId 还不是完全不一致、是被截断了,这就是我前面提到的“诡异的数据截断”。

但我本地的各个版本的数据备份都无法复现这个问题。

@Qmli04 你能按照前面 #1137 (comment) 提到的方式 dump 一下数据,或者按照 #1155 (comment) 的方式将数据库文件发送给我吗?需要旧版备份和升级后的两个文件。我来尝试定位一下问题。

@fudiwei 我刚刚定位了下,大概知道原因了,后续我会提个pr来修复。

<!-- gh-comment-id:3758616224 --> @Qmli04 commented on GitHub (Jan 16, 2026): > > 这个问题我在 v0.4.5升级到v0.4.13也碰到了。 刚刚debug了下,是workflow中的nodeid与上次执行的workflow_output中的nodeid不一致,导致执行各工作流节点时,查不到上次执行结果,最后重新触发apply。 > > 是的,直接原因就是这个。而且 NodeId 还不是完全不一致、是被截断了,这就是我前面提到的“诡异的数据截断”。 > > 但我本地的各个版本的数据备份都无法复现这个问题。 > > [@Qmli04](https://github.com/Qmli04) 你能按照前面 [#1137 (comment)](https://github.com/certimate-go/certimate/issues/1137#issuecomment-3708861300) 提到的方式 dump 一下数据,或者按照 [#1155 (comment)](https://github.com/certimate-go/certimate/issues/1155#issuecomment-3736779092) 的方式将数据库文件发送给我吗?需要旧版备份和升级后的两个文件。我来尝试定位一下问题。 @fudiwei 我刚刚定位了下,大概知道原因了,后续我会提个pr来修复。
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/certimate#769
No description provided.