2019.8.0 is throwing an error which am unable to understand - even with no major activity defined inside the workflow!

Hey UiPathians,

I had a workflow which was working fine since many months now.
I cloned it (coinciding with the latest beta version of UiPath’s Community Edition 2019.8.0 ).
Now whenever I run the cloned version, it gives me following error, unable to understand what’s going on. Any help is highly appreciated!

RemoteException wrapping System.NullReferenceException: Object reference not set to an instance of an object.
at lambda_method(Closure ,
ActivityContext )
at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context) at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance,
Activity1 expressionActivity) at System.Activities.Variable1.PopulateDefault(ActivityExecutor executor,
ActivityInstance parentInstance,
Location location)
at System.Activities.ActivityInstance.ResolveVariable(Variable variable,
ActivityExecutor executor)
at System.Activities.ActivityInstance.ResolveVariables(ActivityExecutor executor)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)

Thank you!

Does this error appear when trying to open the file? Or does it appear at runtime?

If it’s at opening, make sure that you have all of the activity packages installed that are necessary for the project. This can be easily resolved by copying over the project.json file from the original project folder into the new ‘cloned’ project folder.

If it’s at runtime, then we need more information. What activity is throwing the error?

Hey @Dave,
Thanks for looking into!

I get this error while trying to run the workflow.
The workflow gets stuck at the very first activity - which is nothing but opening a browser!
Unable to proceed hence blocking my work as well :expressionless:

Hello @Akanksha_Varshney

Can you click on the Validate button on the top ribbon. Once the validation is complete, open the errors panel and see whether there are any errors shown there. If so, double click to see where it leads to…

Can you share if there are any errors shown there?

Additionally, for the open browser activity, I suppose you are providing a string variable that has the URL for a particular site. Have you checked whether that variable is having some value when you run it?

1 Like

This error usually occurs when the activity has a variable with null value in it
—kindly check once with the open browser activity like if it’s passed with any variable or argument and it has value or not

To validate that use a writeline activity before the open browser and mention like this
String.IsNullOrEmpty(Yourvariablename.ToString).ToString

If this gives us TRUE in the output panel then the variable has no value in it

Cheers @Akanksha_Varshney

Hi @Lahiru.Fernando,

Thanks for checking.
After “Validating All”, it does not show any error - which is logically correct from my experience since the same (original)workflow is working perfectly fine, otherwise.
image

Also, looks like the error is not generated at the ‘Open Browser’ activity but even before that. Please have a look at the following screenshot:


FWIW, the open browser activity is defined inside Prop_4_5_6 flowchart and the workflow seizes to just reach even inside Prop_4_5_6.
(Open Browser activity inside Prop_4_5_6 does have a valid URL value inside it)

Clueless on what’s going on!

Hey @Palaniyappan,

Thanks for checking!
In the open browser activity, am directly passing the URL to open:
image

Also, as I mention in the previous response, looks like the workflow gets stuck even before reaching to the Open Browser activity. :expressionless:

To confirm that the exception is indeed independent for the activity defined inside the workflow, I deleted all the activities inside the workflow and added just a message box displaying some random text; then ran the workflow; and voila…I still see the exception:

@loginerror

Let’s try create an empty workflow in 2019.8 version and copy/paste all activities from the cloned one.

Cheers

Hey thanks @J0ska!

The cloned workflow is leading to the exception even with no concrete activity as such.
One thing that may be troubling are the variables defined in the cloned workflow, especially datatables/collections - though totally same as those in the original workflow.
But not sure how to go about figuring out the main cause - the variables are too deeply integrated in the workflow to remove them :expressionless:

Hi @Akanksha_Varshney,
What exactly did you do to “clone” the workflow?
Did you create a new project in 2019.8 and copy an existing workflow file from pre-2019.8 project?

Cheers

Hey @J0ska,

In the pre-2019.8 world, I had two different workflows, whose basic structure/logical implementation was same but both catered to different set of properties.
Now my aim is to integrate the two workflows.
To do so, as you said, I created another project in 2019.8, added one of the two original workflows(so not actually cloned it but copied - if at all they are different!) in the new project, made some integration-related changes, tested for this chunk and everything seemed to work fine - verified multiple times.

Then I copied the second workflow, made the required changes, ran > everything stopped working.
Then even after resetting to just the first workflow, it never worked again. Even after removibg all the activities, the exception persists.

One thing I would like to note here is - when I copied each workflow, the variables got copied automatically (to my surprise).
And when I removed all the activities, did not scrap the variables - which I feel may be troubling.
I tried to remove suspected variables one by one and I assume either the two datatable variables/the three Send email related variables may be the culprit.
But somehow I cannot test after removing them because they are integral part of the whole process.

I read in one of the posts that Excel activity is corrupted in some way in 2919.8. And @loginerror suggested workarounds to deal with it.
Any possibilities that data table/email activities are also corrupted in this version?

Highly appreciate the help!
Thank you very much!

@Lahiru.Fernando @ClaytonM

Judging by your last image, the error is definitely occurring at the declaration of Arguments and Variables in your outermost sequence. I would suggest selecting the sequence and looking in those sections for any variables used inside of other variables; if it tries to declare using another variable that has not been declared yet, then you will have this issue. Note: it declares in this order: Arguments top to bottom, then Variables by scope top to bottom (and by top to bottom I mean in the order the variable was created)

1 Like

Oh also, if you use an IN argument as a DataTable, try adding new DataTable in the Default value

Hi @Akanksha_Varshney

@ClaytonM is onto something, see below how I recreated your issue:

Funny enough, to fix this particular case you have to not only initialize your array with some content, but also make sure it happens before you will use that array to initialize another variable (in practice, switch places of the variables, so that the array is initialized first, before the Join method is run using it)

Please check your variables to see for similar scenario.

Hi @loginerror
This is very interesting case!
This would probably not happen in another general-purpose programming language or it would be at least easier to detect.

Is there any way to influence the order in which arguments/variables are declared?
Would make sense that Studio reorder declarations in background in order to prevent such error?

Cheers

Thanks for all the inputs, everyone!

@loginerror- Glad that you were able to repro the mysterious error. I didn’t know that ordering of variables can lead to so much of disruption!
As a general practice, I declare variables as I go about the workflow creation. For the first time ever, I used the sort feature available on the variables section - and the only useful reason of having it there was better view of the declared variables - in my opinion - the same reason I used it for(but looks like it led to other unexpected results as well).
image

As @J0ska mentions, this behaviour is quite different from what we generally see while working in other languages.

I have one more follow up query, probably seeking confirmation - if I declare variables but don’t use any/all of them, UiStudio validates them even them? I thought it’ll just ignore unused ones!

I’ll tweak my variables ordering as per @loginerror’s suggestions and will get back on whatever I observe thereafter.

Thanks again, everyone!

Another issue that I was facing but took it as a transient issue earlier - seems to occur every time I copy a project from one process to another:
19.8.0-beta.83+Branch.release-2019.8.0.Sha.88c89bf4a39be59370d5ac0bc292847be0fecc8c

An internal error has occurred. It is recommended to restart UiPath Studio.

Error: System.NullReferenceException: Object reference not set to an instance of an object.
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelProperty(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty, ModelProperty property)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelItem(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemModelItemViewModel.LoadChildren()
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddChild(TreeViewItemViewModel child, ModelProperty modelProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelProperty(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty, ModelProperty property)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelItem(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemModelItemViewModel.LoadChildren()
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddChild(TreeViewItemViewModel child, ModelProperty modelProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelProperty(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty, ModelProperty property)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelItem(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemModelItemViewModel.LoadChildren()
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddChild(TreeViewItemViewModel child, ModelProperty modelProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelProperty(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty, ModelProperty property)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelItem(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemModelItemViewModel.LoadChildren()
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddChild(TreeViewItemViewModel child, ModelProperty modelProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelProperty(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty, ModelProperty property)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelItem(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemModelItemViewModel.LoadChildren()
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddChild(TreeViewItemViewModel child, ModelProperty modelProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelProperty(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty, ModelProperty property)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelItem(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemModelItemViewModel.LoadChildren()
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddChild(TreeViewItemViewModel child, ModelProperty modelProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddChild(TreeViewItemViewModel parent, ModelItem item, Object value, Boolean duplicatedNodeVisible, String childNodePrefix, ModelProperty trackingProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelItemCollection(TreeViewItemViewModel parent, ModelItemCollection collection, ModelProperty trackingProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelProperty(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty, ModelProperty property)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelItem(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelProperty(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty, ModelProperty property)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelItem(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemModelItemViewModel.LoadChildren()
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddChild(TreeViewItemViewModel child, ModelProperty modelProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddChild(TreeViewItemViewModel parent, ModelItem item, Object value, Boolean duplicatedNodeVisible, String childNodePrefix, ModelProperty trackingProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelItemCollection(TreeViewItemViewModel parent, ModelItemCollection collection, ModelProperty trackingProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelProperty(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty, ModelProperty property)
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.AddModelItem(TreeViewItemViewModel parent, ModelItem item, ModelProperty trackingProperty)
at System.Activities.Presentation.View.TreeView.TreeViewItemModelItemViewModel.LoadChildren()
at System.Activities.Presentation.View.TreeView.TreeViewItemViewModel.set_IsExpanded(Boolean value)
at System.Activities.Presentation.View.TreeView.DesignerTreeAutoExpandHelper.Expand(TreeViewItemModelItemViewModel rootTreeViewItem, ModelItem modelItemToExpandTo)
at System.Activities.Presentation.View.TreeView.DesignerTreeView.ModelItemSelectionChanged(Selection selection)
at System.Activities.Presentation.ContextItemManager.SubscribeProxy`1.SubscribeContext(ContextItem item)
at System.Activities.Presentation.SubscribeContextCallback.Invoke(ContextItem item)
at System.Activities.Presentation.EditingContext.DefaultContextItemManager.OnItemChanged(ContextItem item)
at System.Activities.Presentation.EditingContext.DefaultContextItemManager.SetValue(ContextItem value)
at System.Activities.Presentation.View.Selection.SelectOnly(EditingContext context, ModelItem itemToSelect)
at System.Activities.Presentation.WorkflowViewElement.OnGotFocusEvent(Object sender, RoutedEventArgs e)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.FrameworkElement.OnGotFocus(RoutedEventArgs e)
at System.Windows.UIElement.IsFocused_Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyPropertyKey key, Object value)
at System.Windows.Input.FocusManager.OnFocusedElementChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.Input.FocusManager.SetFocusedElement(DependencyObject element, IInputElement value)
at System.Windows.Input.KeyboardNavigation.UpdateFocusedElement(DependencyObject focusTarget)
at System.Windows.FrameworkElement.OnGotKeyboardFocus(Object sender, KeyboardFocusChangedEventArgs e)
at System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)
at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
at System.Activities.Core.Presentation.FlowchartDesigner.<>c__DisplayClass14_0.b__0()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler), HResult -2147467261

I have copied project spaces in the past, with no issues at all. Does this sound familiar to anyone?
FWIW: Here am trying to copy a project into a blank process

I don’t particularly suggest copying entire workflows to a blank workflow. It’s better to just copy the workflow file and rename it.

But alas, you are trying to do that, so I’m wondering if the workflow includes activities that are not dependencies in your blank process. I would suggest installing some of the dependencies from your old process to the new one.

Another weird cause for these type of things is that there is a dependency installed in your new workflow that is not working. So, in this situation, you would want to uninstall the dependency causing the issue.

Sometimes, deleting all the dependencies from the project.json file, then reopening the workflow can fix some issues. And, reinstall the dependencies. - maybe there was a version that doesn’t exist anymore in Manage Packages

2 Likes

It seems like the variable order behaviour is a direct result of the order of variables in the XAML file. It is basically reading it from top to bottom, and this is the result.

It seems we have to watch out for the order then. To be sure that it is correct, it might be better to initialize your variables in directly in the workflow (this would allow you to easier predict the behaviour).

1 Like