unable to Import job in rundeck through curl command from local directory or AWS S3

+2 votes

I used this curl command to import a test.xml job to rundeck but it's not working.

curl -v "X-Rundeck-Auth-Token:XXXXX" -F xmlBatch=@"/home/ec2-user/test.xml" --insecure https://hostaname:4443/api/14/project/DistributedArchitecture/jobs/import

This error comes up on the Linux box:

Error:  HTTP/1.1 100 Continue
< HTTP/1.1 400 Bad Request
< Set-Cookie: JSESSIONID=co8wd4jqamut1i8ejwdqu6g7z;Path=/
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Content-Type: text/xml;charset=UTF-8
< X-Rundeck-API-Version: 17
< Transfer-Encoding: chunked
< Server: Jetty(7.6.0.v20120127)
HTTP error before end of send, stop sending
<result error='true' apiversion='17'>
<error code='api.error.jobs.import.invalid'>
<message>Jobs Document was invalid for format xml: rundeck. controllers. JobXMLException: Document root tag was not 'joblist': 'Error'</message>
</error>
Closing connection 0
Mar 28, 2018 in DevOps on Cloud by Atul
• 5,530 points
260 views

2 answers to this question.

0 votes

I had the same issue. I used this command.

 curl -v -H x-rundeck-auth-token:<YOUR TOKEN> http://RUNDECK-SERVER:4440/api/16/project/<Job-Name>/jobs/import -F xmlBatch=@"job.xml" 

this is what my job.xml looks like

<joblist>
<job>
<description>Job Description here!!</description>
<dispatch>
  <excludePrecedence>true</excludePrecedence>
  <keepgoing>false</keepgoing>
  <rankOrder>ascending</rankOrder>
  <successOnEmptyNodeFilter>false</successOnEmptyNodeFilter>
  <threadcount>1</threadcount>
</dispatch>
<executionEnabled>true</executionEnabled>
<loglevel>INFO</loglevel>
<name>MyJobName-xyz</name>
<nodeFilterEditable>false</nodeFilterEditable>
<nodefilters>
  <filter>localhost</filter>
</nodefilters>
<nodesSelectedByDefault>true</nodesSelectedByDefault>
<scheduleEnabled>true</scheduleEnabled>
<sequence keepgoing='false' strategy='node-first'>
  <command>
    <description>listing</description>
    <exec>ls --all</exec>
  </command>
</sequence>
</job>
</joblist>

This should list all in a target.
Hope this helps.

answered Mar 28, 2018 by DareDev
• 6,810 points
0 votes
You can use the S3 log storage plugin. This is a plugin for Rundeck that uses Amazon S3 to store execution log files, for backup or for cloud-friendly behavior.

Have a look at this blog for detailed explaination:

https://rundeck.org/docs/administration/cluster/logstore/s3-log-storage-plugin.html
answered Oct 12, 2018 by lina
• 8,110 points

Related Questions In DevOps on Cloud

0 votes
1 answer
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

permissions related to AWS ECR

if you add allowContainerRegistry: true, kops will add those permissions ...READ MORE

answered Oct 9, 2018 in Kubernetes by Kalgi
• 40,440 points
61 views
+4 votes
2 answers

unable to get subdomain of URL in NGINX

You just need to add .+ after ...READ MORE

answered Oct 11, 2018 in DevOps on Cloud by lina
• 8,110 points
594 views
0 votes
1 answer

Adding public contact from request to aws

Third one seems to be the best ...READ MORE

answered Jun 28, 2018 in DevOps on Cloud by DareDev
• 6,810 points
32 views