sodafoundation / strato

SODA Strato (Multi-cloud) project provides a cloud vendor agnostic data management for hybrid cloud, intercloud or intracloud. This project is renamed as 'Strato'
Apache License 2.0
233 stars 329 forks source link

500 Internal Error for Running a Job with a non existing Plan #938

Open himanshuvar opened 4 years ago

himanshuvar commented 4 years ago

Is this a BUG REPORT or FEATURE REQUEST?:

Uncomment only one, leave it on its own line: /kind bug

What happened: Run a Job give 500 Internal Error for non-existing Plan.

What you expected to happen: Run a Job should give 404 for non-existing Plan.

How to reproduce it (as minimally and precisely as possible): Run a Job with a non-existing plan.

JobGetIssuePOSTMAN

Error Logs:

[2020-05-08T14:54:44+05:30] [INFO] [/root/gopath/src/github.com/opensds/multi-cloud/dataflow/pkg/service.go] [pkg.(*dataflowService).RunPlan():428] [PID:1] Run plan is called in dataflow service. [2020-05-08T14:54:44+05:30] [ERROR] [/root/gopath/src/github.com/opensds/multi-cloud/dataflow/pkg/db/drivers/mongo/mongo.go] [mongo.(*adapter).GetPlan():661] [PID:1] plan does not exist. [2020-05-08T14:54:44+05:30] [INFO] [/root/gopath/src/github.com/opensds/multi-cloud/dataflow/pkg/service.go] [pkg.(*dataflowService).RunPlan():447] [PID:1] Run plan err:plan does not exist. Anything else we need to know?:

Environment:

subi9 commented 2 years ago

Please assign to me.

subi9 commented 2 years ago

Hi Ashit, I have used a constant for the "job not exist" message and stored it in a variable but for "invalid input to object id hex" is not generic so we can keep as it is.I have pushed the code .Please review it and let me know.