Unable to publish package to Orchestrator nor able to use Orchestrtor

I am trying to pubish package to Orchestrator from Studio but i get the below error. I have been able to connect UIPath robot to orchestrator using Agent though.
Error is below.
Can you help me fix this ?
08:41:19.4904 => [WARN] [UiPath.Studio.exe] [1] XamlMigration: added reference UiPath.UiAutomation.Activities
08:41:19.4904 => [WARN] [UiPath.Studio.exe] [1] XamlMigration: added reference UiPath.System.Activities
08:41:19.4904 => [WARN] [UiPath.Studio.exe] [1] XamlMigration: added namespace UiPath.Core
08:41:19.4904 => [WARN] [UiPath.Studio.exe] [1] XamlMigration: added namespace UiPath.Core.Activities
08:41:53.9832 => [ERROR] [UiPath.Studio.exe] [1] Error: System.ApplicationException: Publish of workflow project to Orchestrator failed. A task was canceled. —> System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: A task was canceled.

*Server stack trace: *

  • at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)*
  • at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object ins, Object outs, TimeSpan timeout)*
  • at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)*
  • at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)*

*Exception rethrown at [0]: *

  • at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)*
  • at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)*
  • at UiPath.Models.IUiPathRemoteDuplexContract.PublishPackage(String packFilePath, Int32 timeoutSeconds, PublishFeedType feedType)*
  • at UiPath.Models.UiPathDuplexProxy.PublishPackage(String packFilePath, Int32 timeoutSeconds, PublishFeedType feedType) in D:\a\1\s\Common\UiPath.Service.Api\Client\UiPathDuplexProxy.cs:line 95*
  • at UiPath.Studio.Plugin.Workflow.Project.WorkflowProjectModelFactory.PublishToOrchestrator(Int32 timeout, String packFilePath, IWorkflowProject workflowProject) in D:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Project\WorkflowProjectModelFactory.cs:line 421*
  • — End of inner exception stack trace —*
  • at UiPath.Studio.Plugin.Workflow.Project.WorkflowProjectModelFactory.PublishToOrchestrator(Int32 timeout, String packFilePath, IWorkflowProject workflowProject) in D:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Project\WorkflowProjectModelFactory.cs:line 425*
  • at UiPath.Studio.Plugin.Workflow.Project.WorkflowProjectModelFactory.<>c__DisplayClass49_0.b__0() in D:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Project\WorkflowProjectModelFactory.cs:line 408*
  • at System.Threading.Tasks.Task.InnerInvoke()*
  • at System.Threading.Tasks.Task.Execute()*
    — End of stack trace from previous location where exception was thrown —
  • at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)*
  • at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)*
  • at UiPath.Studio.Plugin.Workflow.Project.WorkflowProjectModelFactory.d__49.MoveNext() in D:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Project\WorkflowProjectModelFactory.cs:line 408*
    — End of stack trace from previous location where exception was thrown —
  • at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)*
  • at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)*
  • at UiPath.Studio.Plugin.Workflow.Project.WorkflowProjectModelFactory.d__47.MoveNext() in D:\a\1\s\Studio\UiPath.Studio.Plugin.Workflow\Project\WorkflowProjectModelFactory.cs:line 372, HResult -2146232832*

@ChaitraMuniyappa does your robot is in connection mode, and if any workflow’s which are present in same folder having errors also it won’t publish.plz check those

Hey @ChaitraMuniyappa,

Please try to disconnect your robot from the orchestrator and restart your uipath robot service then connect to orchestrator again and now try to publish the package again.

I did… It connects sometimes and sometimes it fails

No errors during publish… Problem is connecting Agent to Orchestrator