Skip to content

Fail job instead of starting container with an empty MAAP_PGT - #22

Merged
sujen1412 merged 1 commit into
developfrom
fix/pgt-empty-token
Oct 16, 2026
Merged

sujen1412 merged 1 commit into
developfrom
fix/pgt-empty-token

Conversation

@sujen1412

@sujen1412 sujen1412 commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #9

Follow-up to #21. That PR made a failed token fetch exit 78 (error in _stderr.txt and _alt_error.txt), and dps_wrapper.sh propagates it with || exit $?, so the user container is not started. Two paths could still leave MAAP_PGT empty with exit 0:

  • _job.json has no username: the script printed nothing. It now reports "no 'username' in _job.json", writes _alt_error.txt and exits 78.
  • The API returns an empty, whitespace-only or non-string session_key: it was returned as the token. It now raises PgtTokenError.

Behaviour change

A job whose _job.json has no username used to run without a token and now fails at this step. I assumed every real DPS job has a username (the wrapper also calls get_username.py); not verified for every job type.

Tests

New cases for empty/whitespace/None/non-string session_key and for the no-username run (exit 78, empty stdout, _alt_error.txt). Full suite: 78 passed on Python 3.12 / urllib3 2.8. The wrapper itself was not run; "container not started" rests on the || exit $? line.

Fail with exit 78 and _alt_error.txt when _job.json has no username or
the API returns an empty/non-string session_key, instead of printing
nothing (or an empty token) and letting the container start.

Refs #9

Claude-Session: https://claude.ai/code/session_0171HvL7yCdP2wCuxh7UngYP
@sujen1412
sujen1412 merged commit f4edf89 into develop Oct 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant