Troubleshooting
Kratos not found
Symptom: kratos_check_installation returns importable: false, tools report "Kratos is not available".
- Set
KRATOS_ROOTto a checkout that containsbin/Release/KratosMultiphysics/. - If your build lives elsewhere, set
KRATOS_PYTHONPATH(dir containingKratosMultiphysics/) andKRATOS_LIBS(itslibs/). - Remember the variable must reach the server process: pass it via the MCP client's
envblock, not just your shell.
libmkl_rt.so.2: cannot open shared object file
The LinearSolversApplication was built against Intel MKL. The server auto-detects MKL at /opt/intel/oneapi/mkl/latest/lib; if yours is elsewhere:
export KRATOS_EXTRA_LIBS=/path/to/mkl/libSimulation runs but displacements are exactly zero
Almost always: the mesh uses geometric conditions (LineCondition2D2N, SurfaceCondition3D4N) where load conditions are needed (LineLoadCondition2D2N, SurfaceLoadCondition3D4N). Geometric conditions silently ignore LINE_LOAD/SURFACE_LOAD. The solver even prints a hint:
ResidualBasedBlockBuilderAndSolver: ATTENTION! setting the RHS to zero!Regenerate the mesh with the right condition_name (the tool defaults are correct for structural cases), or apply a nodal/volume load instead.
Error: Element ... is not registered in Kratos
- The application registering that element is not compiled into your build — check with
kratos_list_applications, andkratos_list_elementsshows acompiledflag per element. - Watch the exact spelling and node count (
SmallDisplacementElement2D4Nexists;LaplacianElement2D4Ndoes not — the Laplacian family only has simplex variants).
Found a condition without any corresponding element (thermal/fluid)
The convection-diffusion solver's mesh checks require simplex meshes. Generate thermal meshes with triangles: true and element_name: 'Element2D3N'. Every condition must also be a face of some element — generated meshes guarantee this.
Stationary thermal analysis behaves like one transient step
solver_type: stationary still uses the transient element by default. A true steady state needs:
"element_replace_settings": { "element_name": "LaplacianElement", "condition_name": "ThermalFace" }The thermal_stationary template includes this.
Job stuck in running / server restarted mid-run
Jobs are detached processes; a server restart does not kill them. job_status re-evaluates state from pid liveness and the log tail. If a pid was reused and the state looks wrong, job_cancel forces the record to cancelled.
Interactive session is busy, dead or lost
busy: true(fromsession_advance): the call outlived itstimeoutbut the worker is still solving. It is not lost — pollsession_statusuntilbusyisfalse, then continue. Raisetimeoutfor long steps.dead: the Kratos process exited (usually a C++ abort on bad input or a diverged solve).session_status(session_id, log_tail=60)shows the exit code and the end ofsession.log; fix the case andsession_startagain. The MCP server itself is unaffected.lost: the session belonged to a previous server process. Sessions live in memory and do not survive a restart; start a new one (use a batch job with checkpoints for work that must survive).session_exec_python is disabled: start the server withKRATOS_MCP_ALLOW_EXEC=1(for exampleclaude mcp add kratos -e KRATOS_MCP_ALLOW_EXEC=1 -- uvx kratos-mcp-server). It runs arbitrary code as your user, which is why it is opt-in.Too many open sessions: close one withsession_close, or raiseKRATOS_MCP_MAX_SESSIONS(default 4).Multi-stage cases cannot be stepped/CoSimulation ... cannot be stepped/Partitioned FSI cases cannot be stepped/Cases with an mmg_process ... cannot be stepped/serial/OpenMP only: sessions drive oneAnalysisStage; userun_simulationfor orchestrated, coupled-solver or MPI cases.
MMG remeshing is not available / remeshed run dies with SIGSEGV
mesh_remeshandvalidate_caseneed aKratosMeshingApplicationbuilt with MMG. The pip wheel has it:kratos_install(applications=["MeshingApplication"]); a local build needs-DUSE_MMG=ON.- A job that crashes (
returncode -11) right afterMMG Remeshing Process: Remesh finishedhas anmmg_processthat remeshes inside the solution loop. Standard solvers cannot survive that; useinitial_remeshing: trueormesh_remeshon the.mdpa. There is no sub model part with name "X" in model part "Y":freeze_sub_model_partsandfix_contour_model_partstake names relative to the root model part (left, notMain.left).
No MPI launcher available / no MPI support
run_simulation(mpi_ranks=N) checks before creating a job that an MPI launcher exists (mpiexec, mpirun, or KRATOS_MPI_LAUNCHER) and that the Kratos build can import KratosMultiphysics.mpi. kratos_check_installation reports both under mpi. The pip wheels are serial; use a build with -DUSE_MPI=ON (and TrilinosApplication for the Trilinos solver presets). If the launcher refuses more ranks than cores, add KRATOS_MPI_ARGS=--oversubscribe (OpenMPI). MPI jobs also require problem_data.parallel_type: "MPI".
Tool calls are slow the first time
The first bridge call after a (re)build spawns a Kratos interpreter (~1–3 s) and repopulates the disk cache under ~/.kratos-mcp/cache/. Later calls are instant. Deleting that directory is always safe.
model_part_name '...' does not match any SubModelPart
validate_case compares every model_part_name in your processes and materials against the mesh. Names are dotted paths rooted at the solver's model_part_name — for a solver rooted at Structure and a mesh part left, write Structure.left. Use mdpa_inspect to list the parts a mesh actually contains.
Debugging a failed run
job_status(job_id)— how far did it get (progress.current_step)?job_logs(job_id, tail=200)— the Python traceback or Kratos error is at the end.results_convergence(job_id)— nonlinear steps that hitmax_iteration.validate_case(case_dir)— re-check the configuration.
The debug_failed_simulation prompt packages this workflow.