[slurm-users] Slurm Rest API error

889 views
Skip to first unread message

Ozeryan, Vladimir

unread,
Jun 28, 2023, 2:05:42 PM6/28/23
to Slurm User Community List

Hello everyone,

 

I am trying to get access to Slurm REST API working.

 

JWT configured and token generated. All daemons are configured and running “slurmdbd, slurmctld and slurmrestd”. I can successfully get to Slurm API with “slurm” user but that’s it.

bash-4.2$ echo -e "GET /slurm/v0.0.39/jobs HTTP/1.1\r\nAccept: */*\r\n" | slurmrestd – That works.

 

But as my user I get the following error:

 

[user@sched01 slurm-23.02.3]$ curl localhost:6820/slurm/v0.0.39/diag --header "X-SLURM-USER-NAME: $USER" --header "X-SLURM-USER-TOKEN: $SLURM_JWT”

HTTP/1.1 500 INTERNAL ERROR

Connection: Close

Content-Length: 833

Content-Type: application/json

 

{

   "meta": {

     "plugin": {

       "type": "openapi\/v0.0.39",

       "name": "Slurm OpenAPI v0.0.39",

       "data_parser": "v0.0.39"

     },

     "client": {

       "source": "[localhost]:55960"

     },

     "Slurm": {

       "version": {

         "major": 23,

         "micro": 3,

         "minor": 2

       },

       "release": "23.02.3"

     }

   },

   "errors": [

     {

       "description": "openapi_get_db_conn() failed to open slurmdb connection",

       "error_number": 7000,

       "error": "Unable to connect to database",

       "source": "init_connection"

     },

     {

       "description": "slurm_get_statistics() failed to get slurmctld statistics",

       "error_number": -1,

       "error": "Unspecified error",

       "source": "_op_handler_diag"

     }

   ],

   "warnings": [

   ],

   "statistics": null

 

Thank you,

 

Vlad Ozeryan

AMDS – AB1 Linux-Support

Vladimir...@jhuapl.edu

Ext. 23966

 

Brian Andrus

unread,
Jun 28, 2023, 3:01:05 PM6/28/23
to slurm...@lists.schedmd.com

Vlad,

Actually, it looks like it is working. You are using v0.39 for the parser, which is trying to use OpenAPI calls. Unless you compiled with OpenAPI, that won't work.

Try using the 0.37 version and you may see a simpler result that is successful.

Brian Andrus

mohammed shambakey

unread,
Jul 1, 2023, 4:57:31 PM7/1/23
to Slurm User Community List
Hi

I'm also trying to use slurm rest api. I wonder if the error about slurmdbd has anything to do with it. Does slurmctld connect correctly to slurmdbd?

Regards
Reply all
Reply to author
Forward
0 new messages