NLPModelsIpopt.jl icon indicating copy to clipboard operation
NLPModelsIpopt.jl copied to clipboard

Permission denied error on Windows on opening tmp file

Open KSepetanc opened this issue 9 months ago • 5 comments

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.

mwe.zip

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{

KSepetanc avatar Feb 12 '25 17:02 KSepetanc

Hey @KSepetanc ! Thanks for opening the issue. Do you have this issues every time you run your code or is it occasional?

tmigot avatar Feb 13 '25 23:02 tmigot

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).

KSepetanc avatar Feb 13 '25 23:02 KSepetanc

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 .

tmigot avatar Feb 16 '25 16:02 tmigot

Yeah can't you use an intermediate callback to store this information?

odow avatar Apr 02 '25 23:04 odow

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

KSepetanc avatar Apr 19 '25 18:04 KSepetanc