https://garden.io logo
#🤖|ask-kapa
i try to do "garden deploy" but i added a new subrepo and now i'm getting an error:[2023
# 🤖|ask-kapa
b

best-flower-46100

08/22/2023, 8:10 AM
@microscopic-river-74022 i try to do "garden deploy" but i added a new subrepo and now i'm getting an error: [2023-08-22T08:07:25.287Z] Error: Could not parse CODE_OF_CONDUCT.md in directory /Users/{user}/projects/{repo}/{subrepo}/CODE_OF_CONDUCT.md as valid YAML: end of the stream or a document separator is expected at line 14, column 1: Examples of behavior that contri ... ^ at loadAndValidateYaml (/snapshot/project/tmp/pkg/cli/node_modules/@garden-io/core/src/config/base.ts:51:13) at loadConfigResources (/snapshot/project/tmp/pkg/cli/node_modules/@garden-io/core/src/config/base.ts:74:24) at Garden.loadResources (/snapshot/project/tmp/pkg/cli/node_modules/@garden-io/core/src/garden.ts:1074:23) at /snapshot/project/tmp/pkg/cli/node_modules/@garden-io/core/src/garden.ts:965:58
m

microscopic-river-74022

08/22/2023, 8:10 AM
Please stand by @best-flower-46100 as I search the knowledge base. I normally take about 20 seconds or so. :wave:
---------------------- It seems like Garden is trying to parse your
CODE_OF_CONDUCT.md
file as a YAML file, which is causing the error. Garden expects configuration files to be in YAML format. This issue might be related to the way you've structured your project or specified your includes/excludes in your
garden.yml
configuration. If you've included the entire directory or haven't explicitly excluded the
CODE_OF_CONDUCT.md
file, Garden might be trying to parse it as a configuration file. You should adjust your
garden.yml
configuration to ensure only valid YAML files are included. If the
CODE_OF_CONDUCT.md
file is not meant to be a part of the Garden configuration, you should exclude it. Unfortunately, the provided extracts do not contain specific instructions on how to do this. For more detailed guidance, you might want to refer to the official Garden documentation or the Garden GitHub issues page. ----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon: ----------------------
b

best-flower-46100

08/22/2023, 8:16 AM
@microscopic-river-74022 but that file is not garden configuration file, it's a documentation in a markdown file
m

microscopic-river-74022

08/22/2023, 8:16 AM
Let me check the knowledge base for you. One moment! :books:
---------------------- Yes, you're correct. The
CODE_OF_CONDUCT.md
is a markdown file and not a Garden configuration file. However, Garden is trying to parse it as a YAML file, which is causing the error. By default, Garden scans all directories under the project root for configuration files. If you don't specify otherwise, it might try to parse non-configuration files as well. To prevent this, you can use the
scan.exclude
field in your project configuration file or the
.gardenignore
file to exclude specific files or directories. Here's an example of how you can exclude the
CODE_OF_CONDUCT.md
file in your
.gardenignore
file:
Copy code
gitignore
CODE_OF_CONDUCT.md
Or, in your project configuration file:
Copy code
yaml
kind: Project
name: my-project
scan:
  exclude:
    - CODE_OF_CONDUCT.md
This will tell Garden to ignore the
CODE_OF_CONDUCT.md
file when scanning for configuration files. For more details, you can refer to the Including/excluding files and directories () section in the Garden documentation. ----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon: ----------------------
b

best-flower-46100

08/22/2023, 8:21 AM
@microscopic-river-74022 why would garden assume it's a yaml file if it's markdown
m

microscopic-river-74022

08/22/2023, 8:21 AM
Let me check the knowledge base for you. One moment! :books:
---------------------- Garden scans for configuration files in your project directory by looking for files with a
.garden.yml
extension. However, if not properly configured, it might try to parse other files as well, leading to errors. In your case, it seems Garden is trying to parse the
CODE_OF_CONDUCT.md
file as a YAML file, which is causing the error. This could be due to a misconfiguration in your project's
garden.yml
file or a bug in Garden. To avoid this, you should explicitly exclude the
CODE_OF_CONDUCT.md
file in your project configuration or in a
.gardenignore
file, as mentioned in my previous response. If you've already done this and are still experiencing the issue, it might be a bug in Garden. In that case, you should report it on the Garden GitHub issues page (). ----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon: ----------------------
c

chilly-gigabyte-83853

08/22/2023, 10:31 AM
Hi @best-flower-46100 this looks like a bug, Garden shouldn't try to parse .md files as yaml. Would you mind to file a bug report? https://github.com/garden-io/garden/issues/new?assignees=&labels=&projects=&template=BUG_REPORT.md&title=
2 Views