Warning ".flair file has changed since editing started" on WSL

Dear community,

I have been receiving repeatedly during my flair runs a strange warning stating that my current project’s .flair file has been altered since editing started. The warning also prompts me to reload the new version, thus interrupting the current run or decline.

However neither the .flair file nor the .inp have been altered since the start of the simulation…

Any suggestions on how to resolve this issue?

Best regards,
Nikos.

Dear @nnikolop

the cases that this can happen are

  1. you changed externally the .flair or .inp file, which is a valid way of working (not your case as you explained)

  2. You are writing in a remote mounted file system that has a time which is different (>1 second) from your mounting computer. So when the file is written it reports a different timestamp than your computer and flair thinks that the file was changed externally.
    If this is the case try to correct the NTP on both computers

  3. A bug during the writing and the file is written incomplete.
    If this is the case you should see error messages in the output or on the bug report of flair. Please send us the .flair file and the error messages so we can debug it.

Dear @vasilis,

given the fact that I am running flair through Ubuntu 20.04 - WSL2, I immediately checked if the system date for windows is in correspondence with the date of the WSL2 environment, during a simulation I started with flair. The screenshot I am attaching below proves that indeed there is a discrepancy of at least 1 sec between the two systems.

Date_Windows_vs_WSL

I am currently investigating how to synchronize the two systems, by correcting the NTP as you indicated.

Gratefully,
Nikos.

Thank you nikos, its interesting to know that this can happen also in WSL

Dear Nikos,

I did experience as well, similarly on WSL2 with Ubuntu 20.04.

Yesterday I tried to reproduce it again, but I wasn’t able to. After a bit of searching, I found that there was a kernel update for WSL2 about a month ago, fixing an issue about the clock synchronisation between Windows and Ubuntu. (Release Notes for WSL kernel | Microsoft Docs)

Can you check if you have the 5.10.16.3 kernel, with the command uname -r?

The time difference you saw can be just a coincidence as the two commands weren’t run exactly at the same time.

Cheers,
David

Dear @horvathd,

I came across a similar post pointing me towards 5.10.16.3 kernel. I am currently running 5.4.72-microsoft-standard-WSL2.

kernel

I also realized that running this command:

sudo ntpdate pool.ntp.org

temporarily fixes this issue.

Should I install 5.10.16.3 kernel?

Best regards,
Nikos.

Dear Nikos,

the new kernel is / will be automatically installed via Windows Updates.

Since updating the time also works, it is up to you if you wait for the automatic update, or install it manually.

This post could help with the manual installation: How to update the WSL2 kernel on current Windows 10 · Issue #5650 · microsoft/WSL · GitHub

Cheers,
David

Hello @horvathd,

another update, the new kernel was installed as you indicated (screenshot attached below).

kernel_version

Nevertheless, I still get the same warning at the beginning of my run (second screenshot attached).

Any suggestions?

Thanks,
Nikos.

Dear Nikos,

then it seems the issue is due to the low I/O performance of WSL2 in the /mnt directory (Why is WSL2 so slow? - DEV Community)

The workaround would be to run the simulation the your linux home, instead of the shared location.

The Linux file system is accessible from windows via \\wsl$ (https://www.howtogeek.com/426749/how-to-access-your-linux-wsl-files-in-windows-10/)

Cheers,
David

Dear Nikos,

after some further reading, it seems this solution also has its drawback: The disk used by the virtual machine of WSL2 is not freed, when files are deleted. (WSL 2 should automatically release disk space back to the host OS · Issue #4699 · microsoft/WSL · GitHub) This could / will reduce the available disk space on the Windows drive.

So it seems one solution remains: Switching back to WSL1 (if you are not using other software which requires WSL2). (Comparing WSL 1 and WSL 2 | Microsoft Docs) This can be done with the command:

wsl --set-version <distribution name> 1

(https://www.tenforums.com/tutorials/164318-how-set-linux-distribution-version-wsl-1-wsl-2-windows-10-a.html)

Cheers,
David

Dear @horvathd,

thanks for this update, it could have caused me a lot of trouble by reducing dramatically the available space on the Windows drive.

I successfully switched back to WSL1

wsl_version

however docker seems still to be running on wsl2 (flair does not depend on Docker, it was just running on the background).

Gratefully,
Nikos.

Dear Nikos,

I don’t see any issues with this setup. WSL1 and WSL2 can be used in parallel.

Cheers,
David

1 Like