K2 BlackPoint deployment error 401 when deploying a process for one userID

  • 29 September 2010
  • 14 replies
  • 1 view

Badge +2

I am getting an error when deploying a K2 blackpoint process from K2 designer. The process deploys fine when logged in with the service account as well as my account but when a developer tries to deploy the same process he gets the following error message:


1 Error(s)
(Sox Apps) Task Error: System.Exception: Error creating the K2WorkflowIntegration list item. ---> System.Net.WebException: The request failed with HTTP status 401: Unauthorized.
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at SourceCode.SharePoint.WebServices.K2SPWorkflowAssociations.AddOrUpdateK2WorkflowListItem(String workflowName, String k2ServerName, String k2ManagementServerName, String listTitle, String sharePointIntegrationServiceSiteURL, String folio, String events, String metadatadetail, Boolean setUserPermissionsOnStart)
   at SourceCode.Workflow.SharePoint.Common.WorkflowIntegration.AddK2WorkflowListItem(String siteURL, String processFullName, String k2ServerName, String k2ManagementServerName, String listTitle, String sharePointIntegrationServiceSiteURL, String folio, String events, String metadatadetail, Boolean setUserPermissionsOnStart, CredentialCache CredCache)
   at SourceCode.DeploymentTasks.SharePoint.WorkflowIntegration.WorkflowIntegrationService.Execute(IntegrationObject integration, Boolean testMode, Boolean createDependancies)
   --- End of inner exception stack trace ---
   at SourceCode.DeploymentTasks.SharePoint.WorkflowIntegration.WorkflowIntegrationService.Execute(IntegrationObject integration, Boolean testMode, Boolean createDependancies)
   at SourceCode.DeploymentTasks.SharePoint.WorkflowIntegration.WorkflowIntegrationTask.Execute() 


 


The userid has admin,export and impersonate rights in the K2 management console.


14 replies

Userlevel 4
Badge +14

Try granting at least contribute rights for that user on the list/library.


HTH


Vernon

Badge +2

The user is an owner to the site and I also tested uploading documents to the library while logged in with the user's credentials.

Badge +3

Hi Ahmed,


Can you please start your K2 Server in console mode. Please stop the K2 service in Services.msc first, then log on using the K2 Service account and start it in console mode via Start --> All Programs --> K2 blackpearl --> K2 Blackpearl Server.


Now, please try to deploy another process via the K2 Designer using a developer. The Console window should now be populated with information while K2 is busy deploying the process.


There should be updates of the user that is authenticating using NTLM or Kerberos.Can you please tel me which user has been authenticated, and which authentication method was used to authenticate the user.


Can you please let me know if this is a distributed environment? Is one of the following components split between servers;


K2 Server Service


K2 for SharePoint


K2 for Reporting


Workspace


Hope this helps.


Regards,


Coenie

Badge +3

Hi Ahmed,

Can you please start your K2 Server in console mode. Please stop the K2 service in Services.msc first, then log on using the K2 Service account and start it in console mode via Start --> All Programs --> K2 blackpearl --> K2 Blackpearl Server.

Now, please try to deploy another process via the K2 Designer using a developer. The Console window should now be populated with information while K2 is busy deploying the process.

There should be updates of the user that is authenticating using NTLM or Kerberos.Can you please tel me which user has been authenticated, and which authentication method was used to authenticate the user.

Can you please let me know if this is a distributed environment? Is one of the following components split between servers;

K2 Server Service

K2 for SharePoint

K2 for Reporting

Workspace

Hope this helps.

Regards,

Coenie

Badge +2

This is a K2 development license so the service account is logged on and the K2 Server is started in console mode. K2 and all its components are installed on the Sharepoint server except for the databases which are located on a separate sql 2005 server. 


So when I deploy the process the console reports the following messages:


(I changed the names of servers, domain and accts for security purposes)


;K2 HostServer Console Mode
;======================================
;Loading .NET Framework v2.0.50727
;Framework loaded successfully.
;Creating App Domain.
;Creating Host Server Runtime.
;Boot Strapping Hosting Server Runtime
;Press ESC to end..


Info    1001 Host Server Started as domainsrvcacct
Info    1002 Using .NET Framework v2.0.50727
Info    1003 Host Server Version: 4.9190.470.0
Info    1005 Initializing Connection to Host Server Database: sqlssrvr-test.K2_HostServer
Info    1007 Initialized Connection to Host Server Database: sqlssrvr-test.K2_HostServer
Info    1010 Enrolling Type : SourceCode.Security.Providers.K2UMProvider.K2UMProvider
Info    1010 Enrolling Type : SourceCode.Security.Providers.SalesforceProvider.SalesforceProvider
Info    1010 Enrolling Type : SourceCode.Security.Providers.SharePoint.SharePointProvider
Info    1010 Enrolling Type : SourceCode.Hosting.Server.Services.AppDomainService
Info    1010 Enrolling Type : SourceCode.Hosting.Server.Services.DiscoveryService
Info    1010 Enrolling Type : SourceCode.Hosting.Services.DependancyService
Info    1010 Enrolling Type : SourceCode.Hosting.Server.Services.LicenseService
Info    1010 Enrolling Type : SourceCode.Hosting.Server.Services.TCPIOCPService
Info    12000 Dependancy Service Initialized
Info    1010 Enrolling Type : SourceCode.Workflow.Runtime.K2LogServer
Info    1010 Enrolling Type : K2Server
Info    1010 Enrolling Type : SourceCode.Categories.Runtime.CategoryServer
Info    1010 Enrolling Type : SourceCode.Dependancy.Runtime.DependancyServer
Info    1010 Enrolling Type : SourceCode.EnvironmentSettings.Runtime.EnvironmentSettingsHostableServer
Info    1010 Enrolling Type : SourceCode.EventBus.ManagementServer.ClientServer
Info    1010 Enrolling Type : SourceCode.EventBus.Scheduler.Server.ServerImplimentation
Info    1010 Enrolling Type : SourceCode.EventBus.Scheduler.Server.ClientServerImplimentation
Info    1010 Enrolling Type : SourceCode.EventBus.Server.ClientServerImplimentation
Info    1010 Enrolling Type : SourceCode.EventBus.Server.ServerImplimentation
Info    1010 Enrolling Type : SourceCode.Hosting.Servers.LicenseManagement
Info    1010 Enrolling Type : SourceCode.Hosting.Servers.Management
Info    1010 Enrolling Type : SourceCode.Security.UserRoleManager.Runtime.UserRoleManagerServer
Info    1010 Enrolling Type : SourceCode.Hosting.Servers.SecurityManagement
Info    1010 Enrolling Type : SourceCode.SmartFunctions.Runtime.SmartFunctionEngine
Info    1010 Enrolling Type : SourceCode.SmartObjects.Runtime.SmartObjectClientServer
Info    1010 Enrolling Type : SourceCode.SmartObjects.Runtime.SmartObjectManagementServer
Info    1010 Enrolling Type : SourceCode.Workflow.Runtime.Management.WorkflowManagementHostServer
Info    5000 URM Server Initializing....
Info    5001 URM Server Initializing....
Info    5002 Default label name K2
Info    12500 Dependancy Server Initialized
Info    15000 Workflow Management Server Initializing
Info    15001 Workflow Management Server Initialized
Info    27022 Starting K2 Server Performance Monitoring
Info    27120 K2 Server was successfully started
Info    28041 Server running
Info    7500 Loading Eventbus Scheduling Server Version='4.0.0.0' Last Updated='14 Jul 2009 14:29:28'
Info    7523 Loading Schedule Server
Info    7505 Configuration settings initialized
Info    7532 Initialization Check Successfull
Info    7513 Service registered with ID:9 running on machine: mosssrvr
Info    7503 Loading ScheduleEventRecorder..
Info    7504 All Recorders Loaded
Info    7514 Schedule Buffers Initialized Successfully
Info    7522 Schedule Server Loaded Successfully
Info    10000 SmartObject Runtime Server starting up......
Info    10001 SmartObject Runtime Connecting to Store Database on sqlssrvr-test ....
Info    10003 SmartObject Runtime successfully connected to Database on sqlssrvr-test
Info    10004 SmartObject Runtime Store using integrated security.
Info    10021 SmartObject Runtime Event Handler initialized successfully.
Info    10010 SmartObject Object Factory initialized with cache time of 0
Info    10019 SmartObject Runtime Server successfully initialized and running.
Info    10500 SmartObject Runtime.Management Server starting up......
Info    10514 Name: 'SourceCode.SmartObjects.Runtime.Management' Version: '4.9190.470.0'  Date: '8/4/2009 2:53:22 PM'
Info    10512 EventHandler 'SourceCode.EventBus.SmartObjectEventRecorder.Recorder' started successfully  ...
Info    10507 SmartObject Runtime.Management Connecting to Store Database on sqlssrvr-test ....
Info    10509 SmartObject Runtime.Management successfully connected to Databaseon sqlssrvr-test
Info    10510 SmartObject Runtime.Management Store using integrated security.
Info    10505 SmartObject Runtime.Management Server started successfully...
Info    9035 Initializing SmartFunction Engine...
Info    9040 SmartFunction Engine successfully initialized.
Info    7000 Version='4.0.0.0' 09 Jul 2009 10:39:46
Info    7001 Checking EventBus Server Dependencies
Info    7004 All Dependencies Loaded
Info    7023 Loading Event Bus Server
Info    7005 Configuration settings initialized
Info    7032 Initialization Check Successfull
Info    7013 Service registered with ID:9 running on machine: mosssrvr
Info    7022 Event Bus Server Loaded Successfully
Info    7010 MSMQ Thread Listing


 



Logs when starting K2 designer
-------------------------------
Info    1020 Starting Session D575047771E97009CE63F3469A49780A
Info    3000 Authenticating domainsrvcacct for session D575047771E97009CE63F3469A49780A using K2 - NTLM
Info    5000 URM Server Initializing....
Info    5001 URM Server Initializing....
Info    5002 Default label name K2
Info    24401 Authenticated K2:domaindeveloperID at 172.22.22.114:1 using NTLM
Info    1020 Starting Session 00316E24F3CB64DCF727CF143C3270F7
Info    3000 Authenticating domaindeveloperID for session 00316E24F3CB64DCF727CF143C3270F7 using K2 - NTLM
Info    1025 Ending Session 00316E24F3CB64DCF727CF143C3270F7


 



Logs after a minute of starting K2 designer
-------------------------------------------
Info    24401 Authenticated K2:domainmossContentacct at yyy.yyy.yyy.yyy:2 using NTLM
Info    24401 Authenticated K2:domainmossContentacct at yyy.yyy.yyy.yyy:3 using NTLM
Info    1020 Starting Session 0570094C4BDC087A9CF63F54AD2EAFA1
Info    3000 Authenticating domainmossContentacct for session 0570094C4BDC087A9CF63F54AD2EAFA1 using K2 - NTLM
Info    5000 URM Server Initializing....
Info    5001 URM Server Initializing....
Info    5002 Default label name K2
Info    1020 Starting Session 899761A285BCEDD7F31CA924AA07DC1C
Info    1025 Ending Session 0570094C4BDC087A9CF63F54AD2EAFA1
Info    3000 Authenticating domainmossContentacct for session 899761A285BCEDD7F31CA924AA07DC1C using K2 - NTLM
Info    1025 Ending Session 899761A285BCEDD7F31CA924AA07DC1C


 



Logs when opening K2 Process
-----------------------------
Info    24401 Authenticated K2:domaindeveloperID at xxx.xxx.xxx.xxx:4 using NTLM
Info    1020 Starting Session 4E1F161B6C9872B8B4099C2BD2FB6230
Info    3000 Authenticating domaindeveloperID for session 4E1F161B6C9872B8B4099C2BD2FB6230 using K2 - NTLM
Info    1025 Ending Session 4E1F161B6C9872B8B4099C2BD2FB6230


 


Logs when compiling Process
----------------------------
Info    24401 Authenticated K2:domaindeveloperID at xxx.xxx.xxx.xxx:5 using NTLM
Info    1020 Starting Session 0340AC3914114C2E90B3784D491E1B06
Info    3000 Authenticating domaindeveloperID for session 0340AC3914114C2E90B3784D491E1B06 using K2 - NTLM
Info    1025 Ending Session 0340AC3914114C2E90B3784D491E1B06
Info    1020 Starting Session D213C8D6D945F707E0277E760992B632
Info    3000 Authenticating domaindeveloperID for session D213C8D6D945F707E0277E760992B632 using K2 - NTLM
Info    1025 Ending Session D213C8D6D945F707E0277E760992B632


 


No Logs in the K2 console when I try to deploy the process.

Badge +2

I stated in my earlier posts that I'm using K2 designer....I'm actually using K2 Studio which is installed on a separate workstation. Hope this helps.


Any suggestions are much appreciated.

Badge +10

Sometimes with deployment errors I find it helps to deploy the process manually using msbuild.  That way it spits out exactly what its doing before you get the error which typically turns out to be what you need to focus your troubleshooting on.


This is described in the help (with some nice screenshots) but I'm don't currently have blackpoint up in front of me to give you the link. 


The menu option to Create Deployment Package is available from within the solution explorer by right clicking on the Project Node. The deployment package will include all items that are not excluded from the project; conversely any items excluded will be ignored when the deployment package wizard runs.


Follow the steps below to create a deployment package




Right click on the Project Node


Select menu option Create Package Deployment



 




  • Select the option Create Deployment Package


 




  • A notification will appear in the lower left hand corner of the screen informing the user of the outcome of the package deployment. If there was an error it will display in the same location


The package creation is complete. 


Run the msbuild command specifying the deployment package that K2 created.




Click on Start > Run > CMD <Enter>



Type cdWindowsMicrosoft.NETFrameworkV2.0.50727 <Enter>




Here is an example msbuild command:




Msbuild "C:MyK2ProcessobjDebugDeploymentExpense Claims Process.msbuild” /p:Environment=development

Badge +2

Hey timkn - I ran the msbuild and got the same error as my initial post. It seems to fail during the K2 Workflow Integration With SharePoint .


 


msbuild "Z:K2_Test_ProcessesSox AppsobjDebugDeploymentSox Apps.msbuild" /p:Environment=development
Microsoft (R) Build Engine Version 2.0.50727.3053
[Microsoft .NET Framework, Version 2.0.50727.3615]
Copyright (C) Microsoft Corporation 2005. All rights reserved.


Build started 9/30/2010 5:12:57 PM.
__________________________________________________
Project "Z:K2_Test_ProcessesSox AppsobjDebugDeploymentSox Apps.msbuild" (d
efault targets):


Target K2 Workflow Integration Process Deployment:
    __________________________________________________
    Project "Z:K2_Test_ProcessesSox AppsobjDebugDeploymentSox Apps.msbuild
" is building "Z:K2_Test_ProcessesSox AppsobjDebugDeploymentSox Apps.msbui
ld" (InitDeploy target(s)):


    ------ Task Started: K2 Workflow Integration With SharePoint ------
    Retrieving event data
    Executing ...
    Task Error: System.Exception: Error creating the K2WorkflowIntegration list
item. ---> System.Net.WebException: The request failed with HTTP status 401: Una
uthorized.

Badge +5

Hi Ahmed,


Deploying a process, which I guess is a workflow integrated process in this case, the deploying user will need the following rights:
- Farm Administrator: Too add the feature to the farm.
- Site Collection Administrator: Too add the feature to the Site Collection
- Modify rights on the '12HiveTemplatesFeatures' folder in order to drop the feature XML.


This is all in accordance woth MS best practises since K2 4.5.


Regards,


Frikkie 

Badge +3

Hi Ahmed,


You mentioned that you are using K2 Studio and that you are deploying from a remote machine.


Now, if deploying from the K2 Server itself, do you receive the same error message as you did when deploying from the remote machine?


As Frikkie mentioned earlier, please ensure that the user that is deploying the process, has got the rights as outlined in the previous response.


Let us know if the issue has been solved or not.


Regards,


Coenie

Badge +2

That worked!!! I didn't have the developer as a site collection administrator. So how do I have multiple developers have the ability to deploy processes? You can only have two users set as site collection admins. Also, my account is not a site collection administrator and I'm able to deploy processes.

Badge +5

If you go into the Site Collection, not via Central Admin, and you click on 'Site Actions > Site Settings > Site Collection Administrators'  you will be able to add more Site Collection Admins.  Keep in mind that this probably won't be your configuration for production, as in production the idea would be to have teh actual SharePoint Admin be the deploying user because this is usually who adds features/solutions to the farm and is essentially what we are doing.


Side note:
I think giving the SharePoint Application Pool Identity(App Pool Accout) the same rights as indicated above would also alow everone to deploy.


Regards,
Frikkie

Badge +2

Thanks for your help frikkie. That did it!

Badge +5

No problem.

Reply