Skip to content

Endpoint /officers/all on the production database returns 500 #159

Open

Description

@jbriones1

Description

https://sfucsss.org/api/officers/all returns 500.

Our REST API does a validation check that the values here are invalid, but old entries don't conform to those. It's probably best to remove the validation check and change the model to be a union of the enum types or a string.

Error

Input should be 'president', 'vice-president', 'treasurer', 'director of resources', 'director of events', 'director of educational events', 'assistant director of events', 'director of communications', 'director of multimedia', 'director of archives', 'executive at large', 'first year representative', 'election officer', 'sfss council representative', 'frosh week chair', 'system administrator', 'webmaster' or 'social media manager' [type=enum, input_value='elections officer', input_type=str]

Activity

  1. self-assigned this
    on Aug 6, 2026
  2. added theissue type on Aug 6, 2026
  3. moved this from Ready to In Progress in W3 Projectson Aug 6, 2026
  4. nikitasachan2004 commented on Aug 6, 2026

    @nikitasachan2004

    Hi @jbriones1, thanks for looking into this! I see you've self-assigned it just wanted to flag that if you end up not having bandwidth to pick this back up, I'd love to take a crack at it. Looks like a mismatch between the election officer enum value and elections officer being passed in somewhere (possibly a data issue on the prod DB). Happy to help either way let me know if a second pair of hands would be useful too!

  5. jbriones1 commented on Aug 6, 2026

    @jbriones1
    ContributorAuthor

    Hi @nikitasachan2004, just checking are you a student at Simon Fraser University?

  6. nikitasachan2004 commented on Aug 6, 2026

    @nikitasachan2004

    Hi @jbriones1, no I'm not I'm a CS (AI & ML) undergrad at Manipal University Jaipur in India, just looking to contribute to open source projects and learn from real-world codebases. Happy to still help out if external contributions are welcome here!

  7. jbriones1 commented on Aug 6, 2026

    @jbriones1
    ContributorAuthor

    Thank you for the interest, but our organization only accepts contributions from our University students. I'm sorry.

  8. removed their assignment
    on Aug 8, 2026
  9. moved this from In Progress to Ready in W3 Projectson Aug 8, 2026
  10. moved this from Ready to In Progress in W3 Projectson Aug 24, 2026
  11. m13v commented on Aug 28, 2026

    @m13v

    relaxing the model to a string union does kill the 500, but it also makes the bad row invisible. right now the enum error is loud and names the exact value ('elections officer' where the schema wants 'election officer'). loosen it to a string and /officers/all returns 200 with that typo'd role passing straight through, so anything downstream filtering on the enum quietly drops that officer instead of erroring. worth fixing the legacy value in the same pass, otherwise you've traded a crash for a silent miss nobody notices.

  12. self-assigned this
    on Sep 21, 2026
  13. moved this from In Progress to Ready in W3 Projectson Sep 22, 2026
  14. moved this from Ready to In dev in W3 Projectson Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't workingdb schemaDatabase schema rewrite relatedgood first issueGood for newcomers

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions