question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failure while trying to run a jar file with on demand setting

See original GitHub issue

I am trying to create a task which be run On Demand.

Below is the json for the request

{
    "request": {
        "id": "ondemand1",
        "requestType": "ON_DEMAND",
        "owners": [
            "saurabh"
        ],
        "killOldNonLongRunningTasksAfterMillis": 100000
    },
    "state": "ACTIVE",
    "requestDeployState": {
        "requestId": "ondemand1",
        "activeDeploy": {
            "requestId": "ondemand1",
            "deployId": "d1",
            "timestamp": 1463652534039
        }
    },
    "type": "ON_DEMAND",
    "instances": 1,
    "hasMoreThanOneInstance": false,
    "inCooldown": false,
    "daemon": false,
    "canBeScaled": false
}

I deployed it using and the following is the JSON of it I got from UI

{
    "deployId": "d1",
    "requestId": "ondemand1",
    "deployResult": {
        "deployState": "SUCCEEDED",
        "message": "Request not deployable",
        "deployFailures": [],
        "timestamp": 1463652537563
    },
    "deployMarker": {
        "requestId": "ondemand1",
        "deployId": "d1",
        "timestamp": 1463652534039
    },
    "deploy": {
        "requestId": "ondemand1",
        "id": "d1",
        "command": "java -jar singularitytest-1.0-SNAPSHOT.jar",
        "resources": {
            "cpus": 1,
            "memoryMb": 512,
            "numPorts": 1
        },
        "uris": [
            "http://10.124.114.7/singularitytest-1.0-SNAPSHOT.jar"
        ]
    },
    "deployStatistics": {
        "requestId": "ondemand1",
        "deployId": "d1",
        "numSuccess": 0,
        "numFailures": 0,
        "numSequentialRetries": 0,
        "lastFinishAt": 1463652546070,
        "lastTaskState": "TASK_FAILED",
        "instanceSequentialFailureTimestamps": {
            "1": [
                1463652546070
            ]
        },
        "numTasks": 1,
        "averageRuntimeMillis": 442
    }
}

STDERR shows the following error message

Failed to exec: No such file or directory

Just keep things simple I am printing to stdout some text in singularitytest-1.0-SNAPSHOT.jar

I tried to deploy it using run once and as a service as well, they seems work already then.

I could not find anything specific in the documentation regarding on demand jobs. I am obviously missing something which I am not able to figure out. Any help is appreciated.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
demoboxcommented, May 19, 2016

@the100rabh PS: Until the fix is merged, using the API to trigger an on-demand run (i.e. avoiding the UI) works for me as a workaround

curl -X POST <singularity-endpoint>/api/requests/request/<request-id>/run -d '{"message":"test via the API"}'

See:

1reaction
ssalinascommented, May 19, 2016

@the100rabh seems there is a small bug in this case. On the mesos task itself, we set the shell property to false when the arguments field is present. Meaning, args are meant to be parsed as an array and it looks for the first element to be the executable. For ON_DEMAND in the UI, the arguments field defaults to being set (although empty if none are specified). I will work on a fix and we can put out a bug-fix release for this. Thanks for reporting it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to run a Jar file | TechTarget - TheServerSide.com
Run the JAR file on the command line or terminal window if a double-clicking fails. If you do not have Java installed, and...
Read more >
Class not registered error while trying to run .jar files
I was trying to run a normal .jar file that I just downloaded and I got the "Class not registered". I've tried a...
Read more >
AEM 6.4 Quickstart Jar file Not Working
Try running the below command from the command prompt with verbose option set. java -Xmx1536M -jar AEM_6.4_Quickstart.jar -v. Hope this helps.
Read more >
Failing to execute the jar file using java -jar command
If you want to run the Test class, you should use java -cp sample.jar com.app.Test. This way, you add the jar to the...
Read more >
How do I resolve java.lang.UnsatisfiedLinkError, java ... - IBM
Perform the following corrective steps for the error you are encountering. Note that the jar files listed in some of the explanations below ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found