Skip to content

Using docker configs for web.config causes 500.19 0x80070005 error #68

@JohanSpannare

Description

@JohanSpannare

If you uses docker config for web.config. IIS cant read the file due to not have access to the config.

Icacls

web.config from docker config

icacls.exe .\web.config
.\web.config BUILTIN\Administrators:(F)
             NT AUTHORITY\SYSTEM:(F)

web.config_ from COPY command

.\Web.config_ BUILTIN\Administrators:(F)
              NT AUTHORITY\SYSTEM:(F)
              BUILTIN\Administrators:(F)
              BUILTIN\Users:(RX)

Test from inside container

Invoke-WebRequest http://localhost
Invoke-WebRequest : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>IIS 10.0 Detailed Error - 500.19 - Internal Server Error</title>
...
<div id="content">
<div class="content-container">
  <h3>HTTP Error 500.19 - Internal Server Error</h3>
  <h4>The requested page cannot be accessed because the related configuration data for the page is invalid.</h4>
</div>

<div class="content-container">
 <fieldset><h4>Detailed Error Information:</h4>
  <div id="details-left">
   <table border="0" cellpadding="0" cellspacing="0">
    <tr class="alt"><th>Module</th><td>&nbsp;&nbsp;&nbsp;IIS Web Core</td></tr>
    <tr><th>Notification</th><td>&nbsp;&nbsp;&nbsp;Unknown</td></tr>
    <tr class="alt"><th>Handler</th><td>&nbsp;&nbsp;&nbsp;Not yet determined</td></tr>
    <tr><th>Error Code</th><td>&nbsp;&nbsp;&nbsp;0x80070005</td></tr>
    <tr class="alt"><th>Config Error</th><td>&nbsp;&nbsp;&nbsp;Cannot read configuration file due to insufficient permissions
</td></tr>

Current workaround

Copy web.config content coming from docker config to web.config and override Entrypoint

Copy-Item -Path C:\Site\web.config_config -Destination C:\Site\web.config
Start-Process -FilePath C:\ServiceMonitor.exe -ArgumentList w3svc -Wait -PassThru

Best practises

What´s the best practices working with IIS and docker configs?

Best reg
Johan Spännare

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions