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

Better error message and support logs for /v3/service_offerings and plans #4213

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

kathap
Copy link
Contributor

@kathap kathap commented Feb 11, 2025

Users may be confused why they receive a 422 with error message "Invalid service plan. Ensure that the service plan exists, is available, and you have access to it." unprocessable_service_plan! when trying to create a service instance.
The root cause of this can have different origins:

  1. service plan does not exist
  2. user can not see the service plan in any org
  3. user can see service plan in one of his orgs but service plan got removed and is still in use by service instances (service plan is set to active=false)
  4. user sees the plan in of his orgs but not in the one he is creating the service instance in
  • A short explanation of the proposed change:
    Split the error into different errors depending on the root cause. Error message will stay the same if user can not see the service plan in any org.
    For case 1 and 2 error message will stay:
    Invalid service plan. Ensure that the service plan exists, is available, and you have access to it.
    For case 3 error message will now be:
    Invalid service plan. The service plan 'service_plan' with guid 'some-guid' has been removed from the service broker's catalog. It is not possible to create new service instances using this plan.
    For case 4 error message will now be:
    Invalid service plan. Ensure that the service plan 'service_plan' with guid 'some-guid' is visible in your current space 'space' with guid 'some-guid'.

  • An explanation of the use cases your change solves
    More fine granulated error messages, helping the user to solve the error better.

  • Links to any other associated PRs

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@kathap kathap marked this pull request as draft February 11, 2025 15:10
@kathap kathap marked this pull request as ready for review February 13, 2025 14:22
@jochenehret jochenehret requested review from a team February 13, 2025 15:53
jochenehret
jochenehret previously approved these changes Feb 13, 2025
app/controllers/v3/service_instances_controller.rb Outdated Show resolved Hide resolved
@@ -1260,7 +1260,10 @@ def check_filtered_instances(*instances)
expect(last_response).to have_status_code(422)
expect(parsed_response['errors']).to include(
include({
'detail' => 'Invalid service plan. Ensure that the service plan exists, is available, and you have access to it.',
'detail' => 'Invalid service plan. This could be due to a space-scoped broker which is offering the service plan ' \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to have the same tests for the update case (PATCH). If we had those, above bug which results in a 500 would have been detected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, will add it

app/controllers/v3/service_instances_controller.rb Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants