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

Error: unsupported operand type(s) for -: 'list' and 'list' when running a job with incorrect UUID. #3789

Closed
grelleum opened this issue May 21, 2023 · 0 comments · Fixed by #3790
Assignees
Labels
type: bug Something isn't working as expected

Comments

@grelleum
Copy link
Contributor

Environment

  • Nautobot version (Docker tag too if applicable): 1.5.16
  • Python version: 3.8.13
  • Database platform, version: MySQL 8.0.29

Steps to Reproduce

  1. Obtain the PK for a job that uses a MultiObjectVar input.
  2. Send and API POST to /api/extras/jobs/{job_id}/run/
  3. In the data, specify a UUID for an object that does not exist in the database

This can be reproduced on the API Documentation page for demo.nautobot.com using Job ID 6ecb9402-714e-43dc-8353-4a7da3d6845b ("Execute All Golden Configuration Jobs - Multiple Device")

curl -X 'POST' \
  'https://demo.nautobot.com/api/extras/jobs/6ecb9402-714e-43dc-8353-4a7da3d6845b/run/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-CSRFTOKEN: xxxxxxxxxxxxxxxxxxx' \
  -d '{"data": {"device": ["00000000-0000-0000-0000-000000000000"]}}'

Expected Behavior

The API call should fail with the informative message:
DoesNotExist: "Failed to find requested objects for var device: ['00000000-0000-0000-0000-000000000000']"

Observed Behavior

The error below is returned due to a an unexpected exception. This error obscures the root cause and is uninformative.

{
  "error": "unsupported operand type(s) for -: 'list' and 'list'",
  "exception": "TypeError",
  "nautobot_version": "1.5.7",
  "python_version": "3.7.16"
}
grelleum added a commit to grelleum/nautobot that referenced this issue May 21, 2023
@glennmatthews glennmatthews added the type: bug Something isn't working as expected label May 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants