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

Running garden self-update on Windows 10 leaves garden non-functional #2614

Closed
ITHedgeHog opened this issue Oct 7, 2021 · 18 comments · Fixed by #5120
Closed

Running garden self-update on Windows 10 leaves garden non-functional #2614

ITHedgeHog opened this issue Oct 7, 2021 · 18 comments · Fixed by #5120
Assignees
Labels

Comments

@ITHedgeHog
Copy link
Contributor

Bug

Current Behavior

If I issue the command garden self-update in an administrative or user session of PowerShell, I end up with Garden non-functional until I reinstall via the PowerShell script

Expected behavior

I expect to be able to issue a command such as garden deploy without failure

Reproducible example

PS C:\git\uk.energy> garden self-update
Update Garden

Running in namespace ...

Checking for latest version...
Installation directory: C:\Users\Dan Taylor\.garden\bin
Current Garden version: 0.12.26
Latest release version: 0.12.27

Downloading version 0.12.27 from
https://github.com/garden-io/garden/releases/download/0.12.27/garden-0.12.27-windows-amd64.zip...
Backing up prior installation to C:\Users\Dan Taylor\.garden\bin\.backup\0.12.26...
Extracting to installation directory C:\Users\Dan Taylor\.garden\bin...

Done!
PS C:\git\uk.energy> garden version
0.12.27
PS C:\git\uk.energy> garden --env=systest plugins kubernetes cluster-init
Plugins


Running in namespace default

Initializing/updating cluster-wide services for systest environment

ℹ providers                 → Getting status...

Failed resolving provider kubernetes. Here is the output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Path C:\Users\Dan Taylor\.garden\bin\static\kubernetes\system is not in a git repository root. Garden must be run from within a git repo. Please run `git init` if you're starting a new project and repository, or move the project to an existing repository, and try again.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Failed resolving one or more providers:
- kubernetes

See .garden/error.log for detailed error message

error.log

Workaround

Suggested solution(s)

Additional context

Your environment

  • OS: Windows 10 Professional
  • How I'm running Kubernetes: AKS

garden version

PS C:\git\uk.energy> garden version
0.12.27
@thsig
Copy link
Collaborator

thsig commented Oct 7, 2021

Hi @ITHedgeHog—thanks for reporting this! We'll have a look and post an update here once the fix is ready.

@edvald edvald added bug priority:medium Medium priority issue or feature labels Jan 13, 2022
@ITHedgeHog
Copy link
Contributor Author

Just adding, same behaviour on Windows 11.

@mcanaleta
Copy link

Hi, same issue here, after installing garden from scratch in Windows 10.

@ITHedgeHog
Copy link
Contributor Author

We encountered this with a fresh install today, on both Windows 10 and Windows 11. Non-functional garden due to the above error.

Closed the terminal, reopened and reinstalled and it then worked.

@mcanaleta
Copy link

mcanaleta commented May 18, 2022

Reopening and reinstalling didn't work for me. Running as admin did work though. So it looks like:

  • It could be related with permissions (at least in my system)
  • The problem happens in the "resolve-provider" task
  • The bug seems to be related with the current working directory during that step, which should be the project path, and it is instead $HOME.garden\bin\static\kubernetes\system

Attaching relevant parts of my error.log:

[2022-05-18T20:11:32.924Z] Error: Path C:\Users\mcana\.garden\bin\static\kubernetes\system is not in a git repository root. Garden must be run from within a git repo. Please run `git init` if you're starting a new project and repository, or move the project to an existing repository, and try again.
    at wrapped.getRepoRoot (C:\snapshot\project\tmp\pkg\cli\node_modules\@garden-io\core\build\src\vcs\git.js:0)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at Function.factory (C:\snapshot\project\tmp\pkg\cli\node_modules\@garden-io\core\build\src\garden.js:0)
    at Object.getEnvironmentStatus (C:\snapshot\project\tmp\pkg\cli\node_modules\@garden-io\core\build\src\plugins\kubernetes\init.js:0)
    at C:\snapshot\project\tmp\pkg\cli\node_modules\@garden-io\core\build\src\actions.js:0
    at wrapped.ensurePrepared (C:\snapshot\project\tmp\pkg\cli\node_modules\@garden-io\core\build\src\tasks\resolve-provider.js:0)
    at wrapped.process (C:\snapshot\project\tmp\pkg\cli\node_modules\@garden-io\core\build\src\tasks\resolve-provider.js:0)
    at TaskNode.process (C:\snapshot\project\tmp\pkg\cli\node_modules\@garden-io\core\build\src\task-graph.js:0)
    at wrapped.processNode (C:\snapshot\project\tmp\pkg\cli\node_modules\@garden-io\core\build\src\task-graph.js:0)

Error Details:

path: 'C:\Users\mcana\.garden\bin\static\kubernetes\system'

(...)

  resolve-provider.local-kubernetes:
    type: resolve-provider
    description: resolving provider local-kubernetes
    key: resolve-provider.local-kubernetes
    name: local-kubernetes
    error:
      detail:
        path: 'C:\Users\mcana\.garden\bin\static\kubernetes\system'
      type: runtime
    startedAt: '2022-05-18T20:11:31.178Z'
    completedAt: '2022-05-18T20:11:32.914Z'
    batchId: afddf5bb-11a4-4ea7-aee0-6981216464d2
    version: 0.12.40

(...)


[2022-05-18T20:11:32.934Z] Error: Failed resolving one or more providers:
- local-kubernetes
    at C:\snapshot\project\tmp\pkg\cli\node_modules\@garden-io\core\build\src\garden.js:0

So at this moment it is impossible for me to run garden in my windows desktop (running as admin obviously causes other problems).

Thanks!

@vvagaytsev
Copy link
Collaborator

@mcanaleta could you try the latest edge release, please?

This issue should be fixed in #2905. We haven't released that change yet, it will be released in 0.12.41.

@ITHedgeHog
Copy link
Contributor Author

I've just tried that @vvagaytsev I get the following:

image

Verbose logging output shows this:

image

@mcanaleta
Copy link

Hi, I had to do multiple tests because I'm getting different errors, and it all depends on how you install, how you upgrade, and status and permissions of the .garden folders. So what I figured out:

  • With the normal process (1. standard installation and 2. garden self-update edge) it does not work, it continues failing in the same place.
  • However, doing it manually (1. standard installation, 2. rm $HOME/.garden/bin 3. unzip the release in $HOME/.garden/bin) solves the problem.

So it looks like it is a bug in the install/upgrade code.

Thanks!

@vvagaytsev
Copy link
Collaborator

@ITHedgeHog we fixed some Windows compatibility issues in 0.12.42, could try it, please?

@mcanaleta 0.12.42 also contains some fixes to consider all Garden working directories as safe Git repos. Please try it out.

@ITHedgeHog
Copy link
Contributor Author

@vvagaytsev Still no joy I'm afraid on self update

image

@ITHedgeHog
Copy link
Contributor Author

I've had to reinstall via the script again

@vvagaytsev
Copy link
Collaborator

@ITHedgeHog ok, I see. Git has had more strict repo ownership control since 2.36.0. This can cause errors like this: fatal: unsafe repository ({repo-path} is owned by someone else)

We addressed that issue by checking the git status of each working directory where git commands are executed. If there is an error like fatal: unsafe repository Garden will store that path under safe.directory key in the .gitconfig file.

Can you the safe.directory entries in the .gitconfig after the Garden failure? If you run git config --get-all safe.directory, the path C:/Users/D.Taylor/.garden/bin/static should be listed in the output.

Could you share the safe directories output and the Garden logs, please? There might be something wrong with access to the .gitconfig file, so the logs from .garden directory would be helpful to investigate the issue.

@dhairyafaria-uniphore
Copy link

Just re install it from the start and it will start working.

@OctaneAddiction
Copy link

image

Just to say, still an issue on a fresh install

Delete and reinstall did work but was not aware of this issue at the time of update

@stefreak stefreak self-assigned this Mar 7, 2023
@stefreak stefreak added priority:high High priority issue or feature and removed priority:medium Medium priority issue or feature labels Apr 12, 2023
@stefreak
Copy link
Member

Enough users are affected by this to justify high priority

@stefreak
Copy link
Member

This issue might be fixed once #4047 has been merged.

@vvagaytsev vvagaytsev removed their assignment Jul 4, 2023
@worldofgeese
Copy link
Contributor

@stefreak just spoke with @ITHedgeHog this morning and he's still running into this issue. I'll jump into Core Weekly planning on Monday to continue discussion

@stefreak
Copy link
Member

We should strongly consider working around this if #4047 cannot be merged quickly. this one is super important for all windows users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants