Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-6061

IIS : iis_virtual_directory fails to update site and application

    Details

    • Template:
      MODULES Bug Template
    • Acceptance Criteria:
      Hide

      Should update iis_virtual_directory site and application

      Should have new acceptance tests to verify fix.

      Show
      Should update iis_virtual_directory site and application Should have new acceptance tests to verify fix.
    • Epic Link:
    • Team:
      Windows
    • Story Points:
      1
    • Sprint:
      Windows 2019-03-27
    • Method Found:
      Manual Test
    • CS Priority:
      Major
    • CS Frequency:
      3 - 25-50% of Customers
    • CS Severity:
      3 - Serious
    • CS Business Value:
      4 - $$$$$
    • CS Impact:
      IIS is one of the core windows modules, we should get it working, or if that's not possible clean things up to explain why.
    • QA Risk Assessment:
      Needs Assessment

      Description

      iis_virtual_directory silently fails to update site and application.

      Adding 'ErrorAction stop' to the PowerShell commands in update for iis_virtual_directory reveals there are failures when updating site (and application) ...

      Notice: /Stage[main]/Main/Node[pe-201722-agent-win2012]/Iis_virtual_directory[test]/physicalpath: physicalpath changed '\\SERVER\shareXXX' to '\\SERVER\share'
      Debug: Updating test
      Debug: COMMAND: Set-ItemProperty -Path 'IIS:\Sites\Default Web Site\test' -Name 'physicalPath' -Value '\\SERVER\share' -ErrorAction Stop
      Set-ItemProperty -Path 'IIS:\Sites\Default Web Site\test' -Name 'site' -Value 'Default Web Site' -ErrorAction Stop
      Debug: Waited 50 milliseconds...
      Debug: Waited 50 milliseconds...
      Debug: Wait object signaled
      Debug: Waited 0.140081 total seconds.
      Debug: 2017-11-17 01:35:54 +0000 PIPE> <ReturnResult><Property Name="exitcode">1</Property><Property Name="errormessage">UHJvcGVydHkgc2l0ZSBpcyBub3QgZm91bmQgb24gIF
      xcUEUtMjAxNzIyLUFHRU5UXFNpdGVzXERlZmF1bHQgV2ViIFNpdGVcdW5jLg0KUGFyYW1ldGVyIG5hbWU6IHByb3BOYW1lDQo=</Property><Property Name="stderr"></Property><Property Name="std
      out"></Property></ReturnResult>
       
      Debug: ERRMSG: Property site is not found on \\PE-201722-AGENT\Sites\Default Web Site\test.
      Parameter name: propName
       
      Error: Error updating virtual directory: Property site is not found on \\PE-201722-AGENT\Sites\Default Web Site\test.
      Parameter name: propName
      

      Get-ItemProperty confirms that the site and application attributes do not exist to set via Set-ItemProperty:

      PS C:\> Get-ItemProperty 'IIS:\Sites\Default Web Site\test' | Select *
       
      path              : /test
      physicalPath      : \\SERVER\shareXXX
      userName          :
      password          :
      logonMethod       : ClearText
      allowSubDirConfig : True
      ItemXPath         : /system.applicationHost/sites/site[@name='Default Web Site' and @id='1']/application[@path='/']/virtualDirectory[@path='/test']
      Name              : unc
      PSPath            : WebAdministration::\\PE-201722-AGENT\Sites\Default Web Site\test
      PSParentPath      : WebAdministration::\\PE-201722-AGENT\Sites\Default Web Site
      PSChildName       : test
      PSDrive           : IIS
      PSProvider        : WebAdministration
      Attributes        : {path, physicalPath, userName, password...}
      ChildElements     : {}
      ElementTagName    : virtualDirectory
      Methods           :
      Schema            : Microsoft.IIs.PowerShell.Framework.ConfigurationElementSchema
      

      This makes sense, especially for site, since site is incorporated into the Path parameter of Set-ItemProperty ...

      https://github.com/puppetlabs/puppetlabs-iis/blob/master/lib/puppet/provider/iis_virtual_directory/webadministration.rb#L51

      This failure does not occur when updating physicalpath via Set-ItemProperty.

      Ideas: We could remove the Set-ItemProperty commands for site and application and document this a limitation, or move the virtual directory from one site or application to another, or ... ???

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  william.hurt William Hurt
                  Reporter:
                  tom.kishel Thomas Kishel
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: