No preference with name `tempfiles.saving.warnifoverwriteolder`
See original GitHub issueHi,
First of all, thanks for sharing the great project MPh! I am looking forward to using it.
Today I tried to set it up on my system (Win 10 Enterprise, 64-bit). The installation via pip worked but I encountered some problems when using mph.start() as described in the tutorial.
Please find the log below - do you have an idea how to fix this issue?
This would be much appreciated, thank you.
Kind regards,
Philipp
In [2]: import mph
In [3]: client = mph.start(cores=1)
Traceback (most recent call last):
File "SourceFile", line 396, in com.comsol.model.util.ModelUtil.setPreference
File "SourceFile", line 619, in com.comsol.model.util.ServerModelUtil.setPreference
File "AccessController.java", line -2, in java.security.AccessController.doPrivileged
File "SourceFile", line 622, in com.comsol.model.util.ServerModelUtil$19.run
File "SourceFile", line 2530, in com.comsol.nativeutil.preferences.Preferences.setPreference
Exception: Java Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<ipython-input-3-9a0936dc3385>", line 1, in <module>
client = mph.start(cores=1)
File "C:\Users\p\Anaconda3\lib\site-packages\mph\session.py", line 103, in start
client = Client(cores=cores, version=version)
File "C:\Users\p\Anaconda3\lib\site-packages\mph\client.py", line 141, in __init__
java.setPreference('tempfiles.saving.warnifoverwriteolder', 'off')
com.comsol.util.exceptions.FlException: Exception:
com.comsol.util.exceptions.FlException: No preference with the name X was found#tempfiles.saving.warnifoverwriteolder
Messages:
No preference with the name X was found#tempfiles.saving.warnifoverwriteolder
Issue Analytics
- State:
- Created 2 years ago
- Comments:8
Top Results From Across the Web
mph.client - MPh 1.2.0 - Read the Docs
It thus maps vendor strings to # product names (add-on modules), except that we ... Override certain settings not useful in headless operation....
Read more >tempfile — Generate temporary files and directories — Python ...
This module creates temporary files and directories. It works on all supported platforms.
Read more >Saving always creates a .tmp file, can't see preview of the file ...
tmp file, can't see preview of the file and cannot import AI file to After Effects. as title says, my Illustrator 2020 (24.0.1)...
Read more >Tempfile save - Statalist
I want to save two sub datasets for treated=0 and 1 separately. My question is if I should use preserve , then restore...
Read more >Description of the way that Excel saves files - Microsoft Support
Excel creates a randomly named temporary file (for example, Cedd4100 with no file name extension) in the destination folder that you specified in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi Philipp. I also hope you can put this library to some good use. There is nothing you did wrong here, this is supposed to work.
However, while the documentation says that “versions from Comsol 5.1 onward are expected to work”, I’ve only ever tested with Comsol 5.5 and 5.6. And you’re probably using a somewhat older version. One that doesn’t have the
tempfiles.saving.warnifoverwriteolderpreference. Comsol does not seem to have a changelog that would document when they introduce new preferences, so I will only learn about that from bug reports such as this one.Now this is easily fixable in library code. We can just ignore that error when the preference does not exist. I will fix that in the next release, which should be out by the end of the week if things go well.
The reason, by the way, why MPh tries to override some preferences is that we often run many simulations back to back. That’s in fact the raison d’être of MPh. And Comsol produces a lot of temporary files, in particular recovery files, that could easily fill up the hard drive, but serve little purpose when not using the GUI.
If you don’t want to wait until the new release, you can also comment out the offending line, any maybe the one after that too, right in the MPh code of your local installation, in the
client.pyfile mentioned in the error message.https://github.com/MPh-py/MPh/blob/ab2ddb7a396b154c876b9aaba0b36ca9c00abe98/mph/client.py#L141-L142
Fixed in MPh 1.1.0, released today.