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!

    Remote powershell scripts fail but local works

    Scheduled Pinned Locked Moved Support
    6 Posts 4 Posters 15 Views 1 Watching
    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.
    • L Offline
      lukel_3991
      last edited by

      I'm running a simple one-liner (ipconfig /all) to test a new Otter install and keep getting this error. It only happens when I run on a remote machine. Running against the Otter localhost work fine. I'm using powershell remoting to access, not the agent.

      DEBUG: 2021-11-16 01:09:05Z - Job will be run against servers sequentially (not asynchronously).
      DEBUG: 2021-11-16 01:09:05Z - Targeting servers: COMPUTERNAME.DOMAIN.com
      DEBUG: 2021-11-16 01:09:05Z - Beginning execution run...
      ERROR: 2021-11-16 01:09:08Z - Unhandled exception: System.IO.FileNotFoundException: Could not load file or assembly 'Scripting' or one of its dependencies. The system cannot find the file specified.
      File name: 'Scripting'
      at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
      at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
      at System.Type.GetType(String typeName, Boolean throwOnError)
      at Inedo.Agents.Commands.JobStartCommand.Deserialize(Stream stream)
      at Inedo.Agents.AgentCommand.DeserializeInternal(Stream stream)
      at Inedo.Agents.Hosting.HostedAgentProcess.<MessageLoop>d__24.MoveNext()

      WRN: Assembly binding logging is turned OFF.
      To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
      Note: There is some performance penalty associated with assembly bind failure logging.
      To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

      ERROR: 2021-11-16 01:09:09Z - Execution run failed.
      DEBUG: 2021-11-16 01:09:09Z - Cleaning up temporary files on PowerShell...
      WARN : 2021-11-16 01:09:10Z - Unable to delete temporary directory "c:\temp\otter\Temp_E8" on PowerShell: At line:11 char:2

      • }
      • ~
        The Try statement is missing its Catch or Finally block.

      At line:12 char:1

      • } Finally {
      • ~
        Unexpected token '}' in expression or statement.
      1 Reply Last reply Reply Quote 0
      • rhessingerR Offline
        rhessinger inedo-engineer
        last edited by

        Hi @lukel_3991,

        What version of Otter are you running and are you running it on Windows or Docker?

        Thanks,
        Rich

        Products Engineer, Inedo

        1 Reply Last reply Reply Quote 0
        • L Offline
          lukel_3991
          last edited by

          Hey Rich,

          I'm running on windows server 2019 standard and Otter v3.0.15.

          atrippA 1 Reply Last reply Reply Quote 0
          • atrippA Offline
            atripp inedo-engineer @lukel_3991
            last edited by

            @lukel_3991 thanks.

            So this works totally fine if you're using localhost instead of computername.domain.com then And then, computername.domain.com is a Windows server?

            If that's the case, it means the agent (which is connected via PowerShell Remoting) isn't fully loading; basically, the Scripting extension isn't loading, or had an error.

            Can you try using a different Temp path? Maybe there's a relation....

            Thanks,
            Alana

            L 1 Reply Last reply Reply Quote 0
            • L Offline
              lukel_3991 @atripp
              last edited by

              @atripp
              Yes that's all correct. I tried with a different local path and still no dice. The initial Otter folder is created but the extensions never get transferred.

              Just for kicks I tried copying over the extensions from the otter server to C:\Otter\HostedAgent\extensions. This time it worked.

              I can work around that by loading extensions in advance but the cleanup step was not able to delete the temp folder. Is this an easy fix?

              Cleaning up temporary files on PowerShell...
              Unable to delete temporary directory "C:\Otter\Temp_E13" on PowerShell: At line:11 char:2
              + }
              + ~
              The Try statement is missing its Catch or Finally block.

              At line:12 char:1
              + } Finally {
              + ~
              Unexpected token '}' in expression or statement.

              1 Reply Last reply Reply Quote 0
              • Dan_WoolfD Offline
                Dan_Woolf inedo-engineer
                last edited by

                Hi @lukel_3991,

                I think we have two different issues that are happening here. The first one it seems to not be synchronizing over the extensions. What version of PowerShell do you have installed on your remote server and the otter server? The PowerShell based agent-less servers connect using PSRemoting over WSMAN. Could you please try to connect to your remote server using Enter-PSSession in PowerShell on your Otter server and try to run some commands to make a temp folder and write a file to it using the same credentials Otter users to connect to that server? It almost feels like there may be a permissions issue.

                The other issue seems like their could an issue with your OtterScript itself. Would you be able to share the OtterScript you are trying to run?

                Thanks,
                Dan

                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