Community forum

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

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline bweston  
#1 Posted : Monday, September 9, 2019 5:56:02 PM(UTC)
bweston

Rank: Paid support

Joined: 12/14/2012(UTC)
Posts: 78

Thanks: 2 times
Was thanked: 16 time(s) in 13 post(s)
Host OS is Windows Server 2012 R2 Standard.

I upgraded this morning from 8.4.1 to 8.5.5 and now, even after trying a restart and a reboot, I have multiple tasks that had previously been working fine for accessing the Visualcron API from Powershell (for a long time - I am using the same technique with a 6.2.2 server) that are now returning the following error:

Quote:
Exception calling "Connect" with "2" argument(s): "Method not found: 'Void CommClientCore.Messages.Message.set_Content(VisualCron.MessageClass)'."


I do not get this error when running the same code in Powershell ISE on the same server as the same user.

This is the "powershell script text" from a sample task that is failing. It fails the same way whether the credential used is set to local login, local login/load profile, or neither; and whether executing in x86 mode or not.

Edit: I have also now gotten the same error providing the script as a file instead of as script text.

Extended debug logging doesn't tell me anything the error output didn't.

I do not know if this may be related: when I run the code below in Powershell ISE, it connects and executes successfully, but the first time it is run, I get an error as follows:
Quote:
add-type : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
At line:2 char:1
+ add-type -Path "c:\Program Files (x86)\VisualCron\VisualCronAPI.dll"

The LoaderExceptions are:
Quote:
Could not load file or assembly 'Microsoft.Win32.TaskScheduler, Version=2.8.10.0, Culture=neutral, PublicKeyToken=c416bc1b32d97233' or one of its
dependencies. The system cannot find the file specified.
Could not load file or assembly 'Microsoft.Win32.TaskScheduler, Version=2.8.10.0, Culture=neutral, PublicKeyToken=c416bc1b32d97233' or one of its
dependencies. The system cannot find the file specified.


Searching for relevant information led me to this thread.

However, since in ISE the code still works, it seems to me that even if the assembly error is happening and is the underlying cause, the error message implies a problem in the handling of that error.

I'm stumped. I will probably have to roll back by end of day if there isn't some other solution.

Code:
add-type -Path "c:\Program Files (x86)\VisualCron\VisualCron.dll"
add-type -Path "c:\Program Files (x86)\VisualCron\VisualCronAPI.dll"

$c = new-object VisualCronAPI.Client
$conn = new-object VisualCronAPI.Connection
$conn.Address = "LOCALHOST"
$conn.UseADLogon = $true
$s = $c.Connect($conn,$true)
$j = $s.Jobs.GetAll() | ?{!($_.Stats.Active) -and $_.Group -notmatch "^[_ι]" } | select-object Id,@{l="NextRun";e={$_.Stats.DateNextExecution }},Group,Name | sort-object NextRun,Group,Name
$c.Disconnect($s) | out-null

$j


Of course, please go ahead and move this to the API forum if it would be more appropriate there. The reason I put it in General Problem Solving was because using the API in this manner seems to be working if it isn't done from a Visualcron Powershell task.

Edited by user Monday, September 9, 2019 11:14:52 PM(UTC)  | Reason: notes on calling script and on forum selection

Offline bweston  
#2 Posted : Tuesday, September 10, 2019 5:29:13 PM(UTC)
bweston

Rank: Paid support

Joined: 12/14/2012(UTC)
Posts: 78

Thanks: 2 times
Was thanked: 16 time(s) in 13 post(s)
Further update: I just put together a partial proof of concept replacement as a C# ".Net Code Execute" task, and once I figured out it had to do "Local Login/Load Profile" to use the credential for Active Directory authentication, it works. So the issue seems to be isolated to Powershell tasks.
Offline Support  
#3 Posted : Wednesday, September 11, 2019 4:41:50 PM(UTC)
Support

Rank: Official support

Joined: 12/1/2015(UTC)
Posts: 151

Thanks: 16 times
Was thanked: 6 time(s) in 5 post(s)
Originally Posted by: bweston Go to Quoted Post
Further update: I just put together a partial proof of concept replacement as a C# ".Net Code Execute" task, and once I figured out it had to do "Local Login/Load Profile" to use the credential for Active Directory authentication, it works. So the issue seems to be isolated to Powershell tasks.


Could you please try our 8.5.6 beta build and see if you can reproduce this there?
Michael
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Users browsing this topic
Guest
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.

Scroll to Top