Форум АО "ВЗЛЕТ"

Автоматизация и диспетчеризация => Взлет СП4 => Тема начата: sadux от 03.05.2023, 17:29:58



Название: Ошибка с БД Firebird при обновлении до 4.0.42.7
Отправлено: sadux от 03.05.2023, 17:29:58
Добрый день!
Имеется установленный СП4 предпоследней версии с БД Firebird. Штатно решили обновиться до 4.0.42.7 и получили такую ошибку:
Код:
Ошибка
Сообщение:
Нельзя создать 'Index' 'iEquipProperty1'. Предок: 'EquipProperty'. Ошибка: Исполнение Sql 'create unique index "iEquipProperty1" on "EquipProperty"("EquipId","Name")' с параметрами '' исключение 'FirebirdSql.Data.FirebirdClient.FbException (0x80004005): attempt to store duplicate value (visible to active transactions) in unique index "iEquipProperty1"
Problematic key value is ("EquipId" = 34, "Name" = 'State.Table_TSRV_024M_Present_Hour.ScopeVersion.Y2019M11')
 ---> attempt to store duplicate value (visible to active transactions) in unique index "iEquipProperty1"
Problematic key value is ("EquipId" = 34, "Name" = 'State.Table_TSRV_024M_Present_Hour.ScopeVersion.Y2019M11')
   at FirebirdSql.Data.FirebirdClient.FbTransaction.Commit()
   at FirebirdSql.Data.FirebirdClient.FbCommand.CommitImplicitTransaction()
   at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteNonQuery()
   at DevExpress.Xpo.Logger.LogManager.Log[T](String category, LogHandler`1 handler, MessageHandler`1 createMessageHandler)
   at DevExpress.Xpo.DB.ConnectionProviderSql.ExecSql(Query query)'
 
Подробности:
   at DevExpress.Xpo.DB.ConnectionProviderSql.ExecuteSqlSchemaUpdate(String objectTypeName, String objectName, String parentObjectName, String textSql)
   at DevExpress.Xpo.DB.ConnectionProviderSql.CreateIndex(DBTable table, DBIndex index)
   at DevExpress.Xpo.DB.FirebirdConnectionProvider.CreateIndex(DBTable table, DBIndex index)
   at VzljotSp.Update.SyncBase.Sync(SyncTask args)
   at VzljotSp.Update.Setup.MainForm.xkub4V3LP2Q(VspThreadWorkEventArgs  )
 
Сообщение:
Исполнение Sql 'create unique index "iEquipProperty1" on "EquipProperty"("EquipId","Name")' с параметрами '' исключение 'FirebirdSql.Data.FirebirdClient.FbException (0x80004005): attempt to store duplicate value (visible to active transactions) in unique index "iEquipProperty1"
Problematic key value is ("EquipId" = 34, "Name" = 'State.Table_TSRV_024M_Present_Hour.ScopeVersion.Y2019M11')
 ---> attempt to store duplicate value (visible to active transactions) in unique index "iEquipProperty1"
Problematic key value is ("EquipId" = 34, "Name" = 'State.Table_TSRV_024M_Present_Hour.ScopeVersion.Y2019M11')
   at FirebirdSql.Data.FirebirdClient.FbTransaction.Commit()
   at FirebirdSql.Data.FirebirdClient.FbCommand.CommitImplicitTransaction()
   at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteNonQuery()
   at DevExpress.Xpo.Logger.LogManager.Log[T](String category, LogHandler`1 handler, MessageHandler`1 createMessageHandler)
   at DevExpress.Xpo.DB.ConnectionProviderSql.ExecSql(Query query)'
 
Подробности:
   at DevExpress.Xpo.DB.ConnectionProviderSql.ExecSql(Query query)
   at DevExpress.Xpo.DB.ConnectionProviderSql.ExecuteSqlSchemaUpdate(String objectTypeName, String objectName, String parentObjectName, String textSql)
 
Сообщение:
attempt to store duplicate value (visible to active transactions) in unique index "iEquipProperty1"
Problematic key value is ("EquipId" = 34, "Name" = 'State.Table_TSRV_024M_Present_Hour.ScopeVersion.Y2019M11')
 
Подробности:
   at FirebirdSql.Data.FirebirdClient.FbTransaction.Commit()
   at FirebirdSql.Data.FirebirdClient.FbCommand.CommitImplicitTransaction()
   at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteNonQuery()
   at DevExpress.Xpo.Logger.LogManager.Log[T](String category, LogHandler`1 handler, MessageHandler`1 createMessageHandler)
   at DevExpress.Xpo.DB.ConnectionProviderSql.ExecSql(Query query)
 
Сообщение:
attempt to store duplicate value (visible to active transactions) in unique index "iEquipProperty1"
Problematic key value is ("EquipId" = 34, "Name" = 'State.Table_TSRV_024M_Present_Hour.ScopeVersion.Y2019M11')
 
Подробности:
   at FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ProcessResponse(IResponse response)
   at FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ReadResponse[TResponse]()
   at FirebirdSql.Data.Client.Managed.Version10.GdsTransaction.Commit()
   at FirebirdSql.Data.FirebirdClient.FbTransaction.Commit()

В итоге СП4 полностью неработоспособен (не может подключиться к БД с сообщением - Указанная база находится в процессе обновления), созданный перед установкой бэкап БД не восстанавливается, при попытке повторного обновления (которое пытается восстановить БД из бекапа) получаем ошибку:
Код:
Ошибка
Сообщение:
action cancelled by trigger (3) to preserve data integrity
Cannot deactivate index used by a PRIMARY/UNIQUE constraint
No message for error code 336330835 found.
 
Подробности:
   at VzljotSp.Data.VspFirebirdProviderFactory.Restore(DataSourceConfiguration configuration, String fileName)
   at VzljotSp.Update.Setup.MainForm.WorkRestoreBase(VspThreadWorkEventArgs e)
 
Сообщение:
action cancelled by trigger (3) to preserve data integrity
Cannot deactivate index used by a PRIMARY/UNIQUE constraint
No message for error code 336330835 found.
 
Подробности:
   at FirebirdSql.Data.Services.FbRestore.Execute()
   at VzljotSp.Data.VspFirebirdProviderFactory.Restore(DataSourceConfiguration configuration, String fileName)
 
Сообщение:
action cancelled by trigger (3) to preserve data integrity
Cannot deactivate index used by a PRIMARY/UNIQUE constraint
No message for error code 336330835 found.
 
Подробности:
   at FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ProcessResponse(IResponse response)
   at FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ReadResponse[TResponse]()
   at FirebirdSql.Data.Client.Managed.Version10.GdsServiceManager.Query(ServiceParameterBuffer spb, Int32 requestLength, Byte[] requestBuffer, Int32 bufferLength, Byte[] buffer)
   at FirebirdSql.Data.Services.FbService.QueryService(Byte[] items, ServiceParameterBuffer spb)
   at FirebirdSql.Data.Services.FbService.ProcessQuery(Byte[] items, ServiceParameterBuffer spb, Action`2 queryResponseAction)
   at FirebirdSql.Data.Services.FbService.Query(Byte[] items, ServiceParameterBuffer spb)
   at FirebirdSql.Data.Services.FbService.GetNextLine(ServiceParameterBuffer spb)
   at FirebirdSql.Data.Services.FbService.ProcessServiceOutput(ServiceParameterBuffer spb)
   at FirebirdSql.Data.Services.FbRestore.Execute()

Что делать?


Название: Re:Ошибка с БД Firebird при обновлении до 4.0.42.7
Отправлено: KIA от 04.05.2023, 07:26:37
Ответил личным сообщением.