Unable to publish artifacts - get internal server error (500)
Hi!
I have the following artifact path: C:\Repository\eCrew2\WebApplication\bin\* => c:\Build_Artifacts\%system.teamcity.buildConfName%\%build.number%\
For unknown reason (obviously) I get the following error in the buildlog:
[13:06:48]: Publishing artifacts (1s)[13:06:49]: [Publishing artifacts] Failed to publish artifacts. Failed to publish artifacts. Server status: 500 (Internal Server Error)[13:06:49]: [Publishing artifacts] [Artifacts publishing failed] {build.status.text}
The logfile show the following exception:
[2011-06-30 13:06:49,743] ERROR - jetbrains.buildServer.SERVER - Error during request processing, request dump: Path: /runtimeError.jsp Method: POST Remote address: 127.0.0.1 java.io.IOException: The file was not created (check name or antivirus): c:/Build_Artifacts/[Main][Debug]/0.0.46/log4net.xml at jetbrains.buildServer.controllers.artifacts.ArtifactUploadController.publishFile(ArtifactUploadController.java:42) at jetbrains.buildServer.controllers.artifacts.ArtifactUploadController.doHandle(ArtifactUploadController.java:46) at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:73) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:95) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at jetbrains.buildServer.web.DiagnosticFilter.runChainWithModifiedThreadName(DiagnosticFilter.java:4) at jetbrains.buildServer.web.DiagnosticFilter.doFilter(DiagnosticFilter.java:15) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at jetbrains.buildServer.web.ResponseFragmentFilter.doFilter(ResponseFragmentFilter.java:1) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source)
Originally there where anti-virus installed on the server. But I've turned this off for testing purposes. Still the publish fails.
Anyone got an idea?
Please sign in to leave a comment.
Ivar,
Artifacts in TeamCity are get from current build, and are published to the web server.
This setting should contain relative paths in both parts of from=>to string.
If you need to copy the files to an external location, it sould be done within your build scrpit, or as additional step in the build configuration.
Also, you can vote for TW-1558 feature request.
Michael
My colleagues corrected me that absolute paths are supported technically in "from" part of the rule.
But we do not recommend to use them, as it make harder to manage the build when it runs on different agents.
Michael
Ended up by adding a build step of type command line.
Using Robocopy (C:\Windows\System32\Robocopy.exe) with the following parameters:
robocopy C:\Repository\eCrew2\WebApplication\bin\ c:\Build_Artifacts\%system.teamcity.buildConfName%\%build.number%\ /create /*.*
Message was edited by: Ivar Sønstabø
Hi,
I have just upgraded from 6.0.3 to 6.5.1 and experiment with a very similar problem. We have over 300 build configurations, maybe half of them with artifacts, but only this one is giving us problems.
The project has 3 artifacts:
Instrument/SSAG2/Executables/nios/Release/Application81x_NZ.out
Instrument/SSAG2/Executables/nios/Release/Module81xFPGADOL1.out
Instrument/SSAG2/Executables/nios/Release/Module81xFPGASQU1.out
All of them are relative paths, with no => to parts.
Here's the fail in TeamCity:
and here's a more complete log from the log files on the server:
Path: /runtimeError.jsp
Method: POST
Remote address: 10.1.200.116
java.lang.IllegalMonitorStateException
at java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryRelease(Unknown Source)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.release(Unknown Source)
at java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.unlock(Unknown Source)
at jetbrains.buildServer.serverSide.artifacts.RWLock$2.unlock(RWLock.java:21)
at jetbrains.buildServer.serverSide.artifacts.HierarchicalLockManager.unlockPath(HierarchicalLockManager.java:38)
at jetbrains.buildServer.serverSide.artifacts.HierarchicalLockManager.unlock(HierarchicalLockManager.java:54)
at jetbrains.buildServer.serverSide.artifacts.HierarchicalLockManager.unlock(HierarchicalLockManager.java:47)
at jetbrains.buildServer.serverSide.artifacts.ArtifactsGuardImpl.unlockWriting(ArtifactsGuardImpl.java:9)
at jetbrains.buildServer.controllers.artifacts.ArtifactUploadController.publishFile(ArtifactUploadController.java:16)
at jetbrains.buildServer.controllers.artifacts.ArtifactUploadController.doHandle(ArtifactUploadController.java:46)
at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:73)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:95)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at jetbrains.buildServer.web.DiagnosticFilter.runChainWithModifiedThreadName(DiagnosticFilter.java:4)
at jetbrains.buildServer.web.DiagnosticFilter.doFilter(DiagnosticFilter.java:15)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at jetbrains.buildServer.web.ResponseFragmentFilter.doFilter(ResponseFragmentFilter.java:1)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)
[2011-07-07 10:49:35,538] INFO - de.impl.history.DBBuildHistory - Start creating history entry for Telecom Trunk :: SSAG2 Target Firmware Release 81x 295222, date: 1310050177000
[2011-07-07 10:49:35,538] INFO - de.impl.history.DBBuildHistory - End creating history entry for Telecom Trunk :: SSAG2 Target Firmware Release 81x 295222
[2011-07-07 10:49:35,538] INFO - tbrains.buildServer.ACTIVITIES - Finished 295222
If I publish any of the 3 artifacts
Ok, I have solved this.
Instrument/SSAG2/Executables/nios/Release/Application81x_NZ.out
Instrument/SSAG2/Executables/nios/Release/Module81xFPGADOL1.out
Instrument/SSAG2/Executables/nios/Release/Module81xFPGASQU1.out
produced the problems because of the trailing space at the end of the last 2 lines.
When I removed the trailing spaces,
Instrument/SSAG2/Executables/nios/Release/Application81x_NZ.out
Instrument/SSAG2/Executables/nios/Release/Module81xFPGADOL1.out
Instrument/SSAG2/Executables/nios/Release/Module81xFPGASQU1.out
everything turned back to green.
I believe you should add some code to prevent this. Now that I know, it will not cause any more problem to me, but to others this could be pretty annoying.
In TeamCity 6.5.2 we've fixed similar issue: http://youtrack.jetbrains.net/issue/TW-17283