Skip to content

Conversation

@D-VR
Copy link

@D-VR D-VR commented Nov 23, 2025

  • Added domain sentinels (provisioning failed, Pulumi canceled, filesystem errors, expired challenge, pool exhausted, renew-not-allowed, lock contention, validation failed) and mapped them to appropriate gRPC codes.
  • Enforce numeric challenge IDs (CTFd compatibility).
  • Improved filesystem/Pulumi error handling to avoid opaque 500s; provisioning cancel now returns Aborted instead of generic internal errors.

Why: To stop the gRPC gateway from emitting generic 500s and give downstream (CTFd plugin/UI) actionable error codes/messages. See: ctfer-io/ctfd-chall-manager#238

Issues: Partially fixes ctfer-io/ctfd-chall-manager#232; addresses ctfer-io/ctfd-chall-manager#225.

I accept the code of conduct.

… also add check if challenge has internal numeric ID when created manually with the API, as CTFd expects numeric IDs
@pandatix
Copy link
Member

Why wanting to enforce numeric IDs ?
Chall-Manager is agnostic of CTFd, thus has never been a requirement (for numerics). The string type enables support for downstream services to provide alternative identifier formats, e.g. GUID.

@D-VR
Copy link
Author

D-VR commented Nov 24, 2025

Why wanting to enforce numeric IDs ? Chall-Manager is agnostic of CTFd, thus has never been a requirement (for numerics). The string type enables support for downstream services to provide alternative identifier formats, e.g. GUID.

when CM had string IDs (created them directly via the CM API during testing), the plugin tried to link to /admin/challenges/ and blew up because CTFd challenge IDs are numeric PKs. But if you want CM to be agnostic to CTFd I can remove that check again.

The CM plugin PR already prevents the admin page from crashing even if string IDs exist in CM.

@pandatix
Copy link
Member

Yeah I would prefer to stick with strings for IDs here 👍

@D-VR D-VR changed the title feat() Map domain errors to gRPC status codes and enforce CTFd-compatible IDs feat() Map domain errors to gRPC status codes Nov 24, 2025
@D-VR
Copy link
Author

D-VR commented Nov 24, 2025

Yeah I would prefer to stick with strings for IDs here 👍

done! 😄

Copy link
Member

@pandatix pandatix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall good, did not run it yet. There are some improvements to be made first then it will be tested more thoroughly 😉

@D-VR
Copy link
Author

D-VR commented Nov 24, 2025

I have added the requested changes, for error traces I will do a new PR if I get to it :)

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.

[Bug]: Web UI does not show challenge as starting

2 participants