I had similar issue in the past - if the "5K" on the screeshot is the size of your toec client installer, it means it was not built properly server-side. It should be over 5 Megs in size.
Check your Admin Settings -> Toec screen and see 'Client MSI Arguments'. Does it have value for all the arguments (SERVER_KEY, CA_THUMBPRINT, COM_SERVERS)? Mine was having empty SERVER_KEY due to having wrong dbencryption key in web.config.
Application log was saying "ERROR Toems_Service.EncryptionServices Could Not Decrypt Password. Ensure Your Encryption Key is Correct."
Once I've put the correct dbencryption key, the toec client installer started builing correctly.
Best posts made by Chavi
Latest posts made by Chavi
-
RE: Toec-1.5.0-x64 installation failed
-
RE: Unable to to login - System.InvalidCastException: Object cannot be cast from DBNull to other types.
There are two issues here, both seem connected to upgrading my MariaDB to 10.11.
- From MariaDB 10.6.1, the main name of the previous 3 byte utf character set has been changed to utf8mb3. This causes an error MySql.Data.MySqlClient.MySqlException: Character set 'utf8mb3' is not supported by .Net Framework.
- From MariaDB 10.10.1 the ID field has been made Nullable which appears to be causing the 'Object cannot be cast from DBNull to other types'
Unfortunately the database files have been changed and downgrading back to 10.4 and 10.5 can't read them. I would have to backup my db, recreate 10.4 or 10.5 instance and restore.
Stackoverflow suggests updating the MySql.Data package or switching to different connector like MysqlConnector.
Hopefully this will help.
-
Unable to to login - System.InvalidCastException: Object cannot be cast from DBNull to other types.
Hi, suddenly, I'm no longer able to login to the UI (with 'Unknown Error Obtaining Token' error). The logs however started showing "Object cannot be cast from DBNull to other types." error as follows:
FrontEnd.log[InvalidCastException]: Object cannot be cast from DBNull to other types. at System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider) at MySql.Data.MySqlClient.Driver.LoadCharacterSets(MySqlConnection connection) at MySql.Data.MySqlClient.Driver.Configure(MySqlConnection connection) at MySql.Data.MySqlClient.MySqlConnection.Open() at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed) at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext) at System.Data.Entity.Core.EntityClient.EntityConnection.Open() [EntityException]: The underlying provider failed on Open. at System.Data.Entity.Core.EntityClient.EntityConnection.Open() at System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection(Boolean shouldMonitorTransactions) at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess) at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass41_0.<GetResults>b__0() at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__31_0() at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source) at Toems_DataModel.GenericRepository`1.GetFirstOrDefault(Expression`1 filter, Func`2 orderBy) at Toems_Service.Entity.ServiceUser.GetUserForLogin(String userName) at Toems_Service.AuthenticationServices.GlobalLogin(String userName, String password, String loginType, String verificationCode) at Toems_ApplicationApi.SimpleAuthorizationServerProvider.GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context) at Microsoft.Owin.Security.OAuth.OAuthAuthorizationServerHandler.<InvokeTokenEndpointResourceOwnerPasswordCredentialsGrantAsync>d__10.MoveNext() in /_/src/Microsoft.Owin.Security.OAuth/OAuthAuthorizationServerHandler.cs:line 567
Application.log
System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.InvalidCastException: Object cannot be cast from DBNull to other types. at System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider) at MySql.Data.MySqlClient.Driver.LoadCharacterSets(MySqlConnection connection) at MySql.Data.MySqlClient.Driver.Configure(MySqlConnection connection) at MySql.Data.MySqlClient.MySqlConnection.Open() at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed) at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext) at System.Data.Entity.Core.EntityClient.EntityConnection.Open() --- End of inner exception stack trace --- at System.Data.Entity.Core.EntityClient.EntityConnection.Open() at System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection(Boolean shouldMonitorTransactions) at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess) at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass41_0.<GetResults>b__0() at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__31_0() at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source) at Toems_DataModel.GenericRepository`1.GetFirstOrDefault(Expression`1 filter, Func`2 orderBy) at Toems_Service.Entity.ServiceSetting.GetSetting(String settingName) at Toems_Service.Entity.ServiceSetting.GetSettingValue(String settingName) at Toems_Service.Entity.ServiceActiveImagingTask.CancelTimedOutTasks()
I have recently updated to MariaDB 4.11 (I can succesfully access the database via Heidi), other than that I haven't done anything that may have caused this. Can you help please?
-
RE: Problem with Toec Client export
Thanks for your help. This step-by-step process has done the database move successfully for me (moving to different machine/IP with same OS, same installation path, same DB provider):
ON THE SOURCE MACHINE:
- Stop IIS
- Dump theopenem database.
- Save the Toems-API\Web.config DbEncryptionKey
- Copy the database dump to the destination machine
- Restart IIS or leave down if not going to use anymore
ON THE DESTINATION MACHINE:
- Install and configure Theopenem server to make sure its working
- Open the source machine database dump in text editor and replace the source machine IP address with the destination machine IP. Save.
- Stop IIS
- Restore theopenem database dump.
- Replace the DbEncryptionKey in Toems-API\Web.config and Toec-API\Web.config with the one from the source machine (step 3)
- Restart IIS
- Update Toec-API\Web.config ComServerUniqueId with the one from Admin\Client Com Servers
- Delete the old Toems CA and Toems Intermediate certificates if existing
- Export and Install Certificates from the current database.
On the previously connected computers, deinstalling the old server' exported Toec client and reinstalling the one from the new server caused successful inventory refresh on next checkin.
-
RE: Problem with Toec Client export
No
I wasn't aware I had to. Thank you.
I will have it updated and I will repeat the entire process. Is there anything else I should be paying attention to? Previously I have noticed the old machine IP carried over in the com server and cluster, so I have deleted those and re-created them. Anything else you can think of? -
Problem with Toec Client export
Hi, my issue is most probably a result of database move. I had the server configured and working on a test workstation and once I decided to move it to a proper server, in order to save the configuration, and after having the server installed there and configured, I have moved the database from the old machine (backup/restore). Everything seems to be working and the Provision/VerifyDb Toec-API Test responds with 60. However when I export a Toec Client, I get a very small .msi file (2KB) and it can't install (err 'this installation package could not be opened...').
I have went through the config steps again (https://docs.theopenem.com/latest/#/installation/server-installation?id=configure-theopenem) and now on the 'Set Provision Key And Imaging Token', after I generate the key and token and click 'Update', I get 'Could Not Update Settings' message. The other difference with my working test machine that I have noticed, is that on the 'Toec' screen, 'Client MSI Arguments', SERVER_KEY= is empty, while on the test machine it has a value.Application log says:
2023-03-23 18:10:48,796 [130] ERROR Toems_Service.EncryptionServices Could Not Decrypt Password. Ensure Your Encryption Key is Correct.
2023-03-23 18:10:48,827 [130] ERROR Toems_Service.ServiceMsiUpdater Could Not Create Msi.
2023-03-23 18:10:48,842 [130] ERROR Toems_Service.ServiceMsiUpdater Function failed during execution.Is there a way to make it work or should I drop the database and go for full reinstall?
Thank you!