konveyor / move2kube-api

HTTP REST API for move2kube
https://move2kube.konveyor.io/
Apache License 2.0
6 stars 18 forks source link

Completed Q&A, but move2kube API thinks there are more questions and transformation fails #169

Open y-first opened 3 weeks ago

y-first commented 3 weeks ago

Describe the bug After completing the Q&A by answering all the questions, the Q&A window closes and a "transformation completed" notification pop up appears in the Move2kube UI. However, the move2kube api thinks there are more questions but at that stage the QA engine is not running anymore, and the transformation fails. The following error appears in the move2kube pod logs:

time="2024-08-22T08:16:09Z" level=info msg="Project: 52e0fb85-6c3b-48af-b97c-df41e9bbd9a3; Output:673b3418-e77b-42db-9c37-8c938b59323c; level=info msg="Transformation done"" time="2024-08-22T08:16:09Z" level=info msg="Project: 52e0fb85-6c3b-48af-b97c-df41e9bbd9a3; Output:673b3418-e77b-42db-9c37-8c938b59323c; level=info msg="Transformed target artifacts can be found at [/move2kube-api/data/projects/52e0fb85-6c3b-48af-b97c-df41e9bbd9a3/outputs/673b3418-e77b-42db-9c37-8c938b59323c/output/3]."" time="2024-08-22T08:16:09Z" level=debug msg="Project: 52e0fb85-6c3b-48af-b97c-df41e9bbd9a3; Output:673b3418-e77b-42db-9c37-8c938b59323c; level=debug msg="Cleaning up!"" time="2024-08-22T08:16:09Z" level=debug msg="failed to fetch the stdout of move2kube transform. Error: "EOF"" time="2024-08-22T08:16:09Z" level=info msg="failed to fetch the stderr of move2kube transform. Error: "EOF"" time="2024-08-22T08:16:09Z" level=debug msg="Closing transformCh: false" time="2024-08-22T08:16:09Z" level=debug msg="ctx not closed" time="2024-08-22T08:16:09Z" level=trace msg="checkErr start" time="2024-08-22T08:16:09Z" level=debug msg="net.Error: "Get \"http://localhost:41895/problems/current\\": dial tcp [::1]:41895: connect: connection refused"" time="2024-08-22T08:16:09Z" level=debug msg="default *url.Error Get "http://localhost:41895/problems/current\": dial tcp [::1]:41895: connect: connection refused" time="2024-08-22T08:16:09Z" level=trace msg="checkErr end" time="2024-08-22T08:16:09Z" level=error msg="failed to get the next question. Error: "failed to send a GET request to the URL http://localhost:41895/problems/current . Error: \"Get \\"http://localhost:41895/problems/current\\\\": dial tcp [::1]:41895: connect: connection refused\""" request-id=6befb2d7-27d9-4f43-b570-aa6bc5dfb354 time="2024-08-22T08:16:09Z" level=trace msg="HandleGetQuestion end" request-id=6befb2d7-27d9-4f43-b570-aa6bc5dfb354

Steps to reproduce the behavior:

  1. Deploy move2kube
  2. Click on Q&A and answer questions
  3. After answering final question, Q&A window closes itself and "transformation finished" pop up appears
  4. See above error in move2kube pod logs

Expected behavior Expected transformation to complete normally.

Desktop (please complete the following information): Using OCP version 4.15.0-0.nightly-2024-08-19-025745 Version: using move2kube image quay.io/konveyor/move2kube-ui:v0.3.14-rc.0

Additional context The completed files appear and are downloadable in the "output" section.

See logs for move2kube pod attached move2kube-6f86678956-jj5gr-move2kube.log

ashokponkumar commented 3 weeks ago

Is the following the error you want to avoid?

time="2024-08-22T08:16:09Z" level=error msg="failed to get the next question. Error: "failed to send a GET request to the URL http://localhost:41895/problems/current . Error: "Get \"[http://localhost:41895/problems/current\\\](http://localhost:41895/problems/current%5C%5C%5C%5C%5C%5C%5C)": dial tcp [::1]:41895: connect: connection refused""" request-id=6befb2d7-27d9-4f43-b570-aa6bc5dfb354
y-first commented 3 weeks ago

Yes. It's odd since according to the logs, the transformation had already completed, so why is it trying to get to the next question?

y-first commented 3 weeks ago

Could it be possible that this is a regression in error handling bug in the move2kube-api, possibly caused by https://github.com/konveyor/move2kube-api/commit/273206c6fa8f09d9c4b92b75af77adee01b8519a ?

ashokponkumar commented 3 weeks ago

@HarikrishnanBalagopal please correct me if I am wrong. But I think it is because the url is served by the cli, whose QA server gets terminated when the last question is done, and I think we are just logging it even though it is the natural flow.