运行PowerShell的TFS版本无法创建DtlDownloads

时间:2017-03-16 08:25:13

标签: tfs ms-release-management

我正在尝试使用TFS 15(内部部署)启动并运行一些自动部署。我在要调用的部署目标上有一个powershell脚本。

通过下载工件,部署开始正常。但是当代理运行脚本时,它想要创建一个文件夹C:\Windows\DtlDownloads(这不是我的脚本的一部分,但是我想为TFS做准备的一部分)。那失败了:

##[debug]System.AggregateException: Failed to install 'VisualStudioRemoteDeployer20597940-38b2-4ba8-9a4d-fcc894308730' from service executable path VisualStudioRemoteDeployer.exe . Consult the logs below:
Access to the path 'DtlDownloads' is denied.
CategoryInfo :PermissionDenied: (C:\Windows\DtlDownloads:String) [New-Item], UnauthorizedAccessException
FullyQualifiedErrorId :CreateDirectoryUnauthorizedAccessError,Microsoft.PowerShell.Commands.NewItemCommand 

用于登录的用户是名为deploy的服务器本地用户,该用户也是该计算机上的本地管理员。我还检查了windows文件夹中该用户的有效访问,它应该能够创建目录。

复制步骤会发生类似情况。 Robocopy发出两个错误信号:

2017/03/16 08:57:21 ERROR 5 (0x00000005) Getting File System Type of Destination \\server.domain.com\c$\abc\def\ 
Access is denied.

2017/03/16 08:57:21 ERROR 5 (0x00000005) Creating Destination Directory \\server.domain.com\c$\abc\def\ 
Access is denied.

第二个是有点意外,因为文件夹def已经存在,但我想这是一个跟进,因为事先让类型失败了。

用户本身必须已被识别,因为使用无效凭据时会出现不同的错误。我使用Enable-PSRemoting中的ConfigureWinRM.ps116-Mar-2017 14:34:11.792 SEVERE [http-nio-8080-exec-4] org.apache.catalina.core.ApplicationContext.log FAIL - Application at context path /propertyMS-1.0 could not be started org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/propertyMS-1.0]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1307) at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:669) at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:217) at javax.servlet.http.HttpServlet.service(HttpServlet.java:648) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:136) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:591) at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:319) at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:88) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:789) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1437) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalArgumentException: The archive [jar:file:/Users/bruce/apache-tomcat-8.5.9/webapps/propertyMS-1.0.war!/] is malformed and will be ignored: an entry contains an illegal path [./] which was not expanded to [/Users/bruce/apache-tomcat-8.5.9/webapps/propertyMS-1.0] since that is outside of the defined docBase [/Users/bruce/apache-tomcat-8.5.9/webapps/propertyMS-1.0/] at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:141) at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:615) at org.apache.catalina.startup.ContextConfig.beforeStart(ContextConfig.java:748) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:301) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:395) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:149) ... 35 more 启用了WinRM。

什么仍然可以限制权限?

更新:使用域用户而不是该服务器的本地用户解决了该问题。但我不明白为什么。有人可以解释甚至提供如何使其与本地用户一起工作的信息吗?

3 个答案:

答案 0 :(得分:1)

  

域名或本地管理帐户的用户名   目标主持人。

     
      
  • 支持用户名,域\用户名,计算机名称\用户名。\ username 等格式。
  •   
  • 不支持UPN格式,例如 username@domain.com 和内置系统帐户,例如 NT Authority \ System
  •   
     

Source Link

域帐户和本地管理员都应该工作。请仔细检查您的格式,并尝试使用其他格式。

答案 1 :(得分:1)

如果您将代理作为服务,该服务没有适当的权限,例如在网络帐户上,则可能存在一个问题。尝试将其更改为具有管理权限的用户帐户。

答案 2 :(得分:0)

运行“winrm quickconfig”为我解决了这个问题

winrm quickconfig

https://docs.microsoft.com/en-us/windows/win32/winrm/installation-and-configuration-for-windows-remote-management