Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Access denied to machine.config on Win7 x64
neptunesystems2
#1 Posted : Sunday, March 11, 2012 8:21:47 PM(UTC)
Groups: Member
Joined: 3/11/2012(UTC)
Posts: 4

Hi team,

I'm currently testing my ASP.NET 4 app on Win 7 x64, and it's unable to run. My installer registers the app by command-line, and after it is registered, the host process continually logs to the Windows Application Event Log the following error:

Log Name: Application
Source: UWS Host UWS.AppHost.Clr4.AnyCPU
Event ID: 0
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Description:
UltiDev Web Server host process ""C:\Program Files\UltiDev\Web Server\UWS.AppHost.Clr4.AnyCPU.exe" 9000b55f-4cab-4292-8c90-81d3d162bb18" has failed due to
"System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Access to the path 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config' is denied. (C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config) ---> System.UnauthorizedAccessException: Access to the path 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName, Boolean assertPermissions)
at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
--- End of inner exception stack trace ---
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
at System.Diagnostics.DiagnosticsConfiguration.Initialize()
at System.Diagnostics.TraceInternal.InitializeSettings()
at System.Diagnostics.TraceInternal.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args)
at UWS.AppPool.Program.SpitOut(EventLogEntryType entryType, String format, Object[] args)
at UWS.AppPool.Program.RegisterChannels(Guid appHostID)
at UWS.AppPool.Program.HostAppPool(Guid appHostID)
at UWS.AppPool.Program.DoIt(String[] args)
at UWS.AppPool.Program.Main(String[] args)

Same installer works perfect on XP 32bit and maybe also Vista 32bit, any thoughts? Please let me know if you need anything else from me for your diagnosis.

Best,

Neptune
Ultidev Team
#2 Posted : Monday, March 12, 2012 9:40:26 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hello, Neptune!

It appears that something happened on that machine that made 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config' folder inaccessible to NETWORK SERVICE user. Please try to grant at least READ permissions to the NETWORK SERVICE user and see if that works. If it does, consider doing the same to all Config users in all "C:\Windows\Microsoft.NET\Framework\vXXXX" and "C:\Windows\Microsoft.NET\Framework64\vXXXX" folders.

Please let us know if this has helped.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
neptunesystems2
#3 Posted : Monday, March 19, 2012 4:17:12 PM(UTC)
Groups: Member
Joined: 3/11/2012(UTC)
Posts: 4

Thanks for the quick response.

Unfortunately, no dice. I granted Read & Execute to NETWORK SERVICE on 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config', then uninstalled UltiDev, then installed UltiDev. Same error as original post.

By the way, the Web App Explorer says "Running" by "Monitoring Service" but when I try to browse the application, it says:

Are you sure?

UltiDev Web Server's windows service is not running.
Do you want to try accessing application anyway?

Yes No


I wanted to point out that although it's still true that the Monitoring Service is running, if I didn't know to look in the Windows Event Viewer, I'd be confused, as that error just says "UltiDev Web Server's windows service", not "UltiDev Web Server's windows service for this application". Just a suggestion.

Thanks

-- Neptune
Ultidev Team
#4 Posted : Monday, March 19, 2012 4:58:18 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi there!

- Could you please attach a screenshot to your response showing how UWS Explorer looks like when application is not running? In theory UWS monitoring service should keep running while a host process could have crashed.

- Could you please try a couple of things: one is to grant "NETWORK SERVICE" user Modify access rights to the folder containing config file, and if that does not help, register the application under "LOCAL SYSTEM" user account. Please let us know if any of these helped?

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
neptunesystems2
#5 Posted : Monday, March 19, 2012 9:13:57 PM(UTC)
Groups: Member
Joined: 3/11/2012(UTC)
Posts: 4

Redirector still works



but the .NET 4 shared host will not run



I granted NETWORK SERVICE full access to
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config

then in order to kickstart it, instead of re-installing Ultidev again I moved it to a new host with the same parameters:
.NET 4
64-bit on 64-bit system
Network Service account

Note that I called the new host "ok". I noticed that caused this event to be logged:

Code:

Metabase change handling failed due to:
System.InvalidOperationException: Process was not started by this object, so requested information cannot be determined.
at System.Diagnostics.Process.EnsureState(State state)
at System.Diagnostics.Process.get_ExitCode()
at UltiDev.WebServer.Monitor.AppPoolControllerClient.GetHostProcessStatusUIText()
at UltiDev.WebServer.Monitor.MonitorService.ReloadAppConfigData2()

Following changes were partially done:
-------------------- 3/19/2012 9:33:58 PM --------------------
New host "ID={4fd8b3f7-bc73-4583-95fe-e7b69b10a3ae}, Name="UltiDev Web Server App Redirector", CLR & Bitness=Clr2AnyCPU, Original security context user=NetworkService, Number of applications=1" has an existing counter-part "ID={4fd8b3f7-bc73-4583-95fe-e7b69b10a3ae}, Name="UltiDev Web Server App Redirector", CLR & Bitness=Clr2AnyCPU, Original security context user=NetworkService, Number of applications=1" (Running, process ID=8580) that will be kept.
-------------------- 3/19/2012 9:33:59 PM --------------------
New host "ID={cbb8cf9d-bf37-4db7-873a-c8ebf1da7d8b}, Name="ok", CLR & Bitness=Clr4AnyCPU, Original security context user=NetworkService, Number of applications=1" and it's a completely new host.
-------------------- 3/19/2012 9:33:59 PM --------------------


After that, same Access Denied events as in original post were logged.

Alright, finally, regarding switching to a new host under Local System, several events were logged and then something crashed:

#1
Code:

Log Name: Application
Source: UltiDev Web Server Monitoring Service
Date: 3/19/2012 9:50:27 PM
Event ID: 0
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Description:
Metabase change handling failed due to:
System.InvalidOperationException: Process was not started by this object, so requested information cannot be determined.
at System.Diagnostics.Process.EnsureState(State state)
at System.Diagnostics.Process.get_ExitCode()
at UltiDev.WebServer.Monitor.AppPoolControllerClient.GetHostProcessStatusUIText()
at UltiDev.WebServer.Monitor.MonitorService.ReloadAppConfigData2()

Following changes were partially done:
-------------------- 3/19/2012 9:50:27 PM --------------------
New host "ID={4fd8b3f7-bc73-4583-95fe-e7b69b10a3ae}, Name="UltiDev Web Server App Redirector", CLR & Bitness=Clr2AnyCPU, Original security context user=NetworkService, Number of applications=1" and it's a completely new host.
-------------------- 3/19/2012 9:50:27 PM --------------------
New host "ID={cbb8cf9d-bf37-4db7-873a-c8ebf1da7d8b}, Name="ok", CLR & Bitness=Clr4AnyCPU, Original security context user=NetworkService, Number of applications=0" and it's a completely new host. We won't run it, however, because it doesn't host any apps.
-------------------- 3/19/2012 9:50:27 PM --------------------
New host "ID={53de5b13-eb66-449f-97a3-7a0f9080e649}, Name="OK2", CLR & Bitness=Clr4AnyCPU, Original security context user=LocalSystem, Number of applications=1" and it's a completely new host.
-------------------- 3/19/2012 9:50:27 PM --------------------


#2
Code:

Log Name: Application
Source: UWS Host UWS.AppHost.Clr4.AnyCPU
Date: 3/19/2012 9:50:27 PM
Event ID: 0
Task Category: None
Level: Information
Keywords: Classic
User: N/A
Description:
Host 53de5b13-eb66-449f-97a3-7a0f9080e649: Successfully registered IPC server channels "UWS.HostController.{53DE5B13-EB66-449F-97A3-7A0F9080E649}.12872" and "UWS.HostController.{53DE5B13-EB66-449F-97A3-7A0F9080E649}" to allow monitoring server control.


#3
Code:

Log Name: Application
Source: UWS Host UWS.AppHost.Clr4.AnyCPU
Date: 3/19/2012 9:50:29 PM
Event ID: 0
Task Category: None
Level: Information
Keywords: Classic
User: N/A
Description:
Host 9000b55f-4cab-4292-8c90-81d3d162bb18: Successfully registered IPC server channels "UWS.HostController.{9000B55F-4CAB-4292-8C90-81D3D162BB18}.14688" and "UWS.HostController.{9000B55F-4CAB-4292-8C90-81D3D162BB18}" to allow monitoring server control.


#4
Code:

Log Name: Application
Source: UWS Host UWS.AppHost.Clr4.AnyCPU
Date: 3/19/2012 9:50:29 PM
Event ID: 0
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Description:
UltiDev Web Server host process ""C:\Program Files\UltiDev\Web Server\UWS.AppHost.Clr4.AnyCPU.exe" 9000b55f-4cab-4292-8c90-81d3d162bb18" has failed due to
"System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Access to the path 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config' is denied. (C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config) ---> System.UnauthorizedAccessException: Access to the path 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName, Boolean assertPermissions)
at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
--- End of inner exception stack trace ---
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
at System.Diagnostics.DiagnosticsConfiguration.Initialize()
at System.Diagnostics.TraceInternal.InitializeSettings()
at System.Diagnostics.TraceInternal.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args)
at UWS.AppPool.Program.SpitOut(EventLogEntryType entryType, String format, Object[] args)
at UWS.AppPool.Program.RegisterChannels(Guid appHostID)
at UWS.AppPool.Program.HostAppPool(Guid appHostID)
at UWS.AppPool.Program.DoIt(String[] args)
at UWS.AppPool.Program.Main(String[] args)".


#5
Code:

Host 53de5b13-eb66-449f-97a3-7a0f9080e649: Successfully registered type AppPoolHost for remote control by monitoring service. Waiting for incoming commands.
Service Channels:
===============================================================
UWS.HostController.{53DE5B13-EB66-449F-97A3-7A0F9080E649}.12872
UWS.HostController.{53DE5B13-EB66-449F-97A3-7A0F9080E649}

Services:
===============================================================
UWS.MonitoringCommons.AppPoolHost at AppHost


And then UltiDev.WebServer.Monitor.exe crashed. I opened VS 2010 debugger for more detail:
Code:

System.Runtime.Remoting.RemotingException was unhandled
Message=The channel 'UWS.HostController.{4FD8B3F7-BC73-4583-95FE-E7B69B10A3AE}.8580' is already registered.
Source=mscorlib
StackTrace:
at System.Runtime.Remoting.Channels.ChannelServices.RegisterChannelInternal(IChannel chnl, Boolean ensureSecurity)
at System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(IChannel chnl, Boolean ensureSecurity)
at UWS.MonitoringCommons.MonitoringRemote.RegisterMainHostClientChannel(Guid hostID, Int32 hostProcessID)
at UltiDev.WebServer.Monitor.AppPoolControllerClient.InstantiateHostControllerClient(Boolean keepTryingForAwhile, Boolean doItEvenIfNotMonitoring)
at UltiDev.WebServer.Monitor.AppPoolControllerClient.CheckHostHeartbeat(Boolean keepTryingForAwhile)
at UltiDev.WebServer.Monitor.AppPoolControllerClient.HostProcessMonitoringLoop()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:


Then I hit OK on the debugger, and it logged it successfully registered the app:
Code:

Log Name: Application
Source: UWS.RequestProcessor
Date: 3/19/2012 9:50:55 PM
Event ID: 0
Task Category: None
Level: Information
Keywords: Classic
User: N/A
Description:
Created ASP.NET AppDomain (AppDomain ID={72078d39-9860-4f7b-aadb-6cf54a714cba}) for application "[redacted]" (Application ID={redacted}).
Environment info: Command line: "C:\Program Files\UltiDev\Web Server\UWS.AppHost.Clr4.AnyCPU.exe" 53de5b13-eb66-449f-97a3-7a0f9080e649
Process ID: 12872
Process user name: NT AUTHORITY\SYSTEM
Bitness: 64
CLR version 4.0.30319.261
Process retired: False
Max request threads: 400
Max I/O threads: 400


Then the host processes shut themselves down because they didn't see the Monitor (because it crashed), then main service restarted, monitor posted a successful "Metabase caused the following changes" event, and both CLR 2 host for redirector and CLR 4 host for my app posted "Successfully registered type AppPoolHost for remote control by monitoring service. Waiting for incoming commands.".

So, looks like issue is related to NETWORK SERVICE, under .NET 4, as the Redirector is working properly under NETWORK SERVICE on .NET 2:

-Redirector-
Code:

Created ASP.NET AppDomain (AppDomain ID={f219c977-2398-4ba3-9ecd-c04ca5fd7152}) for application "UltiDev Web Server App Redirector" (Application ID={4fd8b3f7-bc73-4583-95fe-e7b69b10a3ae}).
Environment info: Command line: "C:\Program Files\UltiDev\Web Server\UWS.AppHost.Clr2.AnyCpu.exe" 4fd8b3f7-bc73-4583-95fe-e7b69b10a3ae
Process ID: 16976
Process user name: NT AUTHORITY\NETWORK SERVICE
Bitness: 64
CLR version 2.0.50727.5448
Process retired: False
Max request threads: 400
Max I/O threads: 400


-My App-
Code:

Created ASP.NET AppDomain (AppDomain ID={78f4a09a-8cd0-4f55-9b53-88f718cb6044}) for application "[redacted]" (Application ID={redacted}).
Environment info: Command line: "C:\Program Files\UltiDev\Web Server\UWS.AppHost.Clr4.AnyCPU.exe" 53de5b13-eb66-449f-97a3-7a0f9080e649
Process ID: 4716
Process user name: NT AUTHORITY\SYSTEM
Bitness: 64
CLR version 4.0.30319.261
Process retired: False
Max request threads: 400
Max I/O threads: 400


And maybe I just reported another bug regarding the crash.

This solves it here...but I'd like to get Network Service working. Or a way to install it under Local System w/ your assurance that is production quality. i.e. "run the Local System application setup if the Network Service one fails". This application is going to be deployed to non-technical customers so it is my goal to assure as much as possible that all Win7 x64 installations will work without intervention.

Halp!

Thanks!

-- Neptune
Ultidev Team
#6 Posted : Monday, March 19, 2012 10:44:33 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hello, Neptune.

Since using Local System account makes the problem go away, it is pretty clear that we are dealing with an unusual access rights problem. UWS has been installed on about 20,000 systems to date, and the issue you are having is not one of known. We suggest trying UWS on another system and register your application there to see whether there is something wrong with the system in question. Please let us know if you were able to reproduce the problem on other systems.

Choosing whether to use Local System is completely up to you and your agreement with your customers. Using Local System or not is all about trade offs: easier to run as the expense of being less secure. We cannot make any kind of guarantees of security regardless which security account your decide to go with - all we can do is to let you know about pros and cons and let you decide on the course of action.

Monitor service crashing is something that we'll look into. We do not consider it critical because we configure it so that system restarts it if crashes, but we'll log it and try to make improvements for the next release.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Guest
#7 Posted : Tuesday, March 8, 2016 2:32:29 AM(UTC)
Groups:

Message was deleted by a Moderator.
Rss Feed  Atom Feed
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.