https://garden.io logo
#🌱|help-and-getting-started
Error Module module-name is declared multiple times (in 'pathto-garden.yml' and 'pathto-garden.yml')
s

silly-accountant-45583

12/21/2022, 11:39 AM
Hi! Garden producing such error when scanning
templated
module. Basically, I have setup as described further:
Copy code
root-dir/
  project.garden.yml
  tpls/
    tpl.garden.yml
  modules/
    # these modules are templated modules that might use root-dir/tpls/tpl.garden.yml ModuleTemplate
    mdl-one/garden.yml
    mdl-two/garden.yml
    etc.
Modules in modules/ directory are of various types and can depend on each other. There is only one particular
templated
module that cannot be properly processed, while other
templated
modules work fine. From silly logs I found that it is loaded and added twice:
Copy code
{"msg":"Load module and workflow configs from /root-dir/modules/mdl-one/garden.yml","section":"","timestamp":"2022-12-21T09:10:35.620Z","level":"silly","allSections":[]}
{"msg":"Load module and workflow configs from /root-dir/modules/mdl-one/garden.yml","section":"","timestamp":"2022-12-21T09:10:35.622Z","level":"silly","allSections":[]}
{"msg":"Adding module mdl-one","section":"","timestamp":"2022-12-21T09:10:36.581Z","level":"silly","allSections":[]}
{"msg":"Adding module mdl-one","section":"","timestamp":"2022-12-21T09:10:36.583Z","level":"silly","allSections":[]}
And also error message with stack trace:
Copy code
Error: Module mdl-one is declared multiple times (in 'root-dir/modules/mdl-one/garden.yml' and 'root-dir/modules/mdl-one/garden.yml')
    at Garden.addModuleConfig (/snapshot/project/tmp/pkg/cli/node_modules/@garden-io/core/src/garden.ts:1033:13)
    at Garden.wrapped (/snapshot/project/tmp/pkg/cli/node_modules/@garden-io/core/src/util/profiling.ts:149:39)
    at /snapshot/project/tmp/pkg/cli/node_modules/@garden-io/core/src/garden.ts:1003:63
    at tryCatcher (/snapshot/project/tmp/pkg/cli/node_modules/bluebird/js/release/util.js:16:23)
    at MappingPromiseArray._promiseFulfilled (/snapshot/project/tmp/pkg/cli/node_modules/bluebird/js/release/map.js:68:38)
    at MappingPromiseArray.<anonymous> (/snapshot/project/tmp/pkg/cli/node_modules/bluebird/js/release/promise_array.js:115:31)
    at MappingPromiseArray.init (/snapshot/project/tmp/pkg/cli/node_modules/bluebird/js/release/promise_array.js:79:10)
    at MappingPromiseArray._asyncInit (/snapshot/project/tmp/pkg/cli/node_modules/bluebird/js/release/map.js:37:10)
    at _drainQueueStep (/snapshot/project/tmp/pkg/cli/node_modules/bluebird/js/release/async.js:97:12)
    at _drainQueue (/snapshot/project/tmp/pkg/cli/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/snapshot/project/tmp/pkg/cli/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.<anonymous> (/snapshot/project/tmp/pkg/cli/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (internal/timers.js:464:21)

Error Details:

pathA: root-dir/modules/mdl-one/garden.yml
pathB: root-dir/modules/mdl-one/garden.yml
I've also tried to remove
.garden
directory hoping it will somehow help, but unfortunately it didn't( OS: ubuntu 20.04 How I'm running Kubernetes: self-managed with Kops on AWS Garden version: tried from 0.12.45 to 0.12.48
The fact that I didn't declare module multiple times and there is only one file with one module inside. I expect that it will process module properly.
q

quaint-dress-831

12/21/2022, 12:58 PM
Hi @silly-accountant-45583, thank you for filing this issue as a bug 🐛 https://github.com/garden-io/garden/issues/3464 I don't have the answer; please be aware that most of our devs are out for holidays with most of staff back from January 9th on.
s

silly-accountant-45583

12/21/2022, 1:39 PM
7 Views