Skip to content

Bug: Docker Secrets lead to uncaughtException #1949

Description

@DennisGaida

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions