Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.13: [Bug]: Misleading template error due to swallowed "git dubious ownership" error #5450

Open
stefreak opened this issue Nov 20, 2023 · 1 comment

Comments

@stefreak
Copy link
Member

stefreak commented Nov 20, 2023

Garden Bonsai (0.13) Bug

Current Behavior

[verbose] garden version: 0.13.20
Validate ✔️

ℹ garden-enterprise [debug] → Initializing Garden Cloud API client.
[silly] Retrieving client auth token from config store
[debug] Checking client auth token with Garden Enterprise: https://xx/token/verify
[silly] Calling Cloud API with GET token/verify
[silly] Retrieving client auth token from config store
[debug] Checked client auth token with Garden Enterprise - valid: true
ℹ garden-enterprise [debug] → Authorizing...
ℹ garden-enterprise [debug] → Starting refresh interval.
[debug] Will run refresh function every 4500 ms.
[silly] Calling git with args 'rev-parse --abbrev-ref HEAD' in /Users/steffen/work/github/garden-platform
[silly] Calling git with args 'config --get remote.origin.url' in /Users/steffen/work/github/garden-platform
[silly] Tried to retrieve git remote.origin.url but encountered an error: Error: Command "git config --get remote.origin.url" failed with code 1:
ℹ garden-enterprise [verbose] → Connecting to Garden Enterprise...
ℹ garden-enterprise [debug] → Fetching project xx from https://staging.enterprise.garden.io.
[silly] Calling Cloud API with GET /projects/uid/xx
[silly] Retrieving client auth token from config store
[silly] Calling Cloud API with GET /secrets/projectUid/xx/env/dev
[silly] Retrieving client auth token from config store
ℹ garden-enterprise [debug] → Fetched 33 secrets from https://xx
✔ garden-enterprise    → Ready
Failed to resolve project configuration.
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Invalid template string (ge-preview-${slice(local.env.GARDE…): Error validating argument 'input' for slice helper function:
value is not allowed to be empty
[silly] Error: Invalid template string (ge-preview-${slice(local.env.GARDE…): Error validating argument 'input' for slice helper function:
value is not allowed to be empty
    at resolveTemplateString (file:///Users/steffen/Library/Application%20Support/io.garden.garden/1700246687-AJiCnyg.r/rollup/garden.mjs:321985:15)
    at resolveTemplateStrings (file:///Users/steffen/Library/Application%20Support/io.garden.garden/1700246687-AJiCnyg.r/rollup/garden.mjs:322004:16)
    at resolveTemplateStrings (file:///Users/steffen/Library/Application%20Support/io.garden.garden/1700246687-AJiCnyg.r/rollup/garden.mjs:322065:34)
    at resolveTemplateStrings (file:///Users/steffen/Library/Application%20Support/io.garden.garden/1700246687-AJiCnyg.r/rollup/garden.mjs:322065:34)
    at resolveProjectConfig (file:///Users/steffen/Library/Application%20Support/io.garden.garden/1700246687-AJiCnyg.r/rollup/garden.mjs:353470:24)
    at file:///Users/steffen/Library/Application%20Support/io.garden.garden/1700246687-AJiCnyg.r/rollup/garden.mjs:819731:18
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///Users/steffen/Library/Application%20Support/io.garden.garden/1700246687-AJiCnyg.r/rollup/garden.mjs:358410:20
    at async Garden.factory (file:///Users/steffen/Library/Application%20Support/io.garden.garden/1700246687-AJiCnyg.r/rollup/garden.mjs:818606:33)
    at async file:///Users/steffen/Library/Application%20Support/io.garden.garden/1700246687-AJiCnyg.r/rollup/garden.mjs:358410:20
Error type: template-string

Expected behavior

Command "git rev-parse --show-toplevel" failed with code 128:

     fatal: detected dubious ownership in repository at '/Users/steffen/work/github/garden-platform'
To add an exception for this directory, call:

	git config --global --add safe.directory /Users/steffen/work/github/garden-platform

Reproducible example

  1. cd garden-platform (internal project)
  2. sudo chown nobody:nobody .
  3. garden validate

Workaround

Run git status to see what's wrong, and fix the issue with git.

Suggested solution(s)

Make sure we do not swallow the git error

Additional context

Your environment

  • OS: macOS
  • How I'm running Kubernetes: EKS

garden version latest edge release

@stefreak stefreak added the 0.13 label Nov 20, 2023
@stefreak stefreak changed the title 0.13: [Bug]: Misleading template error on "git dubious ownership" error 0.13: [Bug]: Misleading template error due to swallowed "git dubious ownership" error Nov 20, 2023
@stefreak
Copy link
Member Author

This part wasn't fixed in #5434 / #5439 so I extracted it as a separate open issue.

@vvagaytsev vvagaytsev added the bug label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants