Global Variables are not declared after reopening the file

Hi,

Studio version: 22.10.4

I am stuck with the problem or actually two problems.

  1. I think there might be some memory access problem with UiPath version 22.10.4, although there is always around 2-4gb of RAM resources, I’ve been getting the 'this operation couldn't be completed due to lack of memory' errors.
  2. After this happens, reopening the project will cause all of the global variable used to be shown as not declared when trying to compile the project.
    It’s a real pain in the ass.

Steps to reproduce:

  1. Declare a global variable.
  2. Use the variable in the workflow
  3. Get 'this operation couldn't be completed due to lack of memory'
  4. Reopen the project.
  5. Try to compile the project.
  6. Error will happen

Steps to fix:

  1. Open workflow with an error.
  2. Click on the activity using the variable.
  3. Repeat for all the errors.

I decided to use global variables in big projects in case of config dict and some other variables which would need to be passed throughout the whole project, however as it is rn the feautre seems unusable. The whole purpose of using it (speeding the development) is being defeated by time I have to spend to open each workflow and check the variables.

Btw I have tried using variables with full namespace, partial namespace or without namespaces, non of this seems to be working.

Please have a look at it.

@GT_Ropa can you please share a sample of a workflow where global variables are not working properly? We had some issues but hopefully, they will be fixed with the incoming 23.2 release.

If you can share a sample workflow we can also validate this scenario.

@alexandru

I have checked but it seems that I didn’t commit before changing from global to normal variable/arguments. The earliest commit is already after the change so I don’t have the workflow.

@alexandru,
I am in the same issue, I declared global variables to use as static variables for supporting to re-call those variable in child-workflow or process in project. It worked perfectly at first time BUT, after reopening the error showing that [Global variable] is not declared.


2 Likes

Nothing for this yet? I’m having the same issues.
What’s weird is the code runs fine, but when I go to publish I get these errors

I’m in the same boat, global variables are unusable for me.

Hopeful for an official statement.

Hi @Nguyen_Van_Tuan , @BCod and @GSC - could you kindly share a sample workflow that triggers the indicated error? It may be that the issue is already fixed in the soon to be 23.2 release, but we would need to confirm this first.
Also, any other information might help - such as if the process is under source control (GIT/TFS/SVN) or in what activity or expression used the Global Variable triggers the error.
Thanks so much!

My issue seemed to solve itself but unfortunately I’m not sure what I did. Sometimes closing out of studio and relaunching did not fix it, but eventually it did.

1 Like

Hello @coramia !

Thanks for taking interest.

I was working on this today and found a workaround of my own: if I gave my global variables default values, the problem went away. But maybe that wasn’t needed and it fixed by opening and closing? Hard to know with just one sample. I’ve noticed my automation has become very unstable since I converted it to windows.

The process was under source control (GIT).

Cheers.

1 Like

Thank you for the reply! Could you please let us know at least if the Global Variable used had a default value or not, , and if the process was under GIT or any other source control? Thank you!

Thank you @GSC - was there maybe any specific expression that you used with the global variable in the activity that triggered the error?

Hard to say the error warnings were all over the place, it’s a large project with over 60 workflows.

Most of my globals are used as parameters for activities such as asset names, file paths and so on. I can tell some of the errors happened in the same workflow were the globals are given a value, which surprised me.

I apologize I can’t offer a more precise answer.

1 Like

Thank you very much for the reply!

1 Like

I’m having the same issue Global variables completely unusable, I can sometimes make the error go away by clicking on the areas its used but there doesn’t seem to be any consistency and the error returns a run or two later

Same kind of problem here.

With Studio 2022.10.5, I created a new project based on REFramework. My goal was to remove in_Config dictionary from arguments and instead create a global variable g_Config and refer to that in the project.

So, I started to remove in_Config arguments from xamls and replace the logic to use g_Config. No problems with SetTransactionStatus.xaml, but when I started to fix RetryCurrentTransaction.xaml, suddenly all it’s Log activities give the same error “g_Config is not declared”.

Restarting Studio does not help. However, sometimes when loading the project and/or running Validate Project, I also get other errors also from other xamls, sometimes not. No logic there. One example of one error:

Tried to set the default variable for g_Config, but that also gives an error (seems like a bug):

image

1 Like

Someone with solution … the same problem here. The possibility to make Config as Global is really good but open all project to “teach” UiPath with the globals is really hard.

I had this problem once again when I created global variables in an older file. I don’t know what fixed it last time, but I’m pretty sure opening and closing the project eventually fixed it.
That didn’t work this time. I had to Analyze Project, then refresh the Project directory to see all of the xaml files with errors. Then I opened up each one. No errors are ever seen on the activities, but errors show when I run Analyze File. I fixed the issue by creating a variable called “config” (identical to the global variable called ‘config’ that’s having the issue), then Analyze File, which wipes away the errors, then delete the local config variable. I didn’t have to click Analyze File again after this, but whenever I did, no errors were shown.

EDIT:
Nevermind…this let the project run successfully at first, but if the project is closed and reopened, all of the same errors for the same files (plus a few extra this time!) pop right back up
@coramia Please help. I may have to abandon updating my older projects, which would be very frustrating.

image

Any update on this? The issue still persists in Studio 2022.10.3 (enterprise) and also Studio 2023.4.0 (community edition). Our StateMachine production frameworks (Windows compatiblity) will rely on globals for the long run, at least when it comes to framework variables (config, exceptions etc). So far, it’s been a blocker, thus, would be great to know when this issue it’s going to be addressed. Thanks.

Hello. Did someone find explanation(s) and/or a solution to fix this chaotic situation with global variables not declared when you (re)open a package?

Only thing you can do is wait.
Wait for 5 minutes after you load the project.
Or check your task manager.
When the power usage in the ‘Very high’ stage, just wait until the power usage away from the ‘Very high’ situation.

What I can say that the Studio grows up too huge now.
And it needs to have time to settle all variables.

Good Luck everyone.