nvisionative / nvQuickSite

nvQuickSite is a desktop installation app for DNN, the world's most popular ASP.NET-based CMS. This app allows you to easily install DNN onto any environment that meets the minimum system requirements for DNN to be installed.
http://www.nvquicksite.com
47 stars 14 forks source link

Permissions Error in Windows 11. #337

Closed tksheppard closed 3 years ago

tksheppard commented 3 years ago

Possibly related to #334 .

Clean install of Windows 11, SQL Server 2019, IIS 10, nvQuickSite 2.1.1.

image

I've tried changing the log settings, but it does the same warning each time. Closing the alert and clicking next also doesn't work (I tried lots of times).

Here is the log error:


2021-10-25 15:16:05.455 -04:00 [DBG] Permissions for IIS APPPOOL\projects.me_nvQuickSite set on folder D:\Dev\DNN\projects\Website
2021-10-25 15:16:05.455 -04:00 [DBG] Permissions for NT AUTHORITY\Authenticated Users set on folder D:\Dev\DNN\projects\Website
2021-10-25 15:16:05.456 -04:00 [ERR] Error occured while attempting to set folder permissions
System.Security.Principal.IdentityNotMappedException: Some or all identity references could not be translated.
   at System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess)
   at System.Security.Principal.NTAccount.Translate(Type targetType)
   at System.Security.AccessControl.CommonObjectSecurity.ModifyAccess(AccessControlModification modification, AccessRule rule, Boolean& modified)
   at System.Security.AccessControl.ObjectSecurity.ModifyAccessRule(AccessControlModification modification, AccessRule rule, Boolean& modified)
   at nvQuickSite.Controllers.FileSystemController.SetFolderPermission(String accountName, String folderPath)
david-poindexter commented 3 years ago

Actually @tksheppard - your logs point to a slightly different issue (though it may still be somewhat related). The key difference in yours is that permissions were successfully set for the Website folder. Yours seems to fail on the Logs folder. So my guess with yours is that something has changed in IIS that may be locking the files/folder. Do you get the same behavior when creating a NEW instance too?

tksheppard commented 3 years ago

@david-poindexter . Not sure if I understand what you're asking, but I haven't been able to create any install of DNN because this happens every time.

david-poindexter commented 3 years ago

@tksheppard I was just asking if you were attempting to create a NEW DNN instance, or attempting to replace an existing DNN instance.

tksheppard commented 3 years ago

@david-poindexter Ah. This is a completely new instance. I currently have none installed on my computer.

david-poindexter commented 3 years ago

Thanks for the clarity. We'll take a look into this. @valadas you game for co-tackling this one (and probably #334 at the same time)?

valadas commented 3 years ago

I can try to help but I am not sure how, In theory nvQuickSite has to run as an admin, so not sure why it would encounter permission issues...

david-poindexter commented 3 years ago

@tksheppard we created a test build with additional logging to help troubleshoot the issue. Since this is happening 100% of the time for you, it would be helpful if you install this version and then report back with logs when it happens again. This time, if you don't mind, include a bit more of the log just to help us see what all is going on before the error. You can download a new installer here: https://www.dropbox.com/t/HxK4OIAZBAgfeQM7

tksheppard commented 3 years ago

@david-poindexter I have uninstalled nvQuickSite, and installed the version you linked (v2.1.1.1). I made sure the directory was clear, and the IIS was clear of the desired instance. I did leave the entry in the hosts file. Here is the error I received at the same point as the last error: image

And here is the full log. This includes me closing the error and trying to click "Next" again. This explains the duplicate log entry for attempting to create the instance again. I also noticed it says my OS is Windows 10. I'm definitely on Windows 11: image


2021-10-26 11:55:07.431 -04:00 [INF] Application Started v2.1.1.1
2021-10-26 11:55:07.517 -04:00 [INF] Operating System information: Windows 10 Professional  10.0.22000.0
2021-10-26 11:55:08.565 -04:00 [INF] Loaded local packages
2021-10-26 11:55:09.023 -04:00 [INF] Internet appears to be online
2021-10-26 11:55:09.314 -04:00 [ERR] Unexpected error occurred retrieving remote packages.
System.Net.WebException: The request was aborted: The connection was closed unexpectedly.
   at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
   at System.Net.WebClient.DownloadString(Uri address)
   at nvQuickSite.Controllers.PackageController.GetRemotePackages()
2021-10-26 11:55:10.228 -04:00 [INF] Retrieved DNN packages from GitHub
2021-10-26 11:55:10.233 -04:00 [INF] Saved local packages file
2021-10-26 11:55:10.310 -04:00 [INF] Reading current user settings
2021-10-26 11:55:13.081 -04:00 [INF] Internet appears to be online
2021-10-26 11:55:14.516 -04:00 [INF] Using local install package C:\Program Files (x86)\nvisionative\nvQuickSite\Downloads\DNN_Platform_9.10.2_Install.zip
2021-10-26 11:55:15.716 -04:00 [INF] Saved user settings
2021-10-26 11:55:17.181 -04:00 [INF] Creating site projects.me in D:\Dev\DNN\projects
2021-10-26 11:55:17.242 -04:00 [INF] Created site projects.me
2021-10-26 11:55:17.254 -04:00 [INF] projects.me already in C:\Windows\system32\drivers\etc\hosts
2021-10-26 11:55:17.254 -04:00 [INF] Creating file system directories for projects.me
2021-10-26 11:55:17.257 -04:00 [ERR] Error occured while attempting to set permissions for NT Service\MSSQLSERVER on folder D:\Dev\DNN\projects\Logs
System.Security.Principal.IdentityNotMappedException: Some or all identity references could not be translated.
   at System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess)
   at System.Security.Principal.NTAccount.Translate(Type targetType)
   at System.Security.AccessControl.CommonObjectSecurity.ModifyAccess(AccessControlModification modification, AccessRule rule, Boolean& modified)
   at System.Security.AccessControl.ObjectSecurity.ModifyAccessRule(AccessControlModification modification, AccessRule rule, Boolean& modified)
   at nvQuickSite.Controllers.FileSystemController.SetFolderPermission(String accountName, String folderPath)
2021-10-26 11:55:22.472 -04:00 [INF] Creating site projects.me in D:\Dev\DNN\projects
2021-10-26 11:55:22.499 -04:00 [INF] Site projects.me was deleted
2021-10-26 11:55:22.528 -04:00 [INF] Created site projects.me
2021-10-26 11:55:22.534 -04:00 [INF] projects.me already in C:\Windows\system32\drivers\etc\hosts
2021-10-26 11:55:22.534 -04:00 [INF] Creating file system directories for projects.me
2021-10-26 11:55:22.535 -04:00 [INF] Deleting directory D:\Dev\DNN\projects\Website
2021-10-26 11:55:22.536 -04:00 [INF] Deleting directory D:\Dev\DNN\projects\Logs
2021-10-26 11:55:22.537 -04:00 [ERR] Error occured while attempting to set permissions for NT Service\MSSQLSERVER on folder D:\Dev\DNN\projects\Logs
System.Security.Principal.IdentityNotMappedException: Some or all identity references could not be translated.
   at System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess)
   at System.Security.Principal.NTAccount.Translate(Type targetType)
   at System.Security.AccessControl.CommonObjectSecurity.ModifyAccess(AccessControlModification modification, AccessRule rule, Boolean& modified)
   at System.Security.AccessControl.ObjectSecurity.ModifyAccessRule(AccessControlModification modification, AccessRule rule, Boolean& modified)
   at nvQuickSite.Controllers.FileSystemController.SetFolderPermission(String accountName, String folderPath)
david-poindexter commented 3 years ago

@tksheppard thanks for testing this out. I am wondering if this has something to do with you running SQL Server Express instead of SQL Server Developer Edition. According to the Microsoft documentation, NT Service\MSSQLSERVER is still the correct account for nvQuickSite to use for setting permissions.

david-poindexter commented 3 years ago

Oh crap - I think I may have just figured it out! Why are we trying to set permissions on the IIS logs folder using the DB service account? That seems like a mistake to me. Let me try creating a new version for you to test that does not try to do that. I'll circle back as soon as that is ready for ya.

david-poindexter commented 3 years ago

@tksheppard here is a new test build for you. Can you install this and report back? (By the way, you should not have to uninstall the old version first.)

https://www.dropbox.com/t/6aIoVB3bMVW0m9JF

tksheppard commented 3 years ago

Here's the new error: image

And the log (tried again to close the error and click next again):


2021-10-27 11:05:46.172 -04:00 [INF] Updating user settings per new release.
2021-10-27 11:05:46.196 -04:00 [INF] Operating System information: Windows 10 Professional  10.0.22000.0
2021-10-27 11:05:47.404 -04:00 [INF] Loaded local packages
2021-10-27 11:05:47.789 -04:00 [INF] Internet appears to be online
2021-10-27 11:05:48.095 -04:00 [ERR] Unexpected error occurred retrieving remote packages.
System.Net.WebException: The request was aborted: The connection was closed unexpectedly.
   at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
   at System.Net.WebClient.DownloadString(Uri address)
   at nvQuickSite.Controllers.PackageController.GetRemotePackages()
2021-10-27 11:05:49.192 -04:00 [INF] Retrieved DNN packages from GitHub
2021-10-27 11:05:49.197 -04:00 [INF] Saved local packages file
2021-10-27 11:05:49.266 -04:00 [INF] Reading current user settings
2021-10-27 11:05:51.235 -04:00 [INF] Getting the list of sites
2021-10-27 11:05:54.857 -04:00 [INF] Internet appears to be online
2021-10-27 11:05:56.116 -04:00 [INF] Using local install package C:\Program Files (x86)\nvisionative\nvQuickSite\Downloads\DNN_Platform_9.10.2_Install.zip
2021-10-27 11:06:07.187 -04:00 [INF] Saved user settings
2021-10-27 11:06:19.388 -04:00 [INF] Creating site test.me in D:\Dev\DNN\test
2021-10-27 11:06:19.431 -04:00 [INF] Created site test.me
2021-10-27 11:06:19.445 -04:00 [INF] test.me added to C:\Windows\system32\drivers\etc\hosts
2021-10-27 11:06:19.446 -04:00 [INF] Creating file system directories for test.me
2021-10-27 11:06:19.467 -04:00 [ERR] Error occured while attempting to set permissions for NT Service\MSSQLSERVER on folder D:\Dev\DNN\test\Database
System.Security.Principal.IdentityNotMappedException: Some or all identity references could not be translated.
   at System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess)
   at System.Security.Principal.NTAccount.Translate(Type targetType)
   at System.Security.AccessControl.CommonObjectSecurity.ModifyAccess(AccessControlModification modification, AccessRule rule, Boolean& modified)
   at System.Security.AccessControl.ObjectSecurity.ModifyAccessRule(AccessControlModification modification, AccessRule rule, Boolean& modified)
   at nvQuickSite.Controllers.FileSystemController.SetFolderPermission(String accountName, String folderPath)
2021-10-27 11:07:55.233 -04:00 [INF] Creating site test.me in D:\Dev\DNN\test
2021-10-27 11:07:55.259 -04:00 [INF] Site test.me was deleted
2021-10-27 11:07:55.291 -04:00 [INF] Created site test.me
2021-10-27 11:07:55.300 -04:00 [INF] test.me already in C:\Windows\system32\drivers\etc\hosts
2021-10-27 11:07:55.300 -04:00 [INF] Creating file system directories for test.me
2021-10-27 11:07:55.301 -04:00 [INF] Deleting directory D:\Dev\DNN\test\Website
2021-10-27 11:07:55.302 -04:00 [INF] Deleting directory D:\Dev\DNN\test\Logs
2021-10-27 11:07:55.303 -04:00 [INF] Deleting directory D:\Dev\DNN\test\Database
2021-10-27 11:07:55.304 -04:00 [ERR] Error occured while attempting to set permissions for NT Service\MSSQLSERVER on folder D:\Dev\DNN\test\Database
System.Security.Principal.IdentityNotMappedException: Some or all identity references could not be translated.
   at System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess)
   at System.Security.Principal.NTAccount.Translate(Type targetType)
   at System.Security.AccessControl.CommonObjectSecurity.ModifyAccess(AccessControlModification modification, AccessRule rule, Boolean& modified)
   at System.Security.AccessControl.ObjectSecurity.ModifyAccessRule(AccessControlModification modification, AccessRule rule, Boolean& modified)
   at nvQuickSite.Controllers.FileSystemController.SetFolderPermission(String accountName, String folderPath)
david-poindexter commented 3 years ago

@tksheppard while this may seem similar, this is not really the same issue. So I have another question for you now. Is your SQL Server Express instance a "named instance"? If so, are you placing the correct information in the Database Server Name field? If you are trying to use (local) that may not work if you have a named instance.

tksheppard commented 3 years ago

That did it. I specified the Server Name and it installed correctly. It seems you solved the original issue.

david-poindexter commented 3 years ago

@tksheppard awesome! So glad. This one has been nagging us for way too long, so I am thankful you were able to test enough to help us get to a resolution. I'll submit a PR shortly for this issue and the other related issues.