ShannonN
(Shannon N)
14 June 2023 16:15
1
Yesterday evening we upgrade our production version from 2021.1.7787 to 2032.2.12046. The upgrade appeared to go well as no core functionality was impacted; however, today we began to receive complaints that the API ‘Project’ calls are not functioning as expected.
Checking ‘System Integrity’ shows that the schema updates didn’t go as planned (see attached) even though the deployment didn’t report errors.
Post - Install Issues.txt (5.4 KB)
We need guidance as soon as possible as the API issue is blocking several integrations
Hi @ShannonN ,
Thanks for reaching out to Octopus Support, and I’m sorry to see you’re experiencing these issues after upgrading. We had someone internally create a Zendesk issue for this as well with Amjad. If it’s ok with you we can continue troubleshooting there and we can post the eventual resolution back here in case it helps other users.
Please let me know if you have any questions.
Thanks!
Dan
A quick note to anyone reading this message who are getting the same error after upgrading to 2023.2.
We have identified the issue and have created a Public GitHub Issue below, there is a workaround in place which involves running a DB commit command (all details in the GitHub issue). Please carefully read the issue, ensure it is related to the 500 error you are experiencing and then take a DB backup (you do not have to encrypt your master key) before you run any commands.
opened 02:59AM - 15 Jun 23 UTC
kind/bug
### Severity
Blocking Issue
### Version
2023.2.2172
### Latest Version
I co… uld reproduce the problem in the latest build
### What happened?
After upgrading to 2023.2.X, users are unable to view certain projects causing deployments to fail which rely on them and are seeing the `Object Reference not set to an instance of an object` error.
### Reproduction
Set Deployment Process ConnectivityPolicy to NULL
Upgrade and see issue
### Error and Stacktrace
```shell
"HTTP" "GET" to "octo.domain.local""/api/Spaces-1/projects" "completed" with 500 in 00:00:03.2736683 (3273ms) by "finnocto"
System.NullReferenceException: Object reference not set to an instance of an object.
at Octopus.Server.Web.Mapping.Mappings.DeploymentSettingsMappings.MapFromDeploymentSettingsToDeploymentSettingsResource.MapToNewDeploymentConnectivityPolicy(DeploymentSettings source) in ./source/Octopus.Server/Web/Mapping/Mappings/DeploymentSettingsMappings/MapFromDeploymentSettingsToDeploymentSettingsResource.cs:line 93
at Octopus.Server.Web.Mapping.Mappings.DeploymentSettingsMappings.MapFromDeploymentSettingsToDeploymentSettingsResource.Map(DeploymentSettings source, CancellationToken cancellationToken) in ./source/Octopus.Server/Web/Mapping/Mappings/DeploymentSettingsMappings/MapFromDeploymentSettingsToDeploymentSettingsResource.cs:line 56
at Octopus.Core.Features.Projects.GetProjectsRequestHandler.PolyfillDeploymentSettings(IEnumerable`1 projectResources, CancellationToken cancellationToken) in ./source/Octopus.Core/Features/Projects/GetProjectsRequestHandler.cs:line 85
at Octopus.Core.Features.Projects.GetProjectsRequestHandler.Handle(GetProjectsRequest request, CancellationToken cancellationToken) in ./source/Octopus.Core/Features/Projects/GetProjectsRequestHandler.cs:line 65
at Octopus.Core.Infrastructure.Mediator.AutofacMediator.Request[TRequest,TResponse](IRequest`2 request, CancellationToken cancellationToken) in ./source/Octopus.Core/Infrastructure/Mediator/AutofacMediator.cs:line 37
at Octopus.Core.Infrastructure.Mediator.Decorators.SystemComponentModelValidationDecorator.Request[TRequest,TResponse](IRequest`2 request, CancellationToken cancellationToken) in ./source/Octopus.Core/Infrastructure/Mediator/Decorators/SystemComponentModelValidationDecorator.cs:line 60
at Octopus.Core.Infrastructure.Mediator.Decorators.FluentValidationsDecorator.Request[TRequest,TResponse](IRequest`2 request, CancellationToken cancellationToken) in ./source/Octopus.Core/Infrastructure/Mediator/Decorators/FluentValidationsDecorator.cs:line 78
at Octopus.Core.Infrastructure.Mediator.Decorators.MessageBusSiphoningDecorator.Request[TRequest,TResponse](IRequest`2 request, CancellationToken cancellationToken) in ./source/Octopus.Core/Infrastructure/Mediator/Decorators/MessageBusSiphoningDecorator.cs:line 37
at Octopus.Server.Web.Controllers.Projects.GetProjectsController.GetProjects(GetProjectsRequest request, CancellationToken cancellationToken) in ./source/Octopus.Server/Web/Controllers/Projects/GetProjectsController.cs:line 27
at lambda_method21658(Closure , Object )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
```
### More Information
_No response_
### Workaround
The following queries can be ran against the DB to confirm and resolve this issue. Please make sure to take a backup of your DB and Master Key and consult with your DBA before running any queries.
To find Projects with NULL ConnectivityPolicy:
```
SELECT Id, JSON_QUERY([JSON], '$.ConnectivityPolicy')
FROM [dbo].[DeploymentSettings]
WHERE JSON_QUERY([JSON], '$.ConnectivityPolicy') is null
```
To modify NULL to the default ConnectivityPolicy:
```
BEGIN TRAN
UPDATE dbo.DeploymentSettings
SET JSON = JSON_MODIFY([JSON],'$.ConnectivityPolicy',JSON_QUERY('{"SkipMachineBehavior":"None","TargetRoles":[],"AllowDeploymentsToNoTargets":true,"ExcludeUnhealthyTargets":false}'))
WHERE JSON_QUERY([JSON], '$.ConnectivityPolicy') IS NULL;
ROLLBACK TRAN
```
(Change ROLLBACK to COMMIT to action the change)
Please reach out to [support@octopus.com](support@octopus.com) with any questions or issues!
If you are unsure if the error is related to that GitHub issue please reach out to Support at support@octopus.com and we would be happy to help.
Kind Regards,
Clare
system
(system)
Closed
16 July 2023 07:54
5
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.