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

API call for tasks that are not running returns a SQL Error #3811

Closed
alexrolleyoctopus opened this issue Sep 20, 2017 · 2 comments
Closed

API call for tasks that are not running returns a SQL Error #3811

alexrolleyoctopus opened this issue Sep 20, 2017 · 2 comments
Assignees
Labels
kind/bug This issue represents a verified problem we are committed to solving
Milestone

Comments

@alexrolleyoctopus
Copy link

From: https://help.octopusdeploy.com/discussions/problems/58777

Versions tested: 3.3.19 (client), 3.17.0 (internal testing)

Issue: http://localhost/api/tasks/?running=False&apikey= returns

  "ErrorMessage": "Error while executing SQL command in transaction 'http://localhost/api/tasks/?running=False&apikey= 91868cff854142fca39d65b83807bf8f': Incorrect syntax near 'Queued'.\r\nThe command being executed was:\r\nSELECT COUNT(*) FROM dbo.[ServerTask] WHERE ([State] in ('Canceled', 'Failed', 'Success', 'TimedOut' 'Queued'))\r\nSQL Error 102 - Incorrect syntax near 'Queued'.",

Issue appears to be in SQL command, specifically a missing comma between TimedOut and Queued

Selecting for running=True returns a valid response:

{
  "ItemType": "Task",
  "IsStale": false,
  "TotalResults": 0,
  "ItemsPerPage": 30,
  "Items": [],
  "Links": {
    "Self": "/api/tasks?running=True",
    "Template": "/api/tasks{?skip,active,environment,project,name,node,running,hasPendingInterruptions,take,ids}",
    "Page.Current": "/api/tasks?skip=0&running=True&take=30"
  }
}
@alexrolleyoctopus alexrolleyoctopus added area/execution kind/bug This issue represents a verified problem we are committed to solving labels Sep 20, 2017
@tothegills tothegills self-assigned this Sep 20, 2017
@octoreleasebot octoreleasebot added this to the 3.17.2 milestone Sep 20, 2017
@octoreleasebot
Copy link

Release Note: The API endpoint /api/tasks?running=False now returns the correct results

@lock
Copy link

lock bot commented Nov 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. If you think you've found a related issue, please contact our support team so we can triage your issue, and make sure it's handled appropriately.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug This issue represents a verified problem we are committed to solving
Projects
None yet
Development

No branches or pull requests

3 participants