You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@airavata.apache.org by "Softicles (via GitHub)" <gi...@apache.org> on 2026/06/10 03:11:10 UTC

[PR] Setup error tracking [airavata-portals]

Softicles opened a new pull request, #210:
URL: https://github.com/apache/airavata-portals/pull/210

   # Surface experiment setup errors + configurable Thrift CA bundle
   
   ## Summary
   Frontend errors that occur while setting up or editing an experiment (e.g. failed
   API calls during experiment configuration) were only written to the server log and
   lost from the user's view. This PR persists those error reports and surfaces them
   back to the user — per experiment and in the global notifications dropdown — so
   setup problems are visible instead of silently failing. It also makes the TLS CA
   bundle for secure Thrift connections configurable.
   
   ## What's included
   
   ### Per-experiment setup error tracking
   - New `ExperimentErrorRecord` model + migration storing ERROR-level frontend log
     records, optionally associated with an experiment.
   - `LogRecordConsumer` now persists ERROR-level reports, deduplicating repeated
     occurrences of the same error into a single row with an occurrence `count` and
     last-seen time.
   - New `ExperimentSetupErrorListView` endpoint (`/api/experiments/<id>/setup-errors/`)
     gated by the requester's ability to load the experiment from Airavata.
   - Frontend error plumbing (`ErrorContext`, `ErrorReporter`, `UnhandledErrorDispatcher`)
     tags reported errors with the current experiment id so they can be associated
     correctly.
   
   ### Surface errors in the UI
   - `ExperimentSummary.vue` displays setup errors recorded for the experiment.
   - The global notifications dropdown (`GatewayNoticesContainer.vue`) surfaces setup
     errors alongside gateway notices.
   
   ### Configurable CA bundle for secure Thrift connections
   - Adds `CA_CERTS_PATH` (defaults to the `certifi` bundle) used to verify TLS certs
     when opening secure `TSSLSocket` connections to the Airavata API and Profile
     services. Override in `settings_local.py` for self-signed / custom-CA servers.
   
   ### Bug fixes (found while running the portal locally)
   - `LogRecordConsumer`: replaced `get_or_create` with a filter-and-fold dedup. There
     is no DB-level unique constraint (message is an unbounded `TextField` and
     `experiment_id` is nullable), so concurrent reports could race in duplicate rows
     and then crash subsequent calls with `MultipleObjectsReturned`. Duplicates are now
     folded into the oldest surviving row so the table self-heals.
   - `view-experiment` store: `loadGroupResourceProfile` now guards against a missing
     `groupResourceProfileId`. Previously the id serialized to `"null"` in the URL and
     Airavata rejected it with an `AuthorizationException`, surfacing as a spurious
     setup error for experiments without a group resource profile.
   
   ## Migrations
   Two new migrations under `django_airavata/apps/api/migrations/`:
   - `0010_experimenterrorrecord`
   - `0011_experimenterrorrecord_count_dedup`
   
   Run `python manage.py migrate` after pulling.
   
   ## Testing
   - Verified end-to-end against a live gateway: logged in, created and launched an
     experiment, and confirmed setup errors are recorded, deduplicated, and shown in
     the experiment view and notifications dropdown.
   - Confirmed the previous `MultipleObjectsReturned` crash no longer occurs when the
     same error is reported repeatedly, and that the `group-resource-profiles/null/`
     403 no longer fires for experiments without a group resource profile.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@airavata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org