Environment variable error within TFS client

Issue #13 wontfix
Andrew Patterson created an issue

Hi, I am trying to introduce Bamboo (with TFS) into a company that I contract to - I got it up and running fine. It worked for a few days. But the next week when I started it up, I now get this error from the TFS plugin whenever I go to start a build.

It looks like somehow the environment variables are causing issues - though how that could have changed from working to non-working I don't know! I can't remember altering the system environment variables on my machine. Anyhow, before digging anymore I though I should submit the stacktrace.

This is on a windows 7 machine, 64 bit. Error occurs in both 32 bit and 64 bit Java versions.

java.lang.UnsatisfiedLinkError:
 com.microsoft.tfs.jni.internal.platformmisc.NativePlatformMisc.nativeGetEnvironmentVariable(Ljava/lang/String;)Ljava/lang/String;
com.microsoft.tfs.jni.internal.platformmisc.NativePlatformMisc.nativeGetEnvironmentVariable(Native Method)
com.microsoft.tfs.jni.internal.platformmisc.NativePlatformMisc.getEnvironmentVariable(NativePlatformMisc.java:134)
com.microsoft.tfs.jni.PlatformMiscUtils.getEnvironmentVariable(PlatformMiscUtils.java:52)
com.microsoft.tfs.core.config.httpclient.DefaultHTTPClientFactory.shouldAcceptUntrustedCertificates(DefaultHTTPClientFactory.java:288)
com.microsoft.tfs.core.config.httpclient.DefaultHTTPClientFactory.configureClientParams(DefaultHTTPClientFactory.java:324)
com.microsoft.tfs.core.config.httpclient.DefaultHTTPClientFactory.newHTTPClient(DefaultHTTPClientFactory.java:137)
com.microsoft.tfs.core.TFSConnection.getHTTPClient(TFSConnection.java:1041)
com.microsoft.tfs.core.TFSConnection.getWebService(TFSConnection.java:858)
com.microsoft.tfs.core.clients.framework.location.internal.LocationWebServiceProxy.
<init>(LocationWebServiceProxy.java:34)
com.microsoft.tfs.core.clients.framework.location.LocationService.<init>(LocationService.java:72)
com.microsoft.tfs.core.FrameworkServerDataProvider.<init>(FrameworkServerDataProvider.java:37)
com.microsoft.tfs.core.TFSTeamProjectCollection.getServerDataProvider(TFSTeamProjectCollection.java:145)
com.microsoft.tfs.core.TFSTeamProjectCollection.getConfigurationServer(TFSTeamProjectCollection.java:243)
com.stellarity.bamboo.repository.TfsRepository.collectChangesSinceLastBuild(TfsRepository.java:137)
com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectionChangesWithRetry(DefaultChangeDetectionManager.java:466)
com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuildInternal(DefaultChangeDetectionManager.java:331)
com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:259)
com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:161)
com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectAllChangesSinceLastBuild(DefaultChangeDetectionManager.java:127)
 com.atlassian.bamboo.v2.trigger.ManualBuildDetectionAction.performDelayedChangeDetection(ManualBuildDetectionAction.java:166)
com.atlassian.bamboo.chains.ChainExecutionManagerImpl$2.getChainState(ChainExecutionManagerImpl.java:203)
com.atlassian.bamboo.chains.ChainExecutionManagerImpl.tryStartChainState(ChainExecutionManagerImpl.java:256)

com.atlassian.bamboo.chains.ChainExecutionManagerImpl.delayedStart(ChainExecutionManagerImpl.java:193)          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)          at java.lang.reflect.Method.invoke(Method.java:606) org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)          at com.sun.proxy.$Proxy97.delayedStart(Unknown Source) com.atlassian.bamboo.plan.PlanExecutionManagerImpl$1$1$1.call(PlanExecutionManagerImpl.java:381)          at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$1$1$1.call(PlanExecutionManagerImpl.java:377)          at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:312)          at com.atlassian.bamboo.plan.PlanExecutionLockServiceImpl.lock(PlanExecutionLockServiceImpl.java:78)          at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.doWithProcessLock(PlanExecutionManagerImpl.java:715)          at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.access$200(PlanExecutionManagerImpl.java:123)          at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$1$1.run(PlanExecutionManagerImpl.java:376)          at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:52)          at java.lang.Thread.run(Thread.java:724)

Comments (10)

  1. Andrew Patterson reporter

    Yes, quite possibly. It's on a corporate network and they might have some login scripts that do clean up like that.

  2. Andrew Patterson reporter

    I will check on Monday. If they do clean the temp directory (not that unusual I would think?) is there anyone else I can place the native libraries?

  3. Sergey Podobry

    The native libs are extracted to bamboo-tfs-sdk-native directory in the temp path. Can you exclude it from deletion?

  4. Andrew Patterson reporter

    Yes - I have looked in the temp directory and the bamboo-tfs-sdk-native directory is still there - so there is no corporate login script deleting the temp files. However, I have since then launched the bamboo console as 'administrator' and it now seems to be working. Perhaps I installed your tfs plugin whilst I was similarly running bamboo as an elevated user. Or perhaps there are funny permissions on my temp directory.

    Anyhow, as it is now working I am happy to close the issue. Running it on my developer workstation is only a temporary proof of concept. When we move it onto a server, if the problem reoccurs I will reopen the bug.

  5. Log in to comment