Missing deployment variable set in api

Octopus Deploy version 3.4.3

This one is odd, but I’m guessing there’s a valid reason for it.

I issue an API request to:
https://our-octopus/api/releases/Releases-7781/deployments

What we get back is this (notice the first deployment item has variables, the rest do not):

{
  "ItemType": "Deployment",
  "IsStale": false,
  "TotalResults": 3,
  "ItemsPerPage": 30,
  "Items": [
    {
      "Id": "Deployments-13954",
      "ReleaseId": "Releases-7781",
      "EnvironmentId": "Environments-23",
      "TenantId": null,
      "ForcePackageDownload": false,
      "ForcePackageRedeployment": false,
      "SkipActions": [],
      "SpecificMachineIds": [],
      "DeploymentProcessId": "deploymentprocess-Projects-582-s-7-23GU6",
      "ManifestVariableSetId": "variableset-Deployments-13954",
      "TaskId": "ServerTasks-43638",
      "ProjectId": "Projects-582",
      "ChannelId": "Channels-1702",
      "UseGuidedFailure": false,
      "Comments": null,
      "FormValues": {},
      "QueueTime": null,
      "Name": "Deploy to Production",
      "Created": "2017-08-02T21:15:26.761+00:00",
      "Links": {
        "Self": "/api/deployments/Deployments-13954",
        "Release": "/api/releases/Releases-7781",
        "Environment": "/api/environments/Environments-23",
        "Project": "/api/projects/Projects-582",
        "Task": "/api/tasks/ServerTasks-43638",
        "Web": "/app#/deployments/Deployments-13954",
        "Artifacts": "/api/artifacts?regarding=Deployments-13954",
        "Interruptions": "/api/interruptions?regarding=Deployments-13954",
        "Variables": "/api/variables/variableset-Deployments-13954"
      }
    },
    {
      "Id": "Deployments-13900",
      "ReleaseId": "Releases-7781",
      "EnvironmentId": "Environments-22",
      "TenantId": null,
      "ForcePackageDownload": false,
      "ForcePackageRedeployment": false,
      "SkipActions": [],
      "SpecificMachineIds": [],
      "DeploymentProcessId": "deploymentprocess-Projects-582-s-7-23GU6",
      "ManifestVariableSetId": null,
      "TaskId": "ServerTasks-43500",
      "ProjectId": "Projects-582",
      "ChannelId": "Channels-1702",
      "UseGuidedFailure": false,
      "Comments": null,
      "FormValues": {},
      "QueueTime": null,
      "Name": "Deploy to QA",
      "Created": "2017-08-01T20:16:14.824+00:00",
      "Links": {
        "Self": "/api/deployments/Deployments-13900",
        "Release": "/api/releases/Releases-7781",
        "Environment": "/api/environments/Environments-22",
        "Project": "/api/projects/Projects-582",
        "Task": "/api/tasks/ServerTasks-43500",
        "Web": "/app#/deployments/Deployments-13900",
        "Artifacts": "/api/artifacts?regarding=Deployments-13900",
        "Interruptions": "/api/interruptions?regarding=Deployments-13900"
      }
    },
    {
      "Id": "Deployments-13891",
      "ReleaseId": "Releases-7781",
      "EnvironmentId": "Environments-21",
      "TenantId": null,
      "ForcePackageDownload": false,
      "ForcePackageRedeployment": false,
      "SkipActions": [],
      "SpecificMachineIds": [],
      "DeploymentProcessId": "deploymentprocess-Projects-582-s-7-23GU6",
      "ManifestVariableSetId": null,
      "TaskId": "ServerTasks-43489",
      "ProjectId": "Projects-582",
      "ChannelId": "Channels-1702",
      "UseGuidedFailure": false,
      "Comments": null,
      "FormValues": {},
      "QueueTime": null,
      "Name": "Deploy to Development",
      "Created": "2017-08-01T18:28:41.436+00:00",
      "Links": {
        "Self": "/api/deployments/Deployments-13891",
        "Release": "/api/releases/Releases-7781",
        "Environment": "/api/environments/Environments-21",
        "Project": "/api/projects/Projects-582",
        "Task": "/api/tasks/ServerTasks-43489",
        "Web": "/app#/deployments/Deployments-13891",
        "Artifacts": "/api/artifacts?regarding=Deployments-13891",
        "Interruptions": "/api/interruptions?regarding=Deployments-13891"
      }
    }
  ],
  "Links": {
    "Self": "/api/releases/Releases-7781/deployments",
    "Template": "/api/releases/Releases-7781/deployments",
    "Page.Current": "/api/releases/Releases-7781/deployments?skip=0",
    "Page.0": "/api/releases/Releases-7781/deployments?skip=0"
  }
}

Why are the last two missing the Variables link?

And, if I just append the deployment number (variableset-Deployments-13900 for example) I still get a 404. There’s another instance where the same thing happened as above for a different release, same project, but, none of the deployments have the Variables link. Looking at the deployment in the web ui doesn’t seem to show any kind of real difference between those with Variables and those without.

Right now, as I’m looking through this one project a bit more I’m noticing something. Is there a retention on the variables? Here’s a high level of what I’m seeing. I may have not noticed something documenting this perhaps.

Newest release/deployment to oldest…

  • Release 18 to Prod has variables
  • Release 18 to QA has variables
  • Release 18 to Dev has variables
  • Release 17 to QA has variables
  • Release 17 to Dev has variables
  • Release 16 to Prod has variables
  • Release 16 to QA no variables
  • Release 16 to Dev no variables
  • Release 15 to Prod no variables
  • Release 15 to QA no variables
  • Release 15 to Dev no variables

Hi David,

Thanks for getting in touch. That’s interesting, you mentioned you’re on 3.4.3. It looks like it’s no longer an issue when I ran it on the latest version. I had a look through all the issues fixed between your version and the latest, but no issue stood out, it was possibly fixed as part of something else: https://octopus.com/downloads/compare?from=3.4.3&to=3.16.1

At the bottom I’ve pasted result for the API call for that where Variables is populated everywhere.

The only suggestion we have is if you need it, update to a more recent version, sorry I couldn’t find the exact version where it did get fixed/changed.

There’s 1 more thing to check, permissions may be a factor for you, if you have restricted permissions, try and view that API call as an admin with full access to see if it that makes it show up. If permissions can be ruled out, then it is just fixed in some later version.

Regards,
Nick

{
  "ItemType": "Deployment",
  "IsStale": false,
  "TotalResults": 2,
  "ItemsPerPage": 2147483647,
  "NumberOfPages": 1,
  "LastPageNumber": 0,
  "Items": [
    {
      "Id": "Deployments-2229",
      "ReleaseId": "Releases-1077",
      "EnvironmentId": "Environments-4",
      "TenantId": null,
      "ForcePackageDownload": false,
      "ForcePackageRedeployment": false,
      "SkipActions": [],
      "SpecificMachineIds": [],
      "ExcludedMachineIds": [],
      "DeploymentProcessId": "deploymentprocess-Projects-202-s-22-GR84P",
      "ManifestVariableSetId": "variableset-Deployments-2229",
      "TaskId": "ServerTasks-7278",
      "ProjectId": "Projects-202",
      "ChannelId": "Channels-202",
      "UseGuidedFailure": false,
      "Comments": null,
      "FormValues": {},
      "QueueTime": null,
      "QueueTimeExpiry": null,
      "Name": "Deploy to Test A",
      "Created": "2017-08-09T02:49:55.074+00:00",
      "Links": {
        "Self": "/api/deployments/Deployments-2229",
        "Release": "/api/releases/Releases-1077",
        "Environment": "/api/environments/Environments-4",
        "Project": "/api/projects/Projects-202",
        "Task": "/api/tasks/ServerTasks-7278",
        "Web": "/app#/deployments/Deployments-2229",
        "Artifacts": "/api/artifacts?regarding=Deployments-2229",
        "Interruptions": "/api/interruptions?regarding=Deployments-2229",
        "Variables": "/api/variables/variableset-Deployments-2229"
      }
    },
    {
      "Id": "Deployments-1778",
      "ReleaseId": "Releases-1077",
      "EnvironmentId": "Environments-1",
      "TenantId": null,
      "ForcePackageDownload": false,
      "ForcePackageRedeployment": false,
      "SkipActions": [],
      "SpecificMachineIds": [],
      "ExcludedMachineIds": [],
      "DeploymentProcessId": "deploymentprocess-Projects-202-s-22-GR84P",
      "ManifestVariableSetId": "variableset-Deployments-1778",
      "TaskId": "ServerTasks-3424",
      "ProjectId": "Projects-202",
      "ChannelId": "Channels-202",
      "UseGuidedFailure": false,
      "Comments": null,
      "FormValues": {},
      "QueueTime": null,
      "QueueTimeExpiry": null,
      "Name": "Deploy to Development",
      "Created": "2017-04-24T05:10:47.743+00:00",
      "Links": {
        "Self": "/api/deployments/Deployments-1778",
        "Release": "/api/releases/Releases-1077",
        "Environment": "/api/environments/Environments-1",
        "Project": "/api/projects/Projects-202",
        "Task": "/api/tasks/ServerTasks-3424",
        "Web": "/app#/deployments/Deployments-1778",
        "Artifacts": "/api/artifacts?regarding=Deployments-1778",
        "Interruptions": "/api/interruptions?regarding=Deployments-1778",
        "Variables": "/api/variables/variableset-Deployments-1778"
      }
    }
  ],
  "Links": {
    "Self": "/api/releases/Releases-1077/deployments",
    "Template": "/api/releases/Releases-1077/deployments",
    "Page.All": "/api/releases/Releases-1077/deployments?skip=0&take=2147483647",
    "Page.Current": "/api/releases/Releases-1077/deployments?skip=0&take=2147483647",
    "Page.Last": "/api/releases/Releases-1077/deployments?skip=0&take=2147483647"
  }
}