Database failure on...
 
Notifications
Clear all

Database failure on automatic update script

5 Posts
2 Users
0 Reactions
1,122 Views
Posts: 13
Topic starter
(@jlight)
Eminent Member
Joined: 7 years ago

I'm trying to run the automatic update script, but I keep getting a permission error with the database.  Looking at the script it appears it's using the Enterprise Server web.config settings.  My connection string in the web.config is the login for the SolidCP database.  Does the update script require some special permissions?  When I run the script an error message appears briefly on the screen before the main menu, but it's so quick I haven't been able to capture it.

Topic Tags
4 Replies
Posts: 13
Topic starter
(@jlight)
Eminent Member
Joined: 7 years ago

I was able to capture the error message, but it doesn't make any sense.  I logged into SSMS using the credentials in my web.config and was able to run the following query without error: SELECT [ServerUrl] FROM [SolidCP].[dbo].[Servers] WHERE [VirtualServer]='0'

Invoke-SQLCmd : The SELECT permission was denied on the object 'Servers', database 'SolidCP', schema 'dbo'.
At C:\Users\admin\Desktop\SolidCP-Auto-Upgrade.ps1:298 char:45
+ ... rverIPs = ((Invoke-SQLCmd -query "SELECT [ServerUrl] FROM [$SCP_Datab ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Invoke-Sqlcmd], SqlPowerShellSqlExecutionException
    + FullyQualifiedErrorId : SqlError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand
Reply
Posts: 13
Topic starter
(@jlight)
Eminent Member
Joined: 7 years ago

I've noticed none of the Invoke-SQLCmd pass a username or password.  Has anyone been able to get the automated update script to work?  In the past I've always done my updates manually as I've never been able to get the update script to work, but someday I'd like to get the automated script to work.

Reply
Posts: 1457
Admin
(@trobinson)
Noble Member
Joined: 9 years ago

Hello,

Currently the script does expect the person who is running it has permissions via Windows login to the SQL server. Is there a reason you login for a user without access?

Regards,

Trevor

Reply
1 Reply
(@jlight)
Joined: 7 years ago

Eminent Member
Posts: 13

@trobinson Thank you. That was the issue. 

When I initially installed SolidCP it was done under the Administrator account.  As the hosting company also uses that account and regularly change passwords without informing me thereby locking me out of my server, I later created my own account and had never added it to Sql Server, instead using a Sql Server login.  I just added my account to Sql Server and I'm no longer getting errors.

Reply
Share: