OpenGeoRock
5.5

Error codes

Describes OGR Slip2D 0.1.481

When OGR Slip2D cannot give a factor of safety, it says why, in a form a program can read as well as a person. A rejected surface carries one of four negative codes in place of its factor of safety, with a failure reason behind it. The admissibility checks, the errors of the operations layer and the MCP server, and the exit codes of the command-line programs follow.

5.5.1Surface error codes#

A surface that has no admissible factor of safety keeps its place among the results, and a negative code is written where its factor would be. How the checks behind −120 and −112 work is explained in Section 3.3.

Table 5.5.1 Codes written in place of the factor of safety of a rejected surface.
CodeMeaningWhen
−120Tensile stress at a slice baseThe Tensile Stress Check is on and rejected the surface.
−112m-alpha below its limitThe m-alpha check rejected the surface: mα<0.2m_\alpha < 0.2 on a slice of a method it applies to.
−111No converged factor of safetyThe calculation ended without a converged factor, whatever the reason: the iteration limit, a λ that could not be bracketed or closed, a collapsed mαm_\alpha or nαn_\alpha, a mass that does not slide, a surface to which rapid drawdown does not apply… The reason is recorded separately (Section 5.5.2).
−101Any other rejectionA converged factor rejected by another criterion, such as a Spencer or GLE answer whose interslice thrust is inadmissible, or a surface the checks could not evaluate.

One function gives the code of every rejected evaluation, in this order:

  1. a valid surface that passed the checks has no code;
  2. rejected by the Tensile Stress Check: −120 (tension is tested first, so a surface failing both checks is a tensile rejection);
  3. the checks themselves could not be evaluated: −101;
  4. rejected by the m-alpha check: −112;
  5. no converged factor: −111;
  6. anything else: −101.

Because −111 covers every calculation that produced no converged factor, it is not only a convergence problem: circles whose mass does not slide (zero_driving) and, in a rapid-drawdown analysis, candidates to which the procedure does not apply (drawdown_not_applicable) are −111 too, as are the surfaces Sarma's method refuses (sarma_refused), and the reason tells them apart. A surface rejected before it could be sliced has no result and no row. Since v0.1.445 the census of the Interpret window counts some of these rejections with a code, each with its own reason: −101 when an end of a polyline is not on the ground, its base rises above the ground, an end daylights outside the Slope Limits or a circle does not cut the ground twice, and −103 when a circle leaves the External Boundary between its crossings with the ground. The rest count as not sliced. No surface carries −103, because such a circle is never sliced.

The codes appear in the Interpret window (Data → Export Raw Data…, whose last column holds the factor of safety or the code; Data → Summary of Invalid Surfaces…; Query → Query Invalid Surfaces, which shows the code of grid centres with no valid surface; and the Surfaces with error code option of the surface filter), and in the MCP tool results_query (views error_codes, invalid_summary, raw_data and filter). The HDF5 results file stores no code: a surface without a factor has no fos attribute and carries its reason (Section 5.4.5).

In OGR Slip2D

The four codes are the constants ERROR_TENSILE, ERROR_M_ALPHA, ERROR_NOT_CONVERGED and ERROR_OTHER, and error_code() is the single mapping used by the raw-data export, the census of the Interpret window and the MCP server. The fifth, ERROR_LEAVES_EXTERNAL (−103), is counted on the search result, never by error_code().

Source: ogr_slip2d/interpretation.py

5.5.2Failure reasons#

An evaluation that produced no factor of safety has fos = None (never NaN), an error_message written for a person and a reason written for a program: one of the strings below, so that a run can be summarised as "this reason, so many surfaces" without parsing prose. The reason is the reason attribute of a surface in the HDF5 results file and the reason key of a surface in the answers of the operations layer and the MCP server.

Table 5.5.2 Machine-readable reasons why a calculation has no factor of safety.
ReasonMeaning
no_slicesThe surface produced no slices at all.
no_shear_strengthNo slice base offers any shear resistance.
zero_drivingThe total driving moment (or force) vanishes: the mass does not slide, so there is no factor of safety to report. It keeps extremely high factors from being computed when the driving force is very small.
active_support_exceeds_drivingActive support alone exceeds the driving moment.
m_alpha_collapsedmαm_\alpha collapsed towards zero on a slice base.
n_alpha_collapsednαn_\alpha collapsed towards zero on a slice base (the analogue in Janbu's methods).
non_physical_fosThe arithmetic produced a factor that is not a physical one: zero or negative, or not a finite number.
not_convergedThe iteration ran out of passes before the factor settled. There is a number, the last iterate, but it is not a converged value; the iteration limit is the setting to look at.
all_lambda_divergedEvery sampled interslice ratio λ diverged, leaving no branch to solve on (Spencer, GLE).
no_lambda_bracketThe sampled range of λ never changed sign, so the root is not bracketed.
divergent_at_lambdaThe solution diverged at the λ finally chosen.
lambda_not_closedThe bracket on λ was found and refined, but ∣Ff−Fm∣|F_f - F_m| is still above the tolerance at the λ returned.
no_force_bracketThe force balance of the prescribed-inclination methods (Lowe–Karafiath, Corps of Engineers #1 and #2) found no bracket; what it has is the sampled factor of smallest residual, a fallback, not a solution.
force_balance_divergedThat force balance produced no usable factor.
drawdown_not_applicableThe rapid-drawdown procedure does not apply to this surface. Not an engine failure: in a search most candidates are like this.
unsliceable_at_drawdownThe surface could not be sliced at the drawn-down level.
envelope_not_convergedThe strength envelope depends on the normal stress, and the stress it was read at never settled on the stress the method resolved, so the factor is not that of the envelope (since v0.1.213).
sarma_refusedSarma's method refused the surface: its wedges could not be built, a face is parallel to a base, or the surface crosses a support (since v0.1.464). The message_code of the result says which (Table 5.5.3).

Sarma's method#

Besides its reason, a result without a factor carries a finer code, message_code, with its values in message_args; the answers of the operations layer and the MCP server include both. For Sarma's method with non-vertical slices the codes are these:

Table 5.5.3 Why Sarma's method gives no factor of safety for a surface: the message code and the reason it falls under.
Message codeReasonWhen
lem.sarma_supportssarma_refusedThe surface crosses a support; the method does not take supports.
lem.sarma_face_parallelsarma_refusedA face is parallel to the base of a wedge.
lem.sarma_face_horizontalsarma_refusedThe angle given to a face is horizontal.
lem.sarma_face_no_exitsarma_refusedA face does not reach the ground inside the model.
lem.sarma_faces_crosssarma_refusedTwo faces cross inside the sliding mass.
lem.sarma_wedge_invalidsarma_refusedA wedge is not a polygon inside the sliding mass: one of its faces leaves the mass through the slip surface.
lem.sarma_wedge_outsidesarma_refusedPart of a wedge lies in no region with a material.
lem.sarma_face_strengthsarma_refusedThe face takes its strength from the materials and crosses one whose strength model is not Mohr–Coulomb; the face then needs its own c and φ.
lem.sarma_excess_pore_pressuresarma_refusedThe excess pore pressure of undrained loading (B̄) is on; the method does not compute it.
lem.sarma_no_drivingzero_drivingKc reaches the applied kh only with the strength divided by more than 106, or never: the surface does not slide.
lem.sarma_no_rootnon_physical_fosKc stays below the applied kh for every factor of safety down to 0.01.
lem.not_convergednot_convergedThe iteration on F ran out of passes.
lem.sarma_drawdowndrawdown_not_applicableThe method was reached in a rapid-drawdown analysis by a route that does not skip it first.

Like every result with no converged factor, these surfaces have the code −111. Two conditions of the whole run are not reported surface by surface: with rapid drawdown, or with the excess pore pressure of loading, the method is not computed at all and the run says so once (notes method.sarma_drawdown and method.sarma_excess), and a value of settings.sarma it cannot take skips it with method.sarma_bad_setting, naming the field. Other notes of the run keep the factor and qualify it: method.sarma_near_pole when the least |q| of the faces is under 0.2, so that the factor is a root of Kc(F) = kh next to a pole (v0.1.466), method.sarma_near_pair when such a factor also lies close to a pole of Kc, giving the next root down (v0.1.470), method.sarma_tension when a base or a face carries an effective normal force in tension, method.sarma_verticalized for faces made vertical, and method.sarma_vertex_data_unused for data given at vertices that did not reach the surface analysed. In the notes of a run each one keeps its code beside the sentence.

In OGR Slip2D

The sentence and its code are written together, by one function, so they cannot disagree; the reasons stay coarser on purpose, because they group the census of invalid surfaces. A refusal comes back as a result with no factor and its code, never as NaN or as an exception that stops the run.

Source: ogr_slip2d/messages.py · ogr_slip2d/methods/sarma.py · ogr_slip2d/sarma/wedges.py · ogr_slip2d/method_note_messages.py
In OGR Slip2D

The reasons are the REASON_* constants, and ALL_REASONS is the set every method's reason must belong to, so that a new reason cannot be introduced as a loose string. They are deliberately not translated: the interface translates the message where it shows it.

Source: ogr_slip2d/methods/base.py

5.5.3Admissibility checks#

A surface that fails an admissibility check has not failed to compute: its factor converged and is kept, because the searches that steer by the factor of safety need it. The surface is judged inadmissible afterwards and is not reported as the critical one, unless every valid surface is inadmissible; in that case the checks are ignored and the result says so. The verdict is recorded in admissible, admissibility_note and admissibility_reason, with these values:

Table 5.5.4 Admissibility checks, their code and their default.
ReasonCodeCheckDefault
tensile_stress−120Tensile Stress Check: the effective normal stress of the method's own solution on a tested slice base is a tension larger than the material's tensile strength, which is zero except for the two Hoek–Brown models (s σci/mbs\,\sigma_{ci}/m_b). Only a percentage of the slices, counted from the toe, is tested (95 % by default), because the slices at the crest are legitimately in tension.off
m_alpha−112m-alpha check: mα<0.2m_\alpha < 0.2 on any slice at the final iteration (Whitman & Bailey, 1967), with Bishop's denominator, for Bishop simplified, Janbu simplified and corrected, Spencer and GLE; Sarma's method divides by a denominator of its own and is not screened. A value below the limit does not by itself mean the factor is wrong; it screens out surfaces whose arithmetic has become untrustworthy.on
screen_error−101The checks themselves raised an error, so the surface could not be judged; it is rejected rather than let through (since v0.1.211).—

Both checks are set in Analysis → Project Settings → Advanced (Tensile stress check with its Percentage of slices, and Check m-alpha < 0.2).

5.5.4Errors of the operations layer and the MCP server#

An operation of ogr_api that fails on purpose raises an OgrApiError with a stable code, a message, a hint where there is one and, sometimes, details. An MCP client receives it as [E_CODE] message Hint: hint; a Python script catches it and reads code, message, hint and details. The codes are stable; the wording of the messages is not. An unknown name always comes with the closest known names (Did you mean …?).

Table 5.5.5 Error codes of the operations layer, the MCP server and the agent bridge.
CodeRaised when
E_NOT_FOUNDA handle, id or name that does not exist: a project_id, result_id or job_id, an operation, a file to open; also no model open at all.
E_INVALID_ARGUMENTA value of the wrong type, out of range or not one of the choices, a setting that does not exist; also a relative path when no working folder was given, or several models open and no project_id.
E_CONFLICTA valid request that the current model does not allow (a second water table, a factor on a design standard that is not custom…); an existing file without overwrite=true; unsaved changes, for project_close and, in the window, for project_new and project_open; a window that closed while answering a call.
E_NOT_CONFIGUREDThe model cannot be analysed as configured; details["problems"] lists every reason. Also every call of a server started with --attach while no window is open.
E_BUSYAnother operation holds the model (after waiting 30 s for it), the window is computing, or the maximum number of jobs is already running.
E_JOB_FAILEDA background job failed or crashed; the message carries its error.
E_INTERNALDefault code of the base class; also what the server and the bridge to the window report for an unexpected exception, with its type and message.
E_UNAUTHORIZEDThe bridge to the window refused a connection with the wrong protocol or token.

Since v0.1.438, an exception that is not an OgrApiError reaches an MCP client as [E_INTERNAL] followed by its type and message, with a window open or without one. Over HTTP, the server itself answers 401 to a missing or wrong bearer token, 421 to a Host that is not its own and 403 to a foreign Origin (Section 5.1.11).

In OGR Slip2D

The reader of these messages is very often a language model, and what lets it recover is being told what was wrong and what to do instead; hence the hint, and the suggestions for every unknown name.

Source: ogr_api/errors.py · ogr_api/workspace.py · ogr_gui/agent_bridge.py

5.5.5Exit codes#

Table 5.5.6 Exit codes of the command-line programs.
ProgramCodeMeaning
ogr-slip2d-cli0Success, also when a method found no valid surface.
1Project file not found.
2Unknown method name, or a usage error.
3The project cannot be analysed as configured.
4No result for any method.
ogr-slip2d-mcp0Normal end.
2A configuration the server refuses to run with.
3The MCP SDK is not installed.

The cases behind each code are listed in Section 5.2 and Section 5.1.3.

5.5.6References#