Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

curl command not working from jump server after admin password change

surendarm613658
Level 3
Level 3

 Hi,

 

I have changed the admin password across "publishers/authors" and after changing the password if i run the below curl command on Jump server to check the bundles count, i am getting below error but if i login to the corresponding publisher, i am getting successful output. Something got changed after admin password change. Can someone please check & assist?

 

Note: From Jumpserver, curl was giving proper output before admin password change.

 

Error on jump server

[root@jumpserver]# /usr/local/bin/dsh -m publish09 "curl -u 'admin':'admin$@20tY' http://localhost:41000/system/console/bundles/.json | cut -d':' -f2,3"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
118 355 118 355 0 0 5325 0 --:--:-- --:--:-- --:--:-- 5546
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 </title>
</head>
<body>
500</h2>
<pre> org.apache.sling.api.auth.NoAuthenticationHandlerException</pre></p>
//</small></i>
</body>
</html>

 

Curl check inside publisher: Working Output

[root@publish09]# curl -u 'admin':'admin$@20tY' http://localhost:41000/system/console/bundles/.json | cut -d':' -f2,3
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 93860 0 93860 0 0 1784k 0 --:--:-- --:--:-- --:--:-- 1870k
"Bundle information: 497 bundles in total - all 497 bundles active.","s"

1 Accepted Solution
Vaibhavi
Correct answer by
Community Advisor
Community Advisor

Hi @surendarm613658 

 

Looks like issue is due to the special characters in curl command. 

Curl doesn't encode the special character by default. In your scenario I can see the specialist chars @$ in password. 

You can use --data-urlencode  in curl to escape special  character. 

 

You can check the below article. 

https://stackoverflow.com/questions/10060093/special-characters-like-and-in-curl-post-data

 

View solution in original post

4 Replies
Vaibhavi
Correct answer by
Community Advisor
Community Advisor

Hi @surendarm613658 

 

Looks like issue is due to the special characters in curl command. 

Curl doesn't encode the special character by default. In your scenario I can see the specialist chars @$ in password. 

You can use --data-urlencode  in curl to escape special  character. 

 

You can check the below article. 

https://stackoverflow.com/questions/10060093/special-characters-like-and-in-curl-post-data

 

View solution in original post

surendarm613658
Level 3
Level 3
Hi Vaibhavi - but how come the curl works when i run it on the publishers and only on jumpserver it is not working...? Also in my earlier password were also i had special characters and it worked from jump servers..
Vaibhavi
Community Advisor
Community Advisor

Encoding of the servers can make difference. Please check the encoding set for jump server. 

Did you try the command by passing --data-urlencode param?? 

 

Other option to cross verify is by setting simple password and test the curl. 

surendarm613658
Level 3
Level 3
Thanks - Issue is with the special characters. Curl didnt worked but still when i changed the password to a simplest one, it worked