Database schema keeps getting corrupted

For the System Administrator and the System Manager role, the JSON schema keeps going back to the old one. i.e. The “GrantedSpacePermissions” attribute becomes “GrantedPermissions” which I believe is the old value.

Restarting the octopus server fixes it back to “GrantedSpacePermissions”.

Whenever it happens, the administrator loses much of the administrative rights as expected. We keep restarting the server every few weeks to fix this but it keeps coming back.

Please find the database records for these two roles below. Please note that this does not affect the other roles.

Id Name JSON DataVersion
userroles-systemadministrator System administrator {“Description”:“System administrators can do everything at the system level.”,“GrantedPermissions”:[“AdministerSystem”,“ProjectEdit”,“ProjectView”,“ProjectCreate”,“ProjectDelete”,“ProcessView”,“ProcessEdit”,“VariableEdit”,“VariableEditUnscoped”,“VariableView”,“VariableViewUnscoped”,“ReleaseCreate”,“ReleaseView”,“ReleaseEdit”,“ReleaseDelete”,“DefectReport”,“DefectResolve”,“DeploymentCreate”,“DeploymentDelete”,“DeploymentView”,“EnvironmentView”,“EnvironmentCreate”,“EnvironmentEdit”,“EnvironmentDelete”,“MachineCreate”,“MachineEdit”,“MachineView”,“MachineDelete”,“ArtifactView”,“ArtifactCreate”,“ArtifactEdit”,“ArtifactDelete”,“FeedView”,“EventView”,“LibraryVariableSetView”,“LibraryVariableSetCreate”,“LibraryVariableSetEdit”,“LibraryVariableSetDelete”,“ProjectGroupView”,“ProjectGroupCreate”,“ProjectGroupEdit”,“ProjectGroupDelete”,“TeamCreate”,“TeamView”,“TeamEdit”,“TeamDelete”,“UserView”,“UserInvite”,“UserRoleView”,“UserRoleEdit”,“TaskView”,“TaskViewLog”,“TaskCreate”,“TaskCancel”,“TaskEdit”,“InterruptionView”,“InterruptionSubmit”,“InterruptionViewSubmitResponsible”,“BuiltInFeedPush”,“BuiltInFeedAdminister”,“BuiltInFeedDownload”,“ActionTemplateView”,“ActionTemplateCreate”,“ActionTemplateEdit”,“ActionTemplateDelete”,“LifecycleCreate”,“LifecycleView”,“LifecycleEdit”,“LifecycleDelete”,“AccountView”,“AccountEdit”,“AccountCreate”,“AccountDelete”,“AuditView”,“TenantCreate”,“TenantEdit”,“TenantView”,“TenantDelete”,“TagSetCreate”,“TagSetEdit”,“TagSetDelete”,“MachinePolicyCreate”,“MachinePolicyView”,“MachinePolicyEdit”,“MachinePolicyDelete”,“ProxyCreate”,“ProxyView”,“ProxyEdit”,“ProxyDelete”,“SubscriptionCreate”,“SubscriptionView”,“SubscriptionEdit”,“SubscriptionDelete”,“TriggerCreate”,“TriggerView”,“TriggerEdit”,“TriggerDelete”,“CertificateView”,“CertificateCreate”,“CertificateEdit”,“CertificateDelete”,“CertificateExportPrivateKey”,“UserEdit”,“ConfigureServer”,“FeedEdit”],“CanBeDeleted”:false} 0x000000000003F73E
userroles-systemmanager System manager {“Description”:“System managers can do everything at the system level except certain system-level functions reserved for system administrators.”,“GrantedPermissions”:[“ProjectEdit”,“ProjectView”,“ProjectCreate”,“ProjectDelete”,“ProcessView”,“ProcessEdit”,“VariableEdit”,“VariableEditUnscoped”,“VariableView”,“VariableViewUnscoped”,“ReleaseCreate”,“ReleaseView”,“ReleaseEdit”,“ReleaseDelete”,“DefectReport”,“DefectResolve”,“DeploymentCreate”,“DeploymentDelete”,“DeploymentView”,“EnvironmentView”,“EnvironmentCreate”,“EnvironmentEdit”,“EnvironmentDelete”,“MachineCreate”,“MachineEdit”,“MachineView”,“MachineDelete”,“ArtifactView”,“ArtifactCreate”,“ArtifactEdit”,“ArtifactDelete”,“FeedView”,“EventView”,“LibraryVariableSetView”,“LibraryVariableSetCreate”,“LibraryVariableSetEdit”,“LibraryVariableSetDelete”,“ProjectGroupView”,“ProjectGroupCreate”,“ProjectGroupEdit”,“ProjectGroupDelete”,“TeamCreate”,“TeamView”,“TeamEdit”,“TeamDelete”,“UserView”,“UserInvite”,“UserRoleView”,“UserRoleEdit”,“TaskView”,“TaskViewLog”,“TaskCreate”,“TaskCancel”,“TaskEdit”,“InterruptionView”,“InterruptionSubmit”,“InterruptionViewSubmitResponsible”,“BuiltInFeedPush”,“BuiltInFeedAdminister”,“BuiltInFeedDownload”,“ActionTemplateView”,“ActionTemplateCreate”,“ActionTemplateEdit”,“ActionTemplateDelete”,“LifecycleCreate”,“LifecycleView”,“LifecycleEdit”,“LifecycleDelete”,“AccountView”,“AccountEdit”,“AccountCreate”,“AccountDelete”,“AuditView”,“TenantCreate”,“TenantEdit”,“TenantView”,“TenantDelete”,“TagSetCreate”,“TagSetEdit”,“TagSetDelete”,“MachinePolicyCreate”,“MachinePolicyView”,“MachinePolicyEdit”,“MachinePolicyDelete”,“ProxyCreate”,“ProxyView”,“ProxyEdit”,“ProxyDelete”,“SubscriptionCreate”,“SubscriptionView”,“SubscriptionEdit”,“SubscriptionDelete”,“TriggerCreate”,“TriggerView”,“TriggerEdit”,“TriggerDelete”,“CertificateView”,“CertificateCreate”,“CertificateEdit”,“CertificateDelete”,“CertificateExportPrivateKey”,“UserEdit”,“ConfigureServer”,“FeedEdit”],“CanBeDeleted”:false} 0x000000000003F73D

After Restart:

Id Name JSON DataVersion
userroles-systemadministrator System administrator {“Description”:“System administrators can do everything at the system level.”,“GrantedSpacePermissions”:[],“GrantedSystemPermissions”:[“AdministerSystem”,“ConfigureServer”,“EventView”,“TeamCreate”,“TeamView”,“TeamEdit”,“TeamDelete”,“TaskView”,“TaskCreate”,“TaskCancel”,“TaskEdit”,“SpaceView”,“SpaceEdit”,“SpaceCreate”,“SpaceDelete”,“UserView”,“UserInvite”,“UserRoleView”,“UserRoleEdit”,“UserEdit”],“CanBeDeleted”:false} 0x0000000000041C0C
userroles-systemmanager System manager {“Description”:“System managers can do everything at the system level except certain system-level functions reserved for system administrators.”,“GrantedSpacePermissions”:[],“GrantedSystemPermissions”:[“ConfigureServer”,“EventView”,“TeamCreate”,“TeamView”,“TeamEdit”,“TeamDelete”,“TaskView”,“TaskCreate”,“TaskCancel”,“TaskEdit”,“SpaceView”,“SpaceEdit”,“SpaceCreate”,“SpaceDelete”,“UserView”,“UserInvite”,“UserRoleView”,“UserRoleEdit”,“UserEdit”],“CanBeDeleted”:false} 0x0000000000041C0B

Hi,

Sorry to hear you are having problems.

I’d like to get a bit more information to help narrow down the problem. Could you first tell me what version of Octopus Deploy you are running?

Could you also share your log files with me? See here for information on how to find your log files.

Do you have the service watchdog enabled for your Octopus instance?

Finally, could you confirm that you only have one instance of Octopus Server running? My strong suspicion is that there are multiple Octopus Server instances sharing the same database (For example, in a high availability configuration). If you had two Octopus Server instances running different versions of Octopus Deploy, then they might conflict and each independently try to ensure the data in that UserRoles table is in the format that they each expect.

Looking forward to hearing from you,
Tom