Cannot open Web Portal

Hi, I recently installed Octopus Server (x64, latest) on my Windows 10 workstation, but when I open the Web Portal I get an error:

Cannot create and populate list type System.Collections.Generic.IReadOnlyList`1[Octopus.Core.Model.Spaces.Space]. Path ‘’.

I have tried to repair and uninstall/delete/re-install. I also tried going back to the LTS version, but nothing works.

The error seems to be related to JSON-deserialization, so I checked the [dbo].[Spaces] table in the database and found one (1) row with a JSON column containing {“Description”: null }.

So, what is going on here?

Windows 10 Ent (17763) + Sql Server 2017 (dev ed). Plenty of ram and disk

From the log after starting the service:

2019-12-30 12:13:43.2873 5020 13 INFO There are no tasks currently executing on nodes that are missing.
2019-12-30 12:13:43.3033 5020 13 INFO There are no stale worker leases.
2019-12-30 12:13:43.4593 5020 11 ERROR Error when running scheduled task: Octopus.Server.Schedules.RunOnAScheduleAdapter1[Octopus.Server.Schedules.SynchronizeExternalSecurityGroupsForUsers] Newtonsoft.Json.JsonSerializationException: Cannot create and populate list type System.Collections.Generic.IReadOnlyList1[Octopus.Core.Model.Spaces.Space]. Path ‘’.
ved Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewList(JsonReader reader, JsonArrayContract contract, Boolean& createdFromNonDefaultCreator)
ved Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
ved Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
ved Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
ved Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)
ved Octopus.Core.RelationalStorage.Caching.Cloner.Clone[T](T unclonedTable, Boolean rootIsArray) i C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Core\RelationalStorage\Caching\TableCloner.cs:linje 40
ved Octopus.Core.RelationalStorage.Caching.CloningRawFullTableCache.Get[T](IQueryExecutor trn, IEnumerable1 partitions, Func2 filter) i C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Core\RelationalStorage\Caching\CloningRawFullTableCache.cs:linje 24
ved Octopus.Server.Spaces.SpacesCache.Initialise() i C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Spaces\SpacesCache.cs:linje 35

And after trying to open WebPortal:

2019-12-30 12:13:46.6793 5020 5 ERROR Unhandled error on request: http://redacted/api 295f1ef9422b4228848b49ecf7bb617b by : Cannot create and populate list type System.Collections.Generic.IReadOnlyList1[Octopus.Core.Model.Spaces.Space]. Path ''. Newtonsoft.Json.JsonSerializationException: Cannot create and populate list type System.Collections.Generic.IReadOnlyList1[Octopus.Core.Model.Spaces.Space]. Path ‘’.
ved Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewList(JsonReader reader, JsonArrayContract contract, Boolean& createdFromNonDefaultCreator)
ved Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
ved Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) etc.

Hi @mpr,

Thanks for getting in touch!

The issue looks to be a problem with the Newtonsoft.Json.dll; this issue had only come up a couple of times before and in each case the user resolved it by installing on a new machine before we arrived at a solution.

Was your Octopus Server working previously, and this occurred following an upgrade?
Or is this a fresh install that has never worked?

To get us started would you be able to generate a process dump and upload to the Support section of your profile on https://octopus.com/.
e.g.

Also, one thing that would be worth checking is to see if there is another version of Newtonsoft.Json.dll installed in the GAC of the Octopus server. You can check this by searching for a file named Newtonsoft.Json.dll within the C:\Windows\assembly directory on the Octopus server.

I look forward to hearing from you.

Best regards,
Paul

Hi Paul

It’s a fresh install. I tried the Fast Lane (x64) version first, and having no luck, I tried the LTS - same result.

The included Newtonsoft.Json.dll is version 11.0.2.21924, which is also the version Octopus.Server has loaded (according to the minidump, uploaded to my profile as per your instructions - full dump is a ½ gb, which I’m not going to upload)

I found Newtonsoft v12.0.2 and v.6.5.? in Native Images_64. Tried removing them and restarting the service. Same result.

Then removed server-instance through server manager, deleted database, deleted c:\octopus folder , disabled antivirus (because why not), ran server manager and created new instance (asserted that octopus.manager.server.exe loads Newtonsoft 11.0.2.21924), start and run. Same result.

I’m thinking it’s the data written to the database which is somehow corrupted. I’m on a Windows 10 - I read that some features are disabled, could that somehow influence the configuration data?

Hi @mpr,

I’ve just run an install of Octopus on my Win 10 machine, and it is loading up ok. We don’t actively test or support Windows 10 though, so it wouldn’t be surprising if it acted differently on different variants of Win 10 or something else environmental was conflicting with this.

I can raise this with our engineers to take a look at, with the holiday it will likely be next week before I get any response though.

If you can install it in a different environment or VM that may get you up and running more quickly.

Regards,
Paul