Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    Get Source on remote agent

    Scheduled Pinned Locked Moved Support
    agentsbuildmasterbuilds
    6 Posts 1 Posters 10 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      I'm trying to build on a remote agent and cannot get past TFS-GetSource. The command runs perfectly on the local agent which does me no good since the local agent does not have SharePoint 2016 installed. I need to build this on the remote agent. The old version of BuildMaster was easy to troubleshoot as the execution log was VERY verbose by providing the actual commands being executed. On this version, it's not at all verbose which is making it very difficult to troubleshoot without having to ask here.

      Error received while trying to execute TFS-GetSource on remote agent:

      Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object.
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Inedo.Agents.InedoAgentClientBase.<SendMessageAsync>d__28.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Inedo.Agents.InedoAgentClientBase.<ExecuteCommandAsync>d__26`1.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Inedo.BuildMaster.Extensibility.Agents.TcpAgent.<Inedo-Agents-IRemoteJobExecuter-ExecuteJobAsync>d__34.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Inedo.BuildMaster.Extensibility.Operations.RemoteExecuteOperation.<ExecuteAsync>d__5.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Inedo.BuildMaster.Windows.ServiceApplication.Executions.PlanExecuter.DeploymentPlanExecuter.<Inedo-ExecutionEngine-Executer-IExecutionHostEnvironment-ExecuteActionAsync>d__21.MoveNext()

      Product: BuildMaster
      Version: 5.6.4

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        Quick follow-up. I decided to review the TFS Extension code and found the following lines that may be the cause of the issue (can't be certain).

            protected string GetRootWorkspaceDiskPath()
            {
                using (var agent = BuildMasterAgent.CreateLocalAgent())
                {
                    return PathEx.Combine(agent.GetService<IFileOperationsExecuter>().GetBaseWorkingDirectory(), "TfsWorkspaces");
                }
            }
        

        Is this trying to create the "LocalAgent" which refers to the local agent on the Build Master Server? Should it be checking to see if the target agent server is remote and call BuildMasterAgent.Create(string serverName), BuildMasterAgent.Create(int serverId), or BuildMasterAgent.Create(Tables.Servers serverInfo)?

        The Object reference error appears to occur immediately after the LogInformation() step under RemoteExecuteAsync in GetSourceOperation.cs. The method this.GetRootWorkspaceDiskPath() sticks out as a possible candidate, which is where I found the code above.

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          Thanks Paul; we're still investigating and trying to reproduce. The error in the stack trace, is unfortunately, not helpful as you're probably noticing...

          Thanks for looking, second set of eyes is always helpful! In this case, because GetSourceOperation inherits RemoteExecuteOperation (via RemoteTfsOperation), the entire RemoteExecuteAsync method is executed on the agent.

          So, the LocalAgent is just how we do file operations on the (current) server; we don't use System.IO methods directly.

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            Thanks Alana. I appreciate the help.

            To help isolate the issue, I've forked the TFS extension and deployed to our BM server with remote debugging. I was not able to investigate the exact error with the remote debugging, but I was able to determine that the exception occurs on line 49 in RemoteTfsOperation.cs which is the following:

            using(var agent = BuildMasterAgent.CreateLocalAgent())

            I'll add some debugging there and see if I can capture more information about the error.

            1 Reply Last reply Reply Quote 0
            • ? This user is from outside of this forum
              Guest
              last edited by

              Thanks for the debugging pointer - a dev was able to reproduce and submit a fix. There will be a new version of the extension released shortly.

              1 Reply Last reply Reply Quote 0
              • ? This user is from outside of this forum
                Guest
                last edited by

                Hi Tod,

                Thank you! I'm never sure if I'm being helpful or just getting in the way. Just can't sit still long enough :).

                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • 1 / 1
                • First post
                  Last post
                Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation