Send failed with error: An operation was attempted on something that is not a socket.

  • 2 February 2011
  • 4 replies
  • 4 views

Badge +2

I recently migrated my K2 2003 process to K2 Blackpearl and I've switched from using K2ROM to SourceCode.Workflow.Client


I'm getting this error intermittently when trying to update the workflow and reading xml fields using the following API calls:


1)  this.ProcessInstance.XmlFields[fieldName].Value


2)  this.ProcessInstance.Update()


Send failed with error: An operation was attempted on something that is not a socket.



 


 



4 replies

Badge +3

Hi, I got the same error. 


Did you have a solution for it??

Badge

We have be using the K2 WCF services to interact with the process instances (specifically the data fields) but all of a sudden our K2 production environment is returning this error when we attempt to call OpenProcessInstance().

 

Anyone else getting this error?

 

Occasionally, we also get "The ViewFlow URL could not be found. Ensure the Workflow URL Environment field exists." when I call OpenProcessInstance().

 

Our development/test environment with the same version of K2 using the same SQL Server (different database) works perfectly.

 

Here is the code being used (formatting a bit messed up):

 

int processID = 123;

string fieldName = "SampleField";

 

try

{

               

using (var k2 = new K2_WCF.ProcessNavigationServiceClient())

{

// This is where it crashes                   

var proc = k2.OpenProcessInstance(processID.ToString(), true, false);

                   

proc.DataField.Where(x => x.Name == fieldName).FirstOrDefault().Value = value;

k2.UpdateProcessInstance(proc);

                   

return true;

 }

 }

           

catch (Exception ex)

{

               

return false;

}

Badge +6

MikeDaniels - please check that the connectionstring is using the correct port number. if you mix up between 5555 and 5252, you might get this error. Also check that there is no firewall or antivirus blocking the connection on the k2 ports. Make sure the DNS is resolving properly because the hostname in the connectionstring will do that.

Badge

Alright, I think I found the issue.

 

When we initially setup K2 on our production box we removed the Development Environment from the Environment Library Templates which seemed like a good idea at the time and everything has been working nicely.

 

We recently had an exchange server failure and so to fix the issue, we ran the K2 Blackpearl Setup Manager to update the configuration to use a different exchange server. We should have used the ConnectionStringEditor.exe in the Host ServerBin folder.

 

What the Setup Manager seemed to do was recreate the Development Environment in the Environment Library on the production server which seemed a bit odd but did we did not really take notice of it.

 

After attempting to reset Winsock & tweaking TCP/IP settings on the server, we were still getting the Send Failed error. After each reboot/service restart/iisreset, I noticed that the first error was "The ViewFlow URL could not be found. Ensure the Workflow URL Environment field exists" so once again, I compared the production environment with our actual dev/test server and everything seemed fine.

 

I decided that I should remove the Dev environment from production and that sorted out the problem.

 

 

 

Reply