Unauthenticated API request

529 views
Skip to first unread message

Ashish Mishra

unread,
Jul 15, 2021, 9:58:43 AM7/15/21
to rundeck-discuss
Hi,
      We are getting this rundeck error continuously and have no idea from where it is coming. During this time we only updated admin password, and tried to setup SCM export.

 rundeck-prod-docker rundeck [ERROR] interceptors.AuthorizationInterceptor - (unauthenticated) UNAUTHORIZED for menu/apiExecutionsRunningv14
rundeck-prod-docker rundeck [ERROR] interceptors.SetUserInterceptor - Unauthenticated API request

Regards,
Ashish

rac...@rundeck.com

unread,
Jul 15, 2021, 10:58:06 AM7/15/21
to rundeck-discuss
Hi!

I reproduced your issue and it's an expected behavior, happens when you keep the Rundeck executions page open on the browser and the the session timeout is reached (or the Rundeck service is restarted):

1. Create a scheduled job (every 15 secs for example).
2. Go to the activity page and click on the "Auto Refresh" button.
3. Wait for some executions.
4. Restart the service.
5. When the service is restarted and the website is still open, Rundeck "receives" unauthorized access to the executions page.

Regards.

Ashish Mishra

unread,
Jul 15, 2021, 1:26:13 PM7/15/21
to rundeck-discuss
Ok. I dont know what should be the solution for this, but docker container down and up fixed problem.

souad mokrani

unread,
Jul 15, 2021, 1:43:40 PM7/15/21
to rundeck...@googlegroups.com
hello.
i am new to Rundeck.
i am creating a job from a python script. that uses librarý that i wrote myself and put in lib folder.
i can't get all this set up on Rundeck

can you help me please

regards

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/5d9056f1-86ab-4d27-a455-66ccb6d32064n%40googlegroups.com.

rac...@rundeck.com

unread,
Jul 15, 2021, 2:16:32 PM7/15/21
to rundeck-discuss
Just close the Rundeck browser tabs and re-login to Rundeck (in my example because the service is relaunched).

Regards.

rac...@rundeck.com

unread,
Jul 15, 2021, 5:01:31 PM7/15/21
to rundeck-discuss

Hi!

You can use the rundeck API from python. I made a (very) basic example, take a look:

import requests

# host definition
rdeck_instance = "localhost"
rdeck_port = "4440"
rdeck_api = "40"

# connect to instance
s = requests.Session()
r = s.post("http://" + rdeck_instance + ":" + rdeck_port +"/j_security_check", data={"j_username": "admin", "j_password": "admin" })
r.status_code
r.url 

# print data (for debug)
print ('######################')
print r.status_code
print r.url
print ('######################')

# job id

jobid = "b47556a2-9721-439b-a70b-c2f2b364571e"

# run a job (you can use any api call here)
r = s.post("http://" + rdeck_instance +  ":" + rdeck_port +"/api/" + rdeck_api + "/job/" + jobid + "/run",headers = {'Accept': 'application/json'})

# json response
print(r.json())

Greetings!

Reply all
Reply to author
Forward
0 new messages