ManageIQ / ManageIQ/manageiq-api

Server error (500) returned after editing Catalog item with used name

Open
#574 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
Ruby
Stars
20
Forks
149
Avg merge
3d 22h
Merged PRs (30d)
1

Description

`Services > Catalogs > Catalogs > Configuration > New/Edit`

**Description**
- When you add a new Catalog with used name it returns 400 error
- However when you edit some Catalog and change its name to used name **it returns 500 error**

`http://localhost:3000/api/service_catalogs/45`

**body**

```
{
"action": "edit",
"resource": {
"name": "Aa" // something what is already used
}
}
```

**response**

500 Interval Server Error

```
{
"error": {
"kind": "internal_server_error",
"message": "Validation failed: ServiceTemplateCatalog: Name has already been taken",
"klass": "ActiveRecord::RecordInvalid"
}
}
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the `/api/service_catalogs/45` edit endpoint and reproduce the request using a name already used by another Catalog. Trace why duplicate-name validation returns 500 for edits while creation returns 400; done means the edit responds with the appropriate 400 validation error instead of an internal server error.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.