Bug: Docker Secrets lead to uncaughtException

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

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
docker, docker-compose, javascript

调研方向

从 lib/config/index.js 中的 deepFreeze 调用开始检查,并查看 lib/config/dockerSecret.js,然后复现 issue 中命名 secret 的 Docker Compose 示例。当名为 imgur_clientid 的 Docker secret 不再导致 uncaughtException,且 secret 处理仍可正常使用时,即表示完成。

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

描述

As soon as you use docker secrets, you will get the following exception:

error:         uncaughtException: Cannot freeze array buffer views with elements                               15:29:21 [7/7167]TypeError: Cannot freeze array buffer views with elements                                                                                                    at Function.freeze (<anonymous>)                                                                                                                         at deepFreeze (/home/hackmd/app/node_modules/deep-freeze/index.js:2:10)                                                                                  at /home/hackmd/app/node_modules/deep-freeze/index.js:9:7                                                                                                at Array.forEach (<anonymous>)                                                                                                                           at deepFreeze (/home/hackmd/app/node_modules/deep-freeze/index.js:4:33)                                                                                  at /home/hackmd/app/node_modules/deep-freeze/index.js:9:7                                                                                                at Array.forEach (<anonymous>)
    at deepFreeze (/home/hackmd/app/node_modules/deep-freeze/index.js:4:33)
    at Object.<anonymous> (/home/hackmd/app/lib/config/index.js:214:10)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/home/hackmd/app/app.js:23:14)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)

If you use random secrets, that are not used by https://github.com/hackmdio/codimd/blob/develop/lib/config/dockerSecret.js, there is no exception. If you used a named secret (e.g. imgur_clientid), like in the following example, you get the exception.

  codimd:
    image: hackmdio/hackmd:2.6.1
    container_name: codimd
    [... other container settings ...]
    secrets:
      - source: codimd_imgur_secret
        target: imgur_clientid # when target = "abcef" no exception, but the secret is not used of course
主要语言
JavaScript
星标
10.2k
派生
1.1k
PR 合并指标
30 天内没有已合并 PR

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

hackmdio/codimd 的其他 Issue

查看 hackmdio/codimd 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

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