Project process is displaying error

Hi,

When trying to view the process tab for a particular project i’m met with the following error:

An unexpected error occurred in Octopus v4.1.5: “TypeError: Cannot read property ‘Id’ of undefined”

  • in t
  • in span
  • in div
  • in t
  • in div
  • in div
  • in div
  • in div
  • in t
  • in div
  • in div
  • in div
  • in div
  • in div
  • in div
  • in l
  • in div
  • in div
  • in n
  • in n
  • in Connect(n)
  • in t
  • in t
  • in t
  • in t
  • in t
  • in t
  • in div
  • in div
  • in MediaQuery
  • in div
  • in E
  • in t
  • in withRouter(E)
  • in div
  • in t
  • in Connect(t)
  • in t
  • in t
  • in t
  • in t
  • in t
  • in t
  • in withRouter(t)
  • in t
  • in t
  • in t
  • in t
  • in t
  • in r
  • in t
  • in t
  • in t
  • in t
  • in t
  • in x
  • in div
  • in t
  • in Connect(t)
  • in t
  • in t
  • in t
  • in t
  • in t
  • in t
  • in t
  • in t
  • in Provider
  • in t
  • in i
  • in t

I’ve seen a similar topic (Project Process displaying error after Upgrade to Octopus v2018.9.5) which was able to be resolved but seems like it may require a bespoke script. In the related post they asked for the results from the Chrome network diagnostics tab which I have attached.

Please let me know if any further info is required to try and get to the bottom of this

Project Process Error.txt (14.2 KB)

Hi,

Thanks for getting in touch! I’m terribly sorry you’re hitting this unexpected and inconvenient issue. We’ve shipped a lot of bug fixes since 4.1.5 to resolve various TypeErrors like this, so it’s possible an upgrade to LTS or latest will resolve this issue.

The topic you’ve linked to was due to a missing package reference in an IIS step, which looks like it could be the same issue you’re facing in the step Deploy service website which is missing the package reference.

The script to replace the package (that was included only in the email conversation) is the following. This was run on https://www.linqpad.net/ with a reference to the OctopusClient assembly. I’ve updated the relevant details in the script to match your scenario as I understand it based on the details you’ve provided, but just confirm that’s correct. :slight_smile:

void Main()
{
var serverUri = "https://my.octopus.installation";
var apiKey = "API-YOUR_API_KEY";
var deploymentProcessId = "deploymentprocess-Projects-428";
var replacementPackageName = "#{Octopus.Project.Name}";

var octopusServer = new Octopus.Client.OctopusServerEndpoint(serverUri, apiKey);
var repo = new Octopus.Client.OctopusRepository(octopusServer);

var process = repo.DeploymentProcesses.Get(deploymentProcessId);
PropertyValueResource existingVal;

foreach (var s in process.Steps)
{
foreach (var a in s.Actions)
{
if (a.ActionType == "Octopus.IIS")
{
if (!a.Properties.TryGetValue("Octopus.Action.Package.PackageId", out existingVal))
{
a.Properties["Octopus.Action.Package.PackageId"] = new PropertyValueResource(replacementPackageName);
Console.WriteLine($"inserted packagedId on {s.Name} because it was missing");
}
}
}
}

repo.DeploymentProcesses.Modify(process);
}

I hope this helps unblock you, or upgrading fixes it! Please let me know how you go or if you have any further questions moving forward.

Best regards,

Kenny

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.