Malformed resource request crashing server

We had a user attempt to use an old (Moab-based I think?) syntax for specifying resources:

#PBS -l procs=16,tpn=2

The PBS server crashed upon job submission with the following in the server log:

06/14/2022 09:14:58;0001;Server@XXX;Svr;Server@XXX;Unknown resource (15035) in set_attr_generic, decode of Resource_List failed
06/14/2022 09:14:59;0001;Server@XXX;Svr;Server@XXX;PBS server internal error (15011) in job_save_db, Failed to save job 690477.XXX Execution of Prepared statement insert_job failed: ERROR: incorrect binary data format in bind parameter 17 22P03
06/14/2022 09:14:59;0001;Server@XXX;Svr;Server@XXX;panic_stop_db, Panic shutdown of Server on database error. Please check PBS_HOME file system for no space condition.

And this in the database log:

2022-06-14 09:14:59.035 MDT [1503713] ERROR: incorrect binary data format in bind parameter 17
2022-06-14 09:14:59.035 MDT [1503713] STATEMENT: insert into pbs.job (ji_jobid,ji_state,ji_substate,ji_svrflags,ji_stime,ji_queue,ji_destin,ji_un_type,ji_exitstat,ji_quetime,ji_rteretry,ji_fromsock,ji_fromaddr,ji_jid,ji_credtype,ji_qrank,ji_savetm,ji_creattm,attributes) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, localtimestamp, localtimestamp, hstore($17::text))

Has anyone else experienced this? Is there a way (through a hook, perhaps), to catch this type of malformed resource request so it doesn’t affect server stability?

Thanks!

You can implement a queuejob event hook and sanitize the qsub request or reject if the request does not match the requirements.