Open pellegrino opened 3 years ago
Hi!
I think the error comes from here: https://github.com/fluxcd/flux2/blob/main/pkg/manifestgen/manifest.go#L40-L43
Most likely related to securejoin: https://github.com/cyphar/filepath-securejoin/blob/master/join.go
Not sure how it should be handled though.
Ping @stefanprodan @phillebaba
Me to here. Have to copy our repos to disk C.
I just got that error too. I realized that it happened, when I ran the flux bootstrap from a different drive than drive C ... After switching to drive C the execution worked!
I realized that the OP also used different drives, so hopefully this can provide a workaround until this is solved.
D:\Code\gitops>flux bootstrap github --components-extra=image-reflector-controller,image-automation-controller --hostname=some-repository --ssh-hostname=some-repository --owner=xyz--repository=gitops --branch=master
► connecting to some-repository
► cloning branch "master" from Git repository "https://some-repository/xyz/gitops.git"
✔ cloned repository
► generating component manifests
✗ component manifest generation failed: Rel: can't make C:\Users\xyz\AppData\Local\Temp\flux-manifests-3183109114 relative to D:\Code\gitops
D:\Code\gitops>c:
C:\Users\xyz>flux bootstrap github --components-extra=image-reflector-controller,image-automation-controller --hostname=some-repository --ssh-hostname=some-repository --owner=xyz --repository=gitops --branch=master
► connecting to some-repository
► cloning branch "master" from Git repository "https://some-repository/xyz/gitops.git"
✔ cloned repository
► generating component manifests
✔ generated component manifests
✔ committed sync manifests to "master" ("464255e37c49724b85c07bef23408d6c91654bd5")
► pushing component manifests to "https://some-repository/xyz/gitops.git"
► installing components in "flux-system" namespace
✔ installed components
✔ reconciled components
► determining if source secret "flux-system/flux-system" exists
► generating source secret
...
I can confirm moving to c resolves the issue
Please fix. Its been more than two months without any signs of an effort to fix this isssue.
Yes, it works from drive C
Just wanted to add that I tried changing $env:TEMP
to a directory on the other drive as @pellegrino hadn't tested that, but the same error occurs.
I'm running Flux with the Terraform provider, so it's inconvenient to move my repositories to a different drive, but I'll do it until a solution is implemented.
Just wanted to add that I tried changing
$env:TEMP
to a directory on the other drive as @pellegrino hadn't tested that, but the same error occurs.I'm running Flux with the Terraform provider, so it's inconvenient to move my repositories to a different drive, but I'll do it until a solution is implemented.
As a workaround I run my terraform commands on WSL. It then uses the linux version of terraform but in most cases that works for me.
I confirm the problem still exists in Flux 0.41.2
I'm simply learning Flux and trying the podinfo deployment as tutorial in Git Bash session:
$ flux install --namespace=flux-system --network-policy=false --components=source-controller,helm-controller
✚ generating manifests
✗ install failed: Rel: can't make C:\Users\mateuszl\AppData\Local\Temp\flux-system2569008128 relative to F:\tmp
In case other confused Flux newbies arrive here, switching to WSL session works around the problem easily, without moving files away from F:
or re-installing Flux, just go inside /mnt/f/tmp
and re-run the command above. Thanks @bravecobra
/assign
It seems that the root path provided to SecureJoinVFS is on a different drive than the one specified in $env:TEMP, which causes an issue when resolving the symbolic links. To resolve this issue, you may want to ensure that the root path provided to SecureJoinVFS is on the same drive as the one specified in $env:TEMP.
can't make C:\Users\... relative to D:\src\github.com\...
You don't really need to move the source code the the C:/ Just use CD to change the current folder where you execute the fux cli
Describe the bug
When trying to bootstrap a new flux repository on Windows, if the target directory is in a different drive than $env:TEMP, flux will fail to bootstrap it, with the error below:
My $env:TEMP lives inside the C:. I haven't tested changing it to a different drive to see if that has any impact.
To Reproduce
Steps to reproduce the behavior:
flux bootstrap
to initialize the repo. Flux should fail to install the manifestsExpected behavior
The new directory being bootstrap with the flux manifest files.
Additional context
flux version
flux check