Module 'git' has no attribute 'refs', access violation in UDF

Hello,developers!
When I want to save the following project, the warning "Version control operation failed: module ‘git’ has no attribute 'refs’s " appears , and when I want to run the case, I get the solver crash error , I don’t know how to fix them, can you help me check what’s wrong? Attaching my case here.
Thank you very much!
6a07bdf15504d3d22f0ebe1bda78769


experiment-0505.mfx (29.0 KB)
usr_rates.f (6.6 KB)
usr_rates_des.f (7.3 KB)

Hi @wangjinjing

To be clear, these are two unrelated errors. The “Version control operation failed” message can be safely ignored. MFiX uses “git” internally to track changes to your project. (You can see these changes if you switch to “History” mode.) However, MFiX can operate fine without the version control, this is provided purely for user convenience. It looks like something may have changed in the Git library we use. Please either send a full bug report or the output of mfixversioninfo or the output of mamba list which will help me see what package versions you are running so we can resolve this.

The second problem is an access violation in your UDF. Sometimes building the solver in “DEBUG” mode will help track these down. Also, if you have access to a Linux host (either real Linux or via a VM on Windows) you will find it easier to debug UDFs since you will have access to better diagnostic info on Linux.

Line 166 of usr_rates_des.f is

      ReactionRates(IJK,lB:uB) = ReactionRates(IJK,lB:uB) + DES_RATES(:)

so something there - either the IJK or the ib:ub bounds is outside the valid range. In the absence of a good debugger, you can try adding PRINT statements to see what’s going on. But I think the problem is here:

This is a fairly common error - failing to allocate the ReactionRates array.

HI,here’s my bug report for you to check out.Thank you!
combustioncase_2024-05-07T071952.280774.zip (6.2 MB)

I’m having difficulty reproducing this error. Can you answer a few questions for me?

  1. Do you get the same problem if you create a new project, or is it only in this project?

  2. Does the project directory combustioncase have a subdirectory called git?

  3. With the mfix environment activated, does typing git status at the command prompt (in your project directory) work?

  4. WIth the mfix environment activated, what do you get if you type

  python -c 'import git; print(git.refs)'

at the command prompt?

Thanks!

– Charles

Sorry to take so long to get back to you.
1.I’ve only get this problem in this project.
2.The project directory does not have a subdirectory named “combustioncasegit”.
For the third and fourth points, I am not sure how to proceed. I tried typing the code you mentioned on anaconda prompt but I have the problem in the picture.

You need to type it exactly as Charles said:

git status

and

python -c 'import git; print(git.refs)'

Can you make a ZIP file of the entire project directory and upload it here?

I type it exactly as Charles said:

17947653c65e6f63af3ced1f416513c

This is my ZIP file of the entire project directory.
YH.zip (29.6 MB)

Thank you. It is more helpful to have output in English since we don’t read Chinese.

Please type git status from inside the project directory … it looks like you typed it in your home directory C:\Users\18370. You must cd to the project directory first… this is something like E:\WJJ\biomass\YH (from looking at the log file).

The second command failed because Windows does not like the single ' character… sorry … the command I wrote works on Linux but not on Windows … on Windows we have to do

python -c "import git; print(git.refs)"

you should be able to copy-paste that into a command prompt.

Thanks for your patience, I hope we can fix this problem soon.

– Charles

I tried again as you said:

The second one is correct. The first one should be

 cd E:\WJJ\biomass\YH
 git status

Two commands, the first one to set the current directory, the second one to get the status of that project. (I’m assuming that E:\WJJ\biomass\YH is your project directory.

Sorry for the trouble.

– Charles

Hi, it seems that the problem "Version control operation failed: module ‘git’ has no attribute 'refs’s " is gone now, but a new problem (as shown in the picture) has appeared,but it doesn’t seem to affect the case.
What puzzles me is that the mass fraction of H2O < 0,I tried to adjust the reaction rate but it still didn’t solve the problem, are there any other parameters I can change?
Thank you!


Hi @wangjinjing

Sorry for the delay, I’ve been out.

Since we are no longer discussing the Module 'git' problem, could you please create a new topic, with the current version of your project attached? I’m closing this topic now.

Thanks.

– Charles