Main Flow Chart: Sequence Contains No Elements

I created an automation a couple of days ago that was working great, even uploaded it to orchestrator and was able to run it. However, I needed to make a quick edit and now nothing is working.
The only change I made was to a couple of variables (just a file path), now I’m getting the error “Main Flowchart: Sequence contains no elements”. Total error statement below.
I tried a restart. I tried reverting all my changes and had no luck. I tried opening a new project and copying everything over with the old variables and still no dice.

RemoteException wrapping System.InvalidOperationException: Sequence contains no elements
at System.Linq.ThrowHelper.ThrowNoElementsException()
at System.Linq.Enumerable.First[TSource](IEnumerable1 source) at Namespace_481e.Main_Expressions.Main_Expressions_TypedDataContext2_ForReadOnly.__Expr0Get() at Namespace_481e.Main_Expressions.Main_Expressions_TypedDataContext2_ForReadOnly.ValueType___Expr0Get() at Namespace_481e.Main_Expressions.InvokeExpression(Int32 expressionId, IList1 locations,
ActivityContext activityContext)
at System.Activities.Expressions.CompiledExpressionInvoker.InvokeExpression(ActivityContext 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)


can you try this?


Thanks for the quick reply. Tried opening a couple of different projects and going back to the problem one - no changes.


Canyou try closing the project and then rename the project.json to project_old.json and reopen the project…

Also alternately once reopened please temove the connections and re add them


Thanks for the suggestion!
Oddly enough, every time I open the project after changing the name of the file, it simply creates another project.json text file.

Tweaking the connectors didn’t do anything, perhaps as a result of the project.json file being created again.


The whole purpose of renaming project.json is to recreate it fresh if it had any issues

Now can you try changing the system activities package to any other version or upgrade to latest version


That’s the point.

But you’ll lose some things - like the packages (dependencies) you had installed - so you may run into other issues.

I see, thanks for explaining.
I’ve downgraded packages, particularly the system activities package, tried to debug and got the same error. I reupgraded them and still same error.


can you try replacing all your inverted comma(don’t copy…delete and re add) you used in variables/arguments

and also delete the connection from start and re add it

or if you can attach the whole process here I can check from my side as well


I found the issue after doing more step-by-step troubleshooting
It was related to one specific variable where the element did not exist for that variable. Unfortunately, it didn’t specify the variable was the problem in any error messages.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.