Closed TraGicCode closed 5 years ago
Sure let me try it Monday and get back with u
Hey @maartenba ,
Installing version 8.192 of the adoptopenjdk chocolatey package did indeed solve the problem. Let me know when the new release is out so i can retest the full workflow.
Thanks
On a clean machine, adoptopenjdk should now be the default dependency.
Hey @maartenba ,
I still have the issue when i take a fresh virtual machine and run choco install teamcityagent.
Can you give it anoher go? Was just able to install & run it fine on Docker:
FROM microsoft/windowsservercore
ENV chocolateyUseWindowsCompression false
RUN powershell -Command \
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'));
RUN powershell -Command \
choco install TeamCityAgent --version 3.0.1 -y -params 'serverUrl=https://buildserverurl/ agentName=TESTAGENT'
Any chance you can grab the teamcity-agent.log
from your machine where this fails? (do check for secrets/URLs in there, as to not disclose that info here on GitHub)
Still fails on a fresh install of windows server 2016. Below is the agent log
[2019-01-22 21:38:00,127] INFO - s.buildServer.agent.AgentMain2 - Agent home is C:\buildAgent
[2019-01-22 21:38:00,205] INFO - jetbrains.buildServer.SERVER - Starting TeamCity agent
[2019-01-22 21:38:00,205] INFO - s.buildServer.agent.AgentMain2 -
[2019-01-22 21:38:00,205] INFO - s.buildServer.agent.AgentMain2 - ===========================================================
[2019-01-22 21:38:00,283] INFO - s.buildServer.agent.AgentMain2 - TeamCity Build Agent 10.0.4 (build 42538), OS: Windows Server 2016, User: WIN-UK9D3R1CA86$, Java: 11, OpenJDK 64-Bit Server VM (11+28, mixed mode), OpenJDK Runtime Environment (11+28), Oracle Corporation, JVM parameters: -ea -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -Xrs -Dlog4j.configuration=file:../conf/teamcity-agent-log4j.xml -Dteamcity_logs=../logs/
[2019-01-22 21:38:00,283] INFO - s.buildServer.agent.AgentMain2 - Starting...
[2019-01-22 21:38:00,346] ERROR - s.buildServer.agent.AgentMain2 - Failed to create Spring context.
java.lang.NoClassDefFoundError: java/sql/SQLException
at org.springframework.core.SerializableTypeWrapper$MethodInvokeTypeProvider.getType(SerializableTypeWrapper.java:393)
at org.springframework.core.SerializableTypeWrapper.forTypeProvider(SerializableTypeWrapper.java:150)
at org.springframework.core.SerializableTypeWrapper$TypeProxyInvocationHandler.invoke(SerializableTypeWrapper.java:245)
at org.springframework.core.$Proxy3.getRawType(Unknown Source)
at org.springframework.core.ResolvableType.resolveType(ResolvableType.java:770)
at org.springframework.core.ResolvableType.resolveClass(ResolvableType.java:760)
at org.springframework.core.ResolvableType.<init>(ResolvableType.java:153)
at org.springframework.core.ResolvableType.forType(ResolvableType.java:1343)
at org.springframework.core.ResolvableType.forType(ResolvableType.java:1311)
at org.springframework.core.ResolvableType.forTypes(ResolvableType.java:1271)
at org.springframework.core.ResolvableType.getInterfaces(ResolvableType.java:463)
at org.springframework.core.ResolvableType.as(ResolvableType.java:426)
at org.springframework.core.convert.support.GenericConversionService.getRequiredTypeInfo(GenericConversionService.java:288)
at org.springframework.core.convert.support.GenericConversionService.addConverterFactory(GenericConversionService.java:119)
at org.springframework.core.convert.support.DefaultConversionService.addScalarConverters(DefaultConversionService.java:129)
at org.springframework.core.convert.support.DefaultConversionService.addDefaultConverters(DefaultConversionService.java:75)
at org.springframework.core.convert.support.DefaultConversionService.<init>(DefaultConversionService.java:62)
at org.springframework.core.env.AbstractPropertyResolver.<init>(AbstractPropertyResolver.java:41)
at org.springframework.core.env.PropertySourcesPropertyResolver.<init>(PropertySourcesPropertyResolver.java:41)
at org.springframework.core.env.AbstractEnvironment.<init>(AbstractEnvironment.java:113)
at org.springframework.core.env.StandardEnvironment.<init>(StandardEnvironment.java:54)
at org.springframework.context.support.AbstractApplicationContext.createEnvironment(AbstractApplicationContext.java:500)
at org.springframework.context.support.AbstractApplicationContext.getEnvironment(AbstractApplicationContext.java:289)
at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.resolvePath(AbstractRefreshableConfigApplicationContext.java:122)
at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.setConfigLocations(AbstractRefreshableConfigApplicationContext.java:80)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:137)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
at jetbrains.buildServer.agent.AgentMain2$2.<init>(AgentMain2.java:156)
at jetbrains.buildServer.agent.AgentMain2.createRootApplicationContext(AgentMain2.java:147)
at jetbrains.buildServer.agent.AgentMain2.main2(AgentMain2.java:71)
at jetbrains.buildServer.agent.AgentMain2.main(AgentMain2.java:38)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at jetbrains.buildServer.agent.AgentMain.main(AgentMain.java:43)
Caused by: java.lang.ClassNotFoundException: java.sql.SQLException
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 36 more
[2019-01-22 21:38:00,346] INFO - ent.impl.upgrade.AgentExitCode - Agent exited. Failed to initialize Spring context
i'm attempting to use docker like u posted to see if it behaves differently.
Also can you post the exact docker commands you run to get this thing going and working in docker using the provided dockerfile from above.
Thanks!
I see you are using TeamCity 10 - I just checked and this will not run correctly on AdoptOpenJDK. Could you try with an older version of this Chocolatey package, e.g. 2.2.1 - https://chocolatey.org/packages/TeamCityAgent/2.2.1
Hey @maartenba ,
It does work fine on the older versions. I was trying to use the new version so java doesn't keep breaking the chocolatey package jre8.
Thanks we can close this now. Sounds like we need to update our teamcity internally!
Let me know if u need another log file to help. This one is teamcity-agent.log