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

[BUG] remove dependencies.yaml should not throw error if the file is not exist #436

Open
1 task done
zhoufenqin opened this issue Feb 25, 2025 · 2 comments
Open
1 task done
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-priority Indicates an issue or PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@zhoufenqin
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Konveyor version

v0.6.0

Priority

Major

Current Behavior

https://github.com/konveyor/kantra/blob/main/cmd/analyze.go#L1326-L1333

when use --bulk to analyze an app, the dependencies.yaml may not exist. in CopyFileContents function ,if the source file is not open successfully, it won't return error. so the code is try to remove the dependencies.yaml, it will failed due to

ERRO[0097] failed to generate static report              error="remove /mnt/d/code/zhoufenqin/ASC-Test/integration-test/test-apps/polyglot-apps/php/httpd.output3/dependencies.yaml: no such file or directory"
Error: remove /mnt/d/code/zhoufenqin/ASC-Test/integration-test/test-apps/polyglot-apps/php/httpd.output3/dependencies.yaml: no such file or directory

in such case, it should not remove the file, i see in some places, it will ignore the dependencies.yaml not exist problem and it won't process the moveResults, like https://github.com/konveyor/kantra/blob/main/cmd/analyze-bin.go#L677-L690

So how about ignore the dependencies.yaml not exist problems when moveResults, like

if _, err := os.Stat(depsPath); err == nil {
	err = CopyFileContents(depsPath, fmt.Sprintf("%s.%s", depsPath, a.inputShortName()))
	if err != nil {
		return err
	}
	err = os.Remove(depsPath)
	if err != nil {
		return err
	}
}

Expected Behavior

No response

How Reproducible

Always (Default)

Steps To Reproduce

No response

Environment

- OS:

Anything else?

No response

@zhoufenqin zhoufenqin added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 25, 2025
@konveyor-ci-bot
Copy link

This issue is currently awaiting triage.
If contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.
The triage/accepted label can be added by org members.

@konveyor-ci-bot konveyor-ci-bot bot added the needs-priority Indicates an issue or PR lacks a `priority/foo` label and requires one. label Feb 25, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in Planning Feb 25, 2025
@zhoufenqin
Copy link
Author

it seems the error has been report: #413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-priority Indicates an issue or PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant