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

Deployment fails when the application git branch is changed #4618

Open
kentakozuka opened this issue Oct 17, 2023 · 2 comments · May be fixed by #4739
Open

Deployment fails when the application git branch is changed #4618

kentakozuka opened this issue Oct 17, 2023 · 2 comments · May be fixed by #4739
Assignees
Labels
area/piped kind/bug Something isn't working

Comments

@kentakozuka
Copy link
Member

kentakozuka commented Oct 17, 2023

What happened:

Deployment fails when the application git branch is changed.

What you expected to happen:

No failure

How to reproduce it:

  1. branch: launch PipeCD Agent for v2
  2. ADD the application
  3. Modify PipeCD Agent configuration (branch: main)
  4. Verify that changes in main branch can be deployed
  5. Delete branch: v2
  6. The change in main branch is detected and deployed successfully
  7. Restart PipeCD Agent
  8. Main branch changes are detected, but deploy fails

Environment:

  • piped version:
  • control-plane version:
  • Others:
jsonPayload: {
branch: "v2"
caller: "git/client.go:191"
error: "exit status 128"
eventTime: 1697503936.6423886
logger: "piped.piped"
message: "failed to clone from local"
out: "Cloning into '/tmp/workspace4070547661/fbd286cb-20ee-4c7b-8920-69663c42f6bd-planner-1664305497/target-deploysource/deploysource2595605295/repo'...
fatal: Remote branch v2 not found in upstream origin
"
remote: "git@github.com:kentakozuka/pipecd-play.git"
repo-id: "pipecd-play"
repo-path: "/tmp/workspace4070547661/fbd286cb-20ee-4c7b-8920-69663c42f6bd-planner-1664305497/target-deploysource/deploysource2595605295/repo"
serviceContext: {2}
stacktrace: "github.com/pipe-cd/pipecd/pkg/git.(*client).Clone
	/home/runner/work/pipecd/pipecd/pkg/git/client.go:191
github.com/pipe-cd/pipecd/pkg/app/piped/deploysource.(*gitSourceCloner).Clone
	/home/runner/work/pipecd/pipecd/pkg/app/piped/deploysource/sourcecloner.go:59
github.com/pipe-cd/pipecd/pkg/app/piped/deploysource.(*provider).prepare
	/home/runner/work/pipecd/pipecd/pkg/app/piped/deploysource/deploysource.go:146
github.com/pipe-cd/pipecd/pkg/app/piped/deploysource.(*provider).Get
	/home/runner/work/pipecd/pipecd/pkg/app/piped/deploysource/deploysource.go:92
github.com/pipe-cd/pipecd/pkg/app/piped/planner/kubernetes.(*Planner).Plan
	/home/runner/work/pipecd/pipecd/pkg/app/piped/planner/kubernetes/kubernetes.go:56
github.com/pipe-cd/pipecd/pkg/app/piped/controller.(*planner).Run
	/home/runner/work/pipecd/pipecd/pkg/app/piped/controller/planner.go:202
github.com/pipe-cd/pipecd/pkg/app/piped/controller.(*controller).startNewPlanner.func2
	/home/runner/work/pipecd/pipecd/pkg/app/piped/controller/controller.go:499"
}
labels: {4}
logName: "projects/pipecd/logs/stderr"
receiveTimestamp: "2023-10-17T00:52:21.597267065Z"
resource: {2}
severity: "ERROR"
timestamp: "2023-10-17T00:52:16.653773215Z"
}
@kentakozuka kentakozuka added kind/bug Something isn't working area/piped labels Oct 17, 2023
@kentakozuka
Copy link
Member Author

kentakozuka commented Oct 19, 2023

When deployment is triggered, application git config is used, which references the removed v2 branch.
https://github.com/pipe-cd/pipecd/blob/master/pkg/app/piped/trigger/deployment.go#L95

@golemiso golemiso linked a pull request Dec 26, 2023 that will close this issue
@ffjlabo ffjlabo self-assigned this Jan 19, 2024
@khanhtc1202
Copy link
Member

Note: Latest work on this is #4739 but it looks like a breaking change, we need to investigate the effect area from this approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/piped kind/bug Something isn't working
Projects
Status: No status
Status: Todo
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants