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 摘要。