Qlik Sense - Unable to start Qlik Sense Repository Service -Fatal exception relation "AppAvailabilities" already exists
Article Number: 000034418 | Last Modified: 2019/10/07
Description
After restoring your Qlik Sense Repository Database you are unable to start the Qlik Sense Repository Service. In the logs (C:\ProgramData\Qlik\Sense\Log\Repository\Trace\System.txt), you get an error similar to:
ERROR QlikServer3 System.Repository.Repository.QRSMain 9 08d86667-de36-4992-9916-d6ab5979a791 DOMAIN\qvservice Fatal exception relation "AppAvailabilities" already exists↵↓An exception was thrown while invoking the constructor 'Void .ctor()' on type 'DatabaseContext'. ---> relation "AppAvailabilities" already exists (See inner exception for details.)↵↓An exception was thrown while invoking the constructor 'Void .ctor(Qlik.Sense.Common.ITypeResolver, System.Func`1[Repository.Core.Repository.Database.Common.IDatabaseContext], Autofac.ILifetimeScope, Repository.Core.Repository.Common.ITransactionUtility, Repository.Core.Repository.Common.IRepositoryEntityCache, Repository.Core.INodeStaticInfo, Qlik.Sense.Logging.IQSLogManager, Repository.Core.Repository.Common.IRepositoryContentService, Repository.Core.Repository.Common.ILifetimeScopeEntityCache)' on type 'EntityTransactionRepository'.
Cause
This issue is caused by a lack of permissions for the qliksenserepository user making it unable to access every tables of the Qlik Sense Repository Database. During the restore process, it can happen that the owner of the tables change to "postgres" making the default user "qliksenserepository" unable to access them.
Resolution
The workaround is to change the user Qlik Sense is using to query the database from "qliksenserepository" to "postgres" To do that:
Stop the Qlik Sense Repository Service
Run the ConnectionStringEditor.exe as Administrator (Default: C:\Program Files\Qlik\Sense\Repository\Util\ConnectionStringEditor\ConnectionStringEditor.exe)
Once the tool is opened, press Read
In the Decrypted connection string panel change the UserId from qliksenserepository to postgres and make sure the password mentioned in the connection string is correct
Press Saved value above in config file encrypted and close the tool
Finally start the Qlik Sense Repository Service and make sure you do not get the error in the log C:\ProgramData\Qlik\Sense\Log\Repository\Trace\System.txt
Get Answers
Find Answers
Qlik Community
Collaborate with over 60,000 Qlik technologists and members around the world to get answers to your questions, and maximize success.
Experiencing a serious issue, please contact us by phone. For Data Integration related issues please refer to your onboarding documentation for current phone number.