Error when filtering Projects within a tenant

When filtering a project within the tenant overview, an error occurs in the UI:

An unexpected error occurred in Octopus v2018.1.3: “TypeError: Cannot read property ‘Name’ of undefined”
in t
in div
in section
in t
in div
in div
in div
in l
in div
in div
in n
in n
in Connect(n)
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 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

In our Test environment, we’ve upgraded to 2018.3.8 but the issue persists there as well.

Cheers
Leslie

Hi Leslie,

Thanks for getting in touch! I’m sorry you’re hitting this unexpected and annoying issue. Unfortunately I haven’t yet been able to reproduce this behavior. We have had similar reports in the past with the same error message but on different pages, so I am surprised the upgrade didn’t fix this. Would you be able to hard refresh (CTRL+F5) in your Test environment and try filtering by project again and let me know if that gets it up and working? Would you also be able to attach a screen recording of the repro steps taken to see this error to ensure I’m on the same page? I’d recommend the free ScreenToGif if you need it. :slight_smile:

I look forward to hearing back and getting to the bottom of this!

Kind regards,

Kenny

Hi,

I work with Leslie - I can reproduce the error on the same server as follows.

  • Click “Tenants”
  • Enter the name of the specific tenant
  • Click the specific tenant panel
  • In the tenant details page, type anything into the project name filter (e.g. “aaa”)
  • The error above is shown

Additional info in the “Show Full Detail” panel:

Octopus v2018.1.3

TypeError: Cannot read property 'Name' of undefined

items.filter (/app/areas/tenants/TenantOverview/TenantOverview.tsx:130:53)
constructor (/app/components/List/SimpleList.tsx:39:26)
render (/app/components/List/SimpleList.tsx:55:68)
render (/app/components/List/SimpleList.tsx:55:46)
Lf (/node_modules/react-dom/cjs/react-dom.production.min.js:147:337)
sf:a:{e=b.type;c=b.pendingProps;d=b.memoizedProps;if(nf())null===c&& (/node_modules/react-dom/cjs/react-dom.production.min.js:150:232)
e (/node_modules/react-dom/cjs/react-dom.production.min.js:182:349)
g (/node_modules/react-dom/cjs/react-dom.production.min.js:183:347)
p (/node_modules/react-dom/cjs/react-dom.production.min.js:184:366)

Note that I think this might be a data integrity issue where a project on our server has been deleted but there are still references to it in the “connected projects” for a specific tenant. See screenshot below for some odd-looking rows in the project list on the specific tenant.

Another colleague has done a bit of investigation with Fiddler and the API, and found that the “/api/tenants/Tenants-99” response contains the following fragment:

"ProjectEnvironments": {
  ... etc ...
  "Projects-1111": [
    "Environments-33"
  ],
  "Projects-2222": [
    "Environments-44"
  ],
  ... etc ...
},

but if I query those projects with, for example, “/api/projects/Projects-1111” I get the following response:

{
  "ErrorMessage": "The resource 'Projects-1111' was not found."
}

Hi Mike,

Thank you for following up and providing that helpful information! I was able to reproduce this issue by pointing a tenant to a project ID that doesn’t exist, so it looks like you were right on target with what you’ve found. I’ve raised the following issue to get this looked into further and resolved as soon as possible.

Thanks for your patience, and don’t hesitate to reach out if you have any further questions going forward. :slight_smile:

Kind regards,

Kenny

Hi Mike,

Thank you for the detailed report. That means it’s corrupted data we’re working on the fix, but have been unsuccessful in tracking down how this data could have been corrupted.

Does anyone there know if this instance of Octopus was part of the 3.4 beta, about 2 years ago? Or does that Projects-1111 exist in your audit logs with a date when it was created and then deleted? My objective with these questions is to narrow down a time in the code base where there may have been a bug to ensure it won’t happen again, as the fix we’re working on is to repair any existing data.

I’ll let you know when we ship the fix.

Regards,
Nick

Hi Nick,

I couldn’t work out how to filter the audit UI to show events for the deleted project, but I’ve found the following from the API. Just to make it a bit easier for me, the actual tenant id is “Tenants-61”, and one of the deleted projects is “Projects-5560”

/api/events/?projects=Projects-5560

5 events in total

  • 2017-04-07T14:06:45.975+00:00 - Project Created
  • 2017-04-07T14:07:04.886+00:00 - Project Modified
  • 2017-04-07T14:10:09.417+00:10 - Release Created
  • 2017-04-07T14:13:43.552+00:00 - Release Created
  • 2017-04-07T14:14:42.543+00:00 - Project Deleted

So it looks like the project only actually existed for about 8 minutes

/api/events/?tenants=tenants-61&from=2017-04-05&to=2017-04-30&take=5000

4124 events in total

  • … unrelated events …
  • 2017-04-07T12:40:33.693+00:00 - Tenant Modified (Projects-5560 is not listed in Details)
  • … unrelated events …
  • 2017-04-07T14:15:40.448+00:00 - Tenant Modified (Projects-5560 is listed in Details)
  • … unrelated events …

Note - the “Details” for the second event contains the following:

... etc ...
<ins style=\"background:#e6ffe6;\">
,\r&para;<br>
\"Projects-5560\"
</ins>
... etc ...
<ins style=\"background:#e6ffe6;\">
],\r&para;<br>
\"Projects-5560\": [\r&para;<br>
\"Environments-2842\",\r&para;<br>
\"Environments-2882\",\r&para;<br>
\"Environments-2843\",\r&para;<br>
\"Environments-14\",\r&para;<br>
\"Environments-15\"\r&para;<br>
</ins>
... etc ...

It looks like the narrative is that someone created the project, connected it to the tenant, and then decided they didn’t need it and so deleted it. Except that the connection was somehow saved about a minute after the project was deleted (maybe in a separate browser window?).

Hope this helps.

Cheers,

M

Thanks Mike,

Those details are perfect, thanks for investigating, I confirmed it was a bug that’s since been fixed.

We protect against that case now by checking the linked entity id’s are valid, and the upcoming fix to repair this data should sort this out completely.

Regards,
Nick

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