NLPModelsIpopt.jl
NLPModelsIpopt.jl copied to clipboard
Permission denied error on Windows on opening tmp file
I am using NLPModelsIpopt to run ExaModels code (converted from JuMP model).
I am receiving permission denied error on Windows after the model is solved, presumably when results are queried. On Linux code runs correctly. I am using Julia 1.10.8, Windows 11 fully updated (24h2). My user is PC admin. Running Julia as admin did not help either.
Other backends such as JuMP default, symbolic AD or AmplNLWriter work correctly (using Ipopt or Ipopt_jll for these cases).
I am attaching the MWE and part of the stack trace.
ERROR: LoadError: SystemError: opening file "C:\\Users\\karlo\\AppData\\Local\\Temp\\jl_nuN0fQx4H6": Permission denied
Stacktrace:
[1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
@ Base .\error.jl:176
[2] systemerror
@ .\error.jl:175 [inlined]
[3] open(fname::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing)
@ Base .\iostream.jl:293
[4] open
@ .\iostream.jl:275 [inlined]
[5] open(f::Base.var"#445#446"{@Kwargs{}}, args::String; kwargs::@Kwargs{})
@ Base .\io.jl:394
[6] open
@ .\io.jl:393 [inlined]
[7] #readlines#444
@ .\io.jl:599 [inlined]
[8] readlines
@ .\io.jl:598 [inlined]
[9] solve!(solver::IpoptSolver, nlp::ExaModel{
Hey @KSepetanc ! Thanks for opening the issue. Do you have this issues every time you run your code or is it occasional?
Hi @tmigot ! I have this issue every time I run the code on Windows. It always works on Linux however.
I also see the same error in test of PR #125 (line 210 of Julia lts - windows-latest - x64 - pull_request).
Okay, so I opened a PR to patch this #127 . There are 4 informations that we extract from the log files:
- time reported by Ipopt. Note that we also return the file measured in Julia in
stats.solver_specific[:real_time] - number of iterations
- primal feasibility
- dual feasibility
It has to be investigated further why we no longer have access to the output file, and identify wether this comes from the C-interface.
If we only care about primal and dual feasibility, we can also calculate these quantities manually, see #105 .
Yeah can't you use an intermediate callback to store this information?
Don't know if this helps, but using current release version on Windows I am getting after solve:
┌ Warning: could not parse Ipopt log file. SystemError("opening file \"C:\\\\Users\\\\karlo\\\\AppData\\\\Local\\\\Temp\\\\jl_aBUnQP0bI9\"", 13, nothing)
└ @ NLPModelsIpopt C:\Users\karlo\.julia\packages\NLPModelsIpopt\OGzSv\src\NLPModelsIpopt.jl:297