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



  • 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.

  • inedo-engineer

    Hi @lukel_3991,

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

    Thanks,
    Rich



  • Hey Rich,

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


  • inedo-engineer

    @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



  • @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.


  • inedo-engineer

    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


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation