Skip to content

Job executes successfully, but still marked as "failed". Why?

0

I'm using aws-iot-sdk-js "jobs-agent.js" to "install packages" ( but really just put files and execute commands). The following works just fine:
(Note, I have a cron job writing "[]" to "installedPackages.json" every minute to prevent all the package management stuff from happening, hence "doesntmatter". Yes, I know it's hacky.)

{
"operation": "install",
"packageName": "doesntmatter",
"workingDirectory": "/home/pi/tamgbin",
"launchCommand": "chmod 755 /home/pi/tamgbin/sessionValidator && chmod 755 /home/pi/tamgbin/tagGenerator && rm /home/pi/tamgbin/*.old",
"autoStart": "false",
"files": [
{
"fileName": "sessionValidator",
"fileVersion": "0.0.0.1",
"fileSource": {
"url": "https://mybucketname.s3.amazonaws.com/sessionValidator"
}
},
{
"fileName": "tagGenerator",
"fileVersion": "0.0.0.1",
"fileSource": {
"url": "https://mybucketname.s3.amazonaws.com/tagGenerator"
}
},
{
"fileName": "tamgSessionValidator.jar",
"fileVersion": "0.0.0.1",
"fileSource": {
"url": "https://mybucketname.s3.amazonaws.com/tamgSessionValidator.jar"
}
},
{
"fileName": "tamgTagGenerator.jar",
"fileVersion": "0.0.0.1",
"fileSource": {
"url": "https://mybucketname.s3.amazonaws.com/tamgTagGenerator.jar"
}
}
]
}

My files get placed and the launchCommand executes perfectly. The only problem is, in the IOT console, the job is listed as "failed" and "completed".

Why? The console doesn't give any useful information about the WHY of the failure.

asked 5 years ago333 views
1 Answer
0

I figured this out. Basically the jobs-agent.js was interpreting "IN_PROGRESS" as an invalid state, so modified it to not. This will probably relatively moot soon due to v2 of the js sdk in progress.

answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.