Error on "Create/Upgrade Database"

Hello

I'm helping on a upgrade platform from V10.0.405.0 to V11 (first release).

On Configuration Tools step where we have to update the database entities, we are having this error:

After analyzing on database side the errors logs, we noted that this error is happing because the Configuration Tools is trying to delete some records from "ossys_platformconfig" table, but this table doesn't exist.
Anybody know what could be the problem? 

Hi Tiago,

I personally never faced this problem before. But let me ask a few questions to clarify the issue you are having: 

  • This is for MS SQL Server, correct?
  • Have you or the DBA directly modified anything on the main OutSystems database? 
  • Does this error message actually stop you from upgrading the Database or upgrade is otherwise correctly performed?
  • Any particular reason you are upgrading your platform to the first release of O11 when there are newer versions that address some important issues found in previous versions of O11?

I've also taken the liberty of pointing this topic to some very knowledgeable people and hopefully that can chime in here.

Hi Tiago, 

I am also not facing this kind of issue. The server is On-premises or Clouds server. I hope it is on-premises.  I think it is due to database migration issues. Means did you upgrade the SQL server to the compatible version with the OutSystems platform.

Please check it.  I hope it will be resolved.


Thank you,

Sudip


Jorge Martins wrote:

Hi Tiago,

I personally never faced this problem before. But let me ask a few questions to clarify the issue you are having: 

  • This is for MS SQL Server, correct?
  • Have you or the DBA directly modified anything on the main OutSystems database? 
  • Does this error message actually stop you from upgrading the Database or upgrade is otherwise correctly performed?
  • Any particular reason you are upgrading your platform to the first release of O11 when there are newer versions that address some important issues found in previous versions of O11?

I've also taken the liberty of pointing this topic to some very knowledgeable people and hopefully that can chime in here.


Hi Jorge

Yes, we are using SQL Server 2016 Datacenter version. 

We didn't modify any plataform entity, when we noted that the reason of the problem was related this table, we had looked to the DEV database to compare (we are trying to upgrade pre-prod environment first) and there isn't this table there.

In the first moment, we tried to upgrade to the last v11 release, after this error that stop the progress, we had uninstall and tried to install the firsr release of the v11 with the expectation that the problem was we couldn't upgrade directly to the last version because this table, probably is created in a release before, but the problem still.





Sudip Dey wrote:

Hi Tiago, 

I am also not facing this kind of issue. The server is On-premises or Clouds server. I hope it is on-premises.  I think it is due to database migration issues. Means did you upgrade the SQL server to the compatible version with the OutSystems platform.

Please check it.  I hope it will be resolved.


Thank you,

Sudip


Hi

We have the SQL Sever 2016 that is compatible with the requeriments.

The platform is onpremisse in the client aws cloud.


Sudip Dey wrote:

I hope this link will help you,

https://support.microsoft.com/en-in/help/2020724/the-given-key-was-not-present-in-the-dictionary-error-message-when-usi

But we never used Oracle before here.

And we didn't change any table of the platform 

Hi Tiago,

We've had a similar issue while upgrading from Platform 10 to 11. We've had help from OutSystems Support in order to go around this database error, since it was a product defect on their end.

Can you answer some questions for me in order to check if you have the same issue.

  • Are you migrating your environment from 10 to 11 using a Database Clone?
  • Are you deployment zones in your environment?
  • And if you are using deployment zones, do you have a different deployment zone, other than "Global zone", configured as your default deployment zone?

Let me know if this is the case and I'm sure I'll be able to help you further.

Regards,

Nordin

Nordin Ahdi wrote:

Hi Tiago,

We've had a similar issue while upgrading from Platform 10 to 11. We've had help from OutSystems Support in order to go around this database error, since it was a product defect on their end.

Can you answer some questions for me in order to check if you have the same issue.

  • Are you migrating your environment from 10 to 11 using a Database Clone?
  • Are you deployment zones in your environment?
  • And if you are using deployment zones, do you have a different deployment zone, other than "Global zone", configured as your default deployment zone?

Let me know if this is the case and I'm sure I'll be able to help you further.

Regards,

Nordin

Hi Nordin

Thanks in advanced with your help.

We already started a support ticket with OutSystems and waiting for the answers.

Regarding your questions, please, see below the answers:

  • Are you migrating your environment from 10 to 11 using a Database Clone?

   Yes, It is a pre-prod environment where a clone from production was made to build this environment.

  • Are you deployment zones in your environment?

   Not in this environment, but as the clone is from production, in the past we had some zones configured that were removed following the clone procedures from OutSystems doc. The most strange is that this table is on the clone OutSystems procedure doc, but only on v 11, if you see the same doc to v 10, there is no recommendation to remove records from this table, where I suppose that this table was added on v11, not on v10.

  • And if you are using deployment zones, do you have a different deployment zone, other than "Global zone", configured as your default deployment zone?

  For now, we have only the GLobal zone on this environment.

Regards

Tiago Vital

Hi Tiago,

Ok, it sure sounds like the same issue we've had.

The v10 production environment from which the database clone was made, must have had another deployment zone other than the Global zone configured as your default zone. 

In order to check this please do the following:

After restoring the database clone to your v11 pre-prod environment, you have run the clean up scripts provided in the Migration documentation (which also cleans the contents of OSSYS_Zone table), but according to OutSystems Support the Configuration Tool is looking at the Default Zone site property value of the Service Center module in order to upgrade the deployment zone (which is deleted at this point if it was not the Global zone). In our case, this caused the Database error to occur during the upgrade of the Database schema from v10 to v11 in the Configuration tool.

So if the above also applies to your case, you should be able to unblock your issue. 

Make sure the Default Zone site property of Service Center in your v10 Production environment is set to 0, before you make the Database clone. After that, you can restore the Database clone to our v11 Pre-Prod environment and you should be able to upgrade the Database schemas from the Configuration tool.

Let us know if it works.

Regards,

Nordin 

Hi Tiago,

"The most strange is that this table is on the clone OutSystems procedure doc, but only on v 11, if you see the same doc to v 10, there is no recommendation to remove records from this table, where I suppose that this table was added on v11, not on v10."

About your above remark. In platform v10 the OSSYS_Zone table existed where all the deployment zones where saved. This table does not exists anymore in platform v11, where this kind of information is now saved in the OSSYS_PlatformConfig table.

Regards,

Nordin

Nordin Ahdi wrote:

Hi Tiago,

"The most strange is that this table is on the clone OutSystems procedure doc, but only on v 11, if you see the same doc to v 10, there is no recommendation to remove records from this table, where I suppose that this table was added on v11, not on v10."

About your above remark. In platform v10 the OSSYS_Zone table existed where all the deployment zones where saved. This table does not exists anymore in platform v11, where this kind of information is now saved in the OSSYS_PlatformConfig table.

Regards,

Nordin

Exactly, I mean the table "OSSYS_PlatformConfig" that the Configuration Tools from v11 try to remove some records during the upgrade. If We are upgrading from v10 to v11, the Configuration Tools should´t try to do this, because this table does´t exist yet.


Nordin Ahdi wrote:

Hi Tiago,

Ok, it sure sounds like the same issue we've had.

The v10 production environment from which the database clone was made, must have had another deployment zone other than the Global zone configured as your default zone. 

In order to check this please do the following:

After restoring the database clone to your v11 pre-prod environment, you have run the clean up scripts provided in the Migration documentation (which also cleans the contents of OSSYS_Zone table), but according to OutSystems Support the Configuration Tool is looking at the Default Zone site property value of the Service Center module in order to upgrade the deployment zone (which is deleted at this point if it was not the Global zone). In our case, this caused the Database error to occur during the upgrade of the Database schema from v10 to v11 in the Configuration tool.

So if the above also applies to your case, you should be able to unblock your issue. 

Make sure the Default Zone site property of Service Center in your v10 Production environment is set to 0, before you make the Database clone. After that, you can restore the Database clone to our v11 Pre-Prod environment and you should be able to upgrade the Database schemas from the Configuration tool.

Let us know if it works.

Regards,

Nordin 

Thanks

I will check it on the environment and let you know about the result.


Hi Tiago,

Any update on your issue? I’m curious to know if you were able to solve it.

Regards,

Nordin

Nordin Ahdi wrote:

Hi Tiago,

Any update on your issue? I’m curious to know if you were able to solve it.

Regards,

Nordin

Hi Nordin

Nothing yet, We've had tried your suggestion on Service Center, but the problem still.

Looking to the Configuration Tools log file, the problem look like be on the zones configs, that you are suspecting.

Now, we are waiting for the OutSystems support about the next steps.


Hi Tiago,

That’s interesting. Do you mind sharing your Event Viewer logs of the moment the Database error occurs in the Configuration Tool? I could compare them with our case.

If not, just wait for the update on your support case with OutSystems. It would be a big help for the community if you would update this post afterwards.

Thanks for getting back at me,

Nordin



Nordin Ahdi wrote:

Hi Tiago,

That’s interesting. Do you mind sharing your Event Viewer logs of the moment the Database error occurs in the Configuration Tool? I could compare them with our case.

If not, just wait for the update on your support case with OutSystems. It would be a big help for the community if you would update this post afterwards.

Thanks for getting back at me,

Nordin



Hi Nordin

I can share the exception we are having:

[1] [Data] Running script inside transaction OutSystems.Internal.Db.PrivateManagedTransaction
 [1] [Data] DELETE FROM OSSYS_PLATFORMCONFIG
 [1] [Data] Running script inside transaction OutSystems.Internal.Db.PrivateManagedTransaction
 [1] [Data] UPDATE [dbo].ossys_parameter SET [Val]='10.0.30999.100' WHERE name='lastupgradeversion'
 [1] [ERROR] Exception while trying to execute sql
 [1] [ERROR] The given key was not present in the dictionary.
 [1] [ERROR] [1] System.Collections.Generic.KeyNotFoundException
 [1] [ERROR] Target : System.ThrowHelper.ThrowKeyNotFoundException
 [1] [ERROR] Source : mscorlib
 [1] [ERROR] Message : The given key was not present in the dictionary.
 [1] [ERROR] Stack Trace
 [1] [ERROR]   at System.ThrowHelper.ThrowKeyNotFoundException()
 [1] [ERROR]   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
 [1] [ERROR]   at OutSystems.HubEdition.ConfigurationTool.SpecificUpgrades.UpgradeDeploymentZones.Upgrades.UpgradeDefaultZone()
 [1] [ERROR]   at OutSystems.HubEdition.ConfigurationTool.SpecificUpgrades.UpgradeDeploymentZones.Upgrade(IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout)
 [1] [ERROR]   at OutSystems.HubEdition.ConfigurationTool.DBConfigurationTool.ExecuteSpecificUpgrader(String className, IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout)
 [1] [ERROR]   at OutSystems.HubEdition.ConfigurationTool.DBConfigurationTool.ExecutePreprocessedStatement(IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout, String statement, ActionType action)
 [1] [ERROR]   at OutSystems.HubEdition.ConfigurationTool.DBConfigurationTool.ExecuteSqlStatement(IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout, String statement, ActionType action)
 [1] [ERROR] An exception occurred while trying to update the runtime schema
 [1] [ERROR] Database Error: Database error - The given key was not present in the dictionary.
 [1] [ERROR] [1] OutSystems.RuntimeCommon.HEMessageException
 [1] [ERROR] Target : OutSystems.HubEdition.ConfigurationTool.DBConfigurationTool.ExecuteSqlStatement
 [1] [ERROR] Source : ConfigurationTool
 [1] [ERROR] Message : Database Error: Database error - The given key was not present in the dictionary.
 [1] [ERROR] Stack Trace
 [1] [ERROR]   at OutSystems.HubEdition.ConfigurationTool.DBConfigurationTool.ExecuteSqlStatement(IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout, String statement, ActionType action)
 [1] [ERROR]   at OutSystems.HubEdition.ConfigurationTool.Schema.#Nac(DBUserType dbUser, IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout, ActionType action, Boolean automaticMode, ITwoUserDatabaseConfigurationManager manager, String& executing)
 [1] [ERROR]   at OutSystems.HubEdition.ConfigurationTool.ConfigurationFrmCode.#Nac(DBUserType dbUser, IDatabaseAccessProvider`1 dbAccess, Boolean hasDatabaseConfiguration, ITwoUserDatabaseConfigurationManager configManager, ITwoUserDatabaseConfiguration dbConfig)

After we have the fix, I can share the result to help who will start the upgrade too.

Best regards

Tiago Vital

Hi Tiago,

Thanks for sharing the log.
I like to think I was pointing you in the right direction. Your log shows a similar error stack with regard to the upgrade of Deployment Zones and the Default Zone. I definitely see a lot of similarities with the log from our case.

Here’s a snippet:

2019-12-13 10:59:25.9304 [1] [Data] Running script inside transaction OutSystems.Internal.Db.PrivateManagedTransaction
2019-12-13 10:59:25.9304 [1] [Data] UPDATE [dbo].ossys_parameter SET [Val]='10.0.30999.100' WHERE name='lastupgradeversion'
2019-12-13 10:59:25.9929 [1] [ERROR] Exception while trying to execute sql
2019-12-13 10:59:25.9929 [1] [ERROR] The given key was not present in the dictionary.
2019-12-13 10:59:25.9929 [1] [ERROR] [1] System.Collections.Generic.KeyNotFoundException
2019-12-13 10:59:25.9929 [1] [ERROR] Target : System.ThrowHelper.ThrowKeyNotFoundException
2019-12-13 10:59:25.9929 [1] [ERROR] Source : mscorlib
2019-12-13 10:59:25.9929 [1] [ERROR] Message : The given key was not present in the dictionary.
2019-12-13 10:59:25.9929 [1] [ERROR] Stack Trace
2019-12-13 10:59:25.9929 [1] [ERROR]    at System.ThrowHelper.ThrowKeyNotFoundException()
2019-12-13 10:59:25.9929 [1] [ERROR]    at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
2019-12-13 10:59:25.9929 [1] [ERROR]    at OutSystems.HubEdition.ConfigurationTool.SpecificUpgrades.UpgradeDeploymentZones.cfg#qeecwkgr.cfg#eewbkbec()
2019-12-13 10:59:25.9929 [1] [ERROR]    at OutSystems.HubEdition.ConfigurationTool.SpecificUpgrades.UpgradeDeploymentZones.Upgrade(IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout)
2019-12-13 10:59:25.9929 [1] [ERROR]    at OutSystems.HubEdition.ConfigurationTool.DBConfigurationTool.ExecuteSpecificUpgrader(String className, IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout)
2019-12-13 10:59:25.9929 [1] [ERROR]    at OutSystems.HubEdition.ConfigurationTool.DBConfigurationTool.ExecutePreprocessedStatement(IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout, String statement, ActionType action)
2019-12-13 10:59:25.9929 [1] [ERROR]    at OutSystems.HubEdition.ConfigurationTool.DBConfigurationTool.ExecuteSqlStatement(IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout, String statement, ActionType action)
2019-12-13 10:59:26.0398 [1] [ERROR] An exception occurred while trying to update the runtime schema
2019-12-13 10:59:26.0398 [1] [ERROR] Database Error: Database error - The given key was not present in the dictionary.
2019-12-13 10:59:26.0398 [1] [ERROR] [1] OutSystems.RuntimeCommon.HEMessageException
2019-12-13 10:59:26.0398 [1] [ERROR] Target : OutSystems.HubEdition.ConfigurationTool.DBConfigurationTool.ExecuteSqlStatement
2019-12-13 10:59:26.0398 [1] [ERROR] Source : ConfigurationTool
2019-12-13 10:59:26.0398 [1] [ERROR] Message : Database Error: Database error - The given key was not present in the dictionary.
2019-12-13 10:59:26.0398 [1] [ERROR] Stack Trace
2019-12-13 10:59:26.0398 [1] [ERROR]    at OutSystems.HubEdition.ConfigurationTool.DBConfigurationTool.ExecuteSqlStatement(IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout, String statement, ActionType action)
2019-12-13 10:59:26.0398 [1] [ERROR]    at OutSystems.HubEdition.ConfigurationTool.Schema.UpdateSchema(DBUserType dbUser, IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout, ActionType action, Boolean automaticMode, ITwoUserDatabaseConfigurationManager manager, String& executing)


You might be helping OutSystems support by pointing them to our solved support case with id #2283242.

Regards,

Nordin

Nordin Ahdi wrote:

Hi Tiago,

Thanks for sharing the log.
I like to think I was pointing you in the right direction. Your log shows a similar error stack with regard to the upgrade of Deployment Zones and the Default Zone. I definitely see a lot of similarities with the log from our case.

Here’s a snippet:

2019-12-13 10:59:25.9304 [1] [Data] Running script inside transaction OutSystems.Internal.Db.PrivateManagedTransaction
2019-12-13 10:59:25.9304 [1] [Data] UPDATE [dbo].ossys_parameter SET [Val]='10.0.30999.100' WHERE name='lastupgradeversion'
2019-12-13 10:59:25.9929 [1] [ERROR] Exception while trying to execute sql
2019-12-13 10:59:25.9929 [1] [ERROR] The given key was not present in the dictionary.
2019-12-13 10:59:25.9929 [1] [ERROR] [1] System.Collections.Generic.KeyNotFoundException
2019-12-13 10:59:25.9929 [1] [ERROR] Target : System.ThrowHelper.ThrowKeyNotFoundException
2019-12-13 10:59:25.9929 [1] [ERROR] Source : mscorlib
2019-12-13 10:59:25.9929 [1] [ERROR] Message : The given key was not present in the dictionary.
2019-12-13 10:59:25.9929 [1] [ERROR] Stack Trace
2019-12-13 10:59:25.9929 [1] [ERROR]    at System.ThrowHelper.ThrowKeyNotFoundException()
2019-12-13 10:59:25.9929 [1] [ERROR]    at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
2019-12-13 10:59:25.9929 [1] [ERROR]    at OutSystems.HubEdition.ConfigurationTool.SpecificUpgrades.UpgradeDeploymentZones.cfg#qeecwkgr.cfg#eewbkbec()
2019-12-13 10:59:25.9929 [1] [ERROR]    at OutSystems.HubEdition.ConfigurationTool.SpecificUpgrades.UpgradeDeploymentZones.Upgrade(IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout)
2019-12-13 10:59:25.9929 [1] [ERROR]    at OutSystems.HubEdition.ConfigurationTool.DBConfigurationTool.ExecuteSpecificUpgrader(String className, IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout)
2019-12-13 10:59:25.9929 [1] [ERROR]    at OutSystems.HubEdition.ConfigurationTool.DBConfigurationTool.ExecutePreprocessedStatement(IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout, String statement, ActionType action)
2019-12-13 10:59:25.9929 [1] [ERROR]    at OutSystems.HubEdition.ConfigurationTool.DBConfigurationTool.ExecuteSqlStatement(IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout, String statement, ActionType action)
2019-12-13 10:59:26.0398 [1] [ERROR] An exception occurred while trying to update the runtime schema
2019-12-13 10:59:26.0398 [1] [ERROR] Database Error: Database error - The given key was not present in the dictionary.
2019-12-13 10:59:26.0398 [1] [ERROR] [1] OutSystems.RuntimeCommon.HEMessageException
2019-12-13 10:59:26.0398 [1] [ERROR] Target : OutSystems.HubEdition.ConfigurationTool.DBConfigurationTool.ExecuteSqlStatement
2019-12-13 10:59:26.0398 [1] [ERROR] Source : ConfigurationTool
2019-12-13 10:59:26.0398 [1] [ERROR] Message : Database Error: Database error - The given key was not present in the dictionary.
2019-12-13 10:59:26.0398 [1] [ERROR] Stack Trace
2019-12-13 10:59:26.0398 [1] [ERROR]    at OutSystems.HubEdition.ConfigurationTool.DBConfigurationTool.ExecuteSqlStatement(IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout, String statement, ActionType action)
2019-12-13 10:59:26.0398 [1] [ERROR]    at OutSystems.HubEdition.ConfigurationTool.Schema.UpdateSchema(DBUserType dbUser, IDatabaseAccessProvider`1 dbAccess, Transaction trans, Int32 timeout, ActionType action, Boolean automaticMode, ITwoUserDatabaseConfigurationManager manager, String& executing)


You might be helping OutSystems support by pointing them to our solved support case with id #2283242.

Regards,

Nordin

Hi Nordin

Just to update you.

We still waiting for OutSystems support answers ok.

We already updated the ticket telling your case number.

While we are waiting for some asnwer, We are trying many other workaround, one of them allowed us to pass of the upgrade database, basically, we had to insert the old records into the ossys_zone and ossys_server_zone tables that we had to remove after the database restore following the OutSystems database clone procedure and we had also to update the zone_id of the ossys_espace.

Now, we are blocked with this issue reported on this another discussion. https://www.outsystems.com/forums/discussion/47557/error-dialog-when-click-apply-and-exit-in-the-configuration-tool/#Post221491

After click on Apply/Exit, we have the same error of this reported issue.



Hi Tiago,

Thanks for the update.

Good that you found a workaround to bypass the Database error.

I haven’t seen the error you’re currently facing before. Did you check the ConfigurationTool.log for more details? 

The log is by default located in C:\Windows\Temp\ on the server.

Regards,

Nordin


Nordin Ahdi wrote:

Hi Tiago,

Thanks for the update.

Good that you found a workaround to bypass the Database error.

I haven’t seen the error you’re currently facing before. Did you check the ConfigurationTool.log for more details? 

The log is by default located in C:\Windows\Temp\ on the server.

Regards,

Nordin



This is the log output:

Best regards

Tiago Vital

Hi Tiago,

This error is indeed new to me. Again, the configuration tool is looking for information that isn't there.

I would wait on OutSystems support for this one.

Thanks for updating this post!

Regards,

Nordin