Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NCrunch Build error
sheryl
#1 Posted : Thursday, July 28, 2016 10:51:51 PM(UTC)
Rank: Member

Groups: Registered
Joined: 5/15/2015(UTC)
Posts: 18
Location: United States of America

Thanks: 12 times
Was thanked: 3 time(s) in 3 post(s)
HI Remco- on updating NCrunch version from v2.23.0.2 to v2.24.02 (trial version), the nodes are connecting but get the following error:
NCrunch distributed Processing:
System.Exception: An exception was thrown in the remote environment: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at nCrunch.Compiler.RemoteBuildRunner.(ComponentBuildParameters )
at nCrunch.Compiler.RemoteBuildRunner.Build(ComponentBuildParameters parameters)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.(CallMethodMessage )
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.ProcessMessageReturningResult(Byte[] data)
at nCrunch.TaskRunner.Ipc.RemoteInstance.[T](Byte[] )
at nCrunch.TaskRunner.Ipc.RemoteInstance.Invoke(IMessage msg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at nCrunch.Compiler.IRemoteBuildRunner.Build(ComponentBuildParameters parameters)
at nCrunch.Core.BuildManagement.BuildProcessLauncher..(IRemoteBuildRunner )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , IBuildableProject , ExternalProcess )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , ProcessorArchitecture , GridClientId , IBuildableProject , IList`1 )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.BuildComponentInExternalProcess(ComponentBuildParameters parameters, VisualStudioVersion vsVersion, GridClientId client, IList`1 customEnvironmentVariables)
at nCrunch.Core.BuildManagement.BuildEnvironment.Build(SnapshotComponent snapshotComponentToBuild, IList`1 referencedComponents, GridClientId gridClientId, IList`1 customEnvironmentVariables)
at nCrunch.Core.Processing.BuildTaskLogic.DoProcessTaskAndReturnSuccessFlag()
at nCrunch.GridNode.NodeTaskProcessor..()
at nCrunch.Common.ErrorHandler.DoWithErrorHandling(Action action, Object context)

It also throws build error: NCrunch Processing Queue:

[15:48:18.8064-NodeProcessor-14] ERROR (Internal): System.Exception: An exception was thrown in the remote environment: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at nCrunch.Compiler.RemoteBuildRunner.(ComponentBuildParameters )
at nCrunch.Compiler.RemoteBuildRunner.Build(ComponentBuildParameters parameters)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.(CallMethodMessage )
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.ProcessMessageReturningResult(Byte[] data)
at nCrunch.TaskRunner.Ipc.RemoteInstance.[T](Byte[] )
at nCrunch.TaskRunner.Ipc.RemoteInstance.Invoke(IMessage msg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at nCrunch.Compiler.IRemoteBuildRunner.Build(ComponentBuildParameters parameters)
at nCrunch.Core.BuildManagement.BuildProcessLauncher..(IRemoteBuildRunner )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , IBuildableProject , ExternalProcess )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , ProcessorArchitecture , GridClientId , IBuildableProject , IList`1 )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.BuildComponentInExternalProcess(ComponentBuildParameters parameters, VisualStudioVersion vsVersion, GridClientId client, IList`1 customEnvironmentVariables)
at nCrunch.Core.BuildManagement.BuildEnvironment.Build(SnapshotComponent snapshotComponentToBuild, IList`1 referencedComponents, GridClientId gridClientId, IList`1 customEnvironmentVariables)
at nCrunch.Core.Processing.BuildTaskLogic.DoProcessTaskAndReturnSuccessFlag()
at nCrunch.GridNode.NodeTaskProcessor..()
at nCrunch.Common.ErrorHandler.DoWithErrorHandling(Action action, Object context)



Could you please us troubleshoot the set up issue.
Remco
#2 Posted : Thursday, July 28, 2016 11:22:53 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Hi, thanks for sharing this issue.

It looks like this project has two or more resource/content files that are marked to be copied into the build output directory, and they are set to copy to the same place.

NCrunch isn't handling this right, and it's exploding. It should be possible to narrow this down by selectively turning off the copying of your content files until you can find the two of them that clash. Having content files landing in the same place could be considered an error case, though normal MSBuild behaviour is to swallow this and simply let one of the files 'win'.

It's suspicious that this is happening for your grid nodes but not local processing. I would expect a problem like this to appear on both ... are you using any SDKs or build libraries that might be different on the grid nodes?
1 user thanked Remco for this useful post.
sheryl on 7/29/2016(UTC)
sheryl
#3 Posted : Friday, July 29, 2016 12:17:03 AM(UTC)
Rank: Member

Groups: Registered
Joined: 5/15/2015(UTC)
Posts: 18
Location: United States of America

Thanks: 12 times
Was thanked: 3 time(s) in 3 post(s)
Thanks Remco for the quick response. The project was building correctly with NCrunch v2.23. It started failing only after I got it updated to NCrunch v2.24.


Also, the grid node failure of: 15:48:18.8064-NodeProcessor-14] ERROR (Internal): System.Exception: An exception was thrown in the remote environment: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: An item with the same key has already been added.

What key would this be?

the connection to grid node shows "online" in green, but the error tab displays:

System.Exception: An exception was thrown in the remote environment: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at nCrunch.Compiler.RemoteBuildRunner.(ComponentBuildParameters )
at nCrunch.Compiler.RemoteBuildRunner.Build(ComponentBuildParameters parameters)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.(CallMethodMessage )
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.ProcessMessageReturningResult(Byte[] data)
at nCrunch.TaskRunner.Ipc.RemoteInstance.[T](Byte[] )
at nCrunch.TaskRunner.Ipc.RemoteInstance.Invoke(IMessage msg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at nCrunch.Compiler.IRemoteBuildRunner.Build(ComponentBuildParameters parameters)
at nCrunch.Core.BuildManagement.BuildProcessLauncher..(IRemoteBuildRunner )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , IBuildableProject , ExternalProcess )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , ProcessorArchitecture , GridClientId , IBuildableProject , IList`1 )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.BuildComponentInExternalProcess(ComponentBuildParameters parameters, VisualStudioVersion vsVersion, GridClientId client, IList`1 customEnvironmentVariables)
at nCrunch.Core.BuildManagement.BuildEnvironment.Build(SnapshotComponent snapshotComponentToBuild, IList`1 referencedComponents, GridClientId gridClientId, IList`1 customEnvironmentVariables)
at nCrunch.Core.Processing.BuildTaskLogic.DoProcessTaskAndReturnSuccessFlag()
at nCrunch.GridNode.NodeTaskProcessor..()
at nCrunch.Common.ErrorHandler.DoWithErrorHandling(Action action, Object context)
Remco
#4 Posted : Friday, July 29, 2016 6:09:57 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Hi Sheryl,

You are correct in your understanding that this is a regression in v2.24. v2.24 introduced a change in the handling of how resource files are copied into project output directories. A fix for this is now pending in the next release of NCrunch, but we need to get you working.

Unfortunately, the error cannot tell us which of your resource files is causing the problem. Have you tried selectively turning off the copying of some of the resource files in this project? The problem is caused by two resource files being copied to the same place, so it should be possible to resolve this without any side-effects and it will also clean up your build system.
1 user thanked Remco for this useful post.
sheryl on 7/29/2016(UTC)
sheryl
#5 Posted : Friday, July 29, 2016 1:49:45 PM(UTC)
Rank: Member

Groups: Registered
Joined: 5/15/2015(UTC)
Posts: 18
Location: United States of America

Thanks: 12 times
Was thanked: 3 time(s) in 3 post(s)
Thanks Remco. You were right! The Resource file did have some duplicate files, which when removed, gave a successful NCrunch build. The grid node doesn't connect yet. Looking into that and will keep you posted.
1 user thanked sheryl for this useful post.
Remco on 7/29/2016(UTC)
Remco
#6 Posted : Monday, August 8, 2016 5:08:21 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
v2.25 has just been released including a fix for the duplicate resource copying exception described above. When NCrunch encounters this scenario, the first copied file will simply be ignored (as it would be overwritten by the second).
1 user thanked Remco for this useful post.
sheryl on 8/9/2016(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.075 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download