{"action":"created","issue":{"url":"https://api.github.com/repos/TheRoddyWMS/Roddy/issues/281","repository_url":"https://api.github.com/repos/TheRoddyWMS/Roddy","labels_url":"https://api.github.com/repos/TheRoddyWMS/Roddy/issues/281/labels{/name}","comments_url":"https://api.github.com/repos/TheRoddyWMS/Roddy/issues/281/comments","events_url":"https://api.github.com/repos/TheRoddyWMS/Roddy/issues/281/events","html_url":"https://github.com/TheRoddyWMS/Roddy/issues/281","id":341816067,"node_id":"MDU6SXNzdWUzNDE4MTYwNjc=","number":281,"title":"Failed direct executed commands will throw a stacktrace and a non helpful error message","user":{"login":"dankwart-de","id":6582183,"node_id":"MDQ6VXNlcjY1ODIxODM=","avatar_url":"https://avatars0.githubusercontent.com/u/6582183?v=4","gravatar_id":"","url":"https://api.github.com/users/dankwart-de","html_url":"https://github.com/dankwart-de","followers_url":"https://api.github.com/users/dankwart-de/followers","following_url":"https://api.github.com/users/dankwart-de/following{/other_user}","gists_url":"https://api.github.com/users/dankwart-de/gists{/gist_id}","starred_url":"https://api.github.com/users/dankwart-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dankwart-de/subscriptions","organizations_url":"https://api.github.com/users/dankwart-de/orgs","repos_url":"https://api.github.com/users/dankwart-de/repos","events_url":"https://api.github.com/users/dankwart-de/events{/privacy}","received_events_url":"https://api.github.com/users/dankwart-de/received_events","type":"User","site_admin":false},"labels":[{"id":411780502,"node_id":"MDU6TGFiZWw0MTE3ODA1MDI=","url":"https://api.github.com/repos/TheRoddyWMS/Roddy/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-17T08:27:17Z","updated_at":"2018-07-17T08:54:44Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"This is the case for SSHExecutionService, see this code part:\r\n\r\n``` Groovy\r\n            if (exitStatus > 0) {\r\n                if (ignoreError) {\r\n                    // In case the command is ignored, a warning is sent out instead of a severe error.\r\n                    logger.warning(\"Command not executed correctly, return code: \" + exitStatus + \", error was ignored on purpose.\")\r\n                    logger.rare(\"Ignored failed command was: '${command}'\")\r\n                    content.readLines().each { String line -> output << \"\" + line }\r\n                    readStream(cmd.errorStream).readLines().each { String line -> output << \"\" + line }\r\n                } else {\r\n                    logger.severe(\"Command not executed correctly, return code: \" + exitStatus +\r\n                            (cmd.getExitSignal()\r\n                                    ? \" Caught signal is \" + cmd.getExitSignal().name()\r\n                                    : \"\\n\\tCommand Str. \" + RoddyIOHelperMethods.truncateCommand(command,\r\n                                    Roddy.applicationConfiguration.getOrSetApplicationProperty(\"commandLogTruncate\", '80').toInteger())))\r\n                }\r\n            } else {\r\n```\r\n\r\nand here:\r\n\r\n``` Groovy\r\n// ExecutionService.runDirect()\r\n\r\n\r\n        def lines = FileSystemAccessProvider.instance.loadTextFile(jobLog)\r\n\r\n        if (lines != null) {\r\n\r\n            if (!result.successful)\r\n                throw new ExecutionException(\"Execution failed. Output was: '\" + result.resultLines.orElse([]).join(\"\\n\") + \"'\", null)\r\n\r\n            // Depending on which debug options are set, it is possible (set -v), that \"Wrapped script ended\"\r\n            // is found before \"Starting wrapped script\". It is however safe to compare the whole \"Starting wrapped script\"\r\n            // string to find the beginning of the output block of the executed wrapped script. Therefore we\r\n            // use this to cut away misleading trailing output and then find the end block afterwards.\r\n   ```   \r\n\r\nWhyever, in the Bam2FastqCase, when error 200 pops up, there is neither a message in the error nor in the output stream.\r\n\r\nFinally, the exception is thrown and printed ugly:\r\n\r\n``` Bash\r\n200 <= PARAMETER_FILE=/icgc/dkfzlsdf/analysis/B080/heinold/temp/gms/roddyExecutionStore/exec_180717_101144203_heinold_bam2fastqAnalysis/180717_101144203_directTool:bamListReadGroups_1.parameters CONFIG_FILE=/icgc/dkfzlsdf/analysis/B080/heinold/temp/gms/roddyExecutionStore/exec_180717_101144203_heinold_bam2fastqAnalysis/180717_101144203_directTool:bamListReadGroups_1.parameters debugWrapInScript=false baseEnvironmentScript=/etc/profile /icgc/dkfzlsdf/analysis/B080/heinold/temp/gms/roddyExecutionStore/exec_180717_101144203_heinold_bam2fastqAnalysis/analysisTools/roddyTools/wrapInScript.sh &> /icgc/dkfzlsdf/analysis/B080/heinold/temp/gms/roddyExecutionStore/exec_180717_101144203_heinold_bam2fastqAnalysis/180717_101144203_directTool:bamListReadGroups.o1 &> /dev/null\r\n0 <= stat --printf='%s' '/icgc/dkfzlsdf/analysis/B080/heinold/temp/gms/roddyExecutionStore/exec_180717_101144203_heinold_bam2fastqAnalysis/180717_101144203_directTool:bamListReadGroups.o1'\r\nAn unknown / unhandled exception occurred: 'Execution failed. Output was: '''\r\nde.dkfz.roddy.execution.io.ExecutionService.runDirect(ExecutionService.groovy:208)\r\nde.dkfz.roddy.bam2fastq.BamToFastqWorkflow.listReadGroups(BamToFastqWorkflow.groovy:81)\r\nde.dkfz.roddy.bam2fastq.BamToFastqWorkflow$_readAllReadGroups_closure3.doCall(BamToFastqWorkflow.groovy:149)\r\nde.dkfz.roddy.bam2fastq.BamToFastqWorkflow$_readAllReadGroups_closure3.call(BamToFastqWorkflow.groovy)\r\norg.codehaus.groovy.runtime.DefaultGroovyMethods.collectEntries(DefaultGroovyMethods.java:3632)\r\norg.codehaus.groovy.runtime.DefaultGroovyMethods.collectEntries(DefaultGroovyMethods.java:3539)\r\norg.codehaus.groovy.runtime.DefaultGroovyMethods.collectEntries(DefaultGroovyMethods.java:3564)\r\nde.dkfz.roddy.bam2fastq.BamToFastqWorkflow.readAllReadGroups(BamToFastqWorkflow.groovy:148)\r\nde.dkfz.roddy.bam2fastq.BamToFastqWorkflow.setupExecution(BamToFastqWorkflow.groovy:161)\r\norg.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)\r\nde.dkfz.roddy.core.Workflow.setupExecution(Workflow.groovy:57)\r\n```"},"comment":{"url":"https://api.github.com/repos/TheRoddyWMS/Roddy/issues/comments/405509970","html_url":"https://github.com/TheRoddyWMS/Roddy/issues/281#issuecomment-405509970","issue_url":"https://api.github.com/repos/TheRoddyWMS/Roddy/issues/281","id":405509970,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTUwOTk3MA==","user":{"login":"dankwart-de","id":6582183,"node_id":"MDQ6VXNlcjY1ODIxODM=","avatar_url":"https://avatars0.githubusercontent.com/u/6582183?v=4","gravatar_id":"","url":"https://api.github.com/users/dankwart-de","html_url":"https://github.com/dankwart-de","followers_url":"https://api.github.com/users/dankwart-de/followers","following_url":"https://api.github.com/users/dankwart-de/following{/other_user}","gists_url":"https://api.github.com/users/dankwart-de/gists{/gist_id}","starred_url":"https://api.github.com/users/dankwart-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dankwart-de/subscriptions","organizations_url":"https://api.github.com/users/dankwart-de/orgs","repos_url":"https://api.github.com/users/dankwart-de/repos","events_url":"https://api.github.com/users/dankwart-de/events{/privacy}","received_events_url":"https://api.github.com/users/dankwart-de/received_events","type":"User","site_admin":false},"created_at":"2018-07-17T08:54:44Z","updated_at":"2018-07-17T08:54:44Z","author_association":"CONTRIBUTOR","body":"Actually here are two problems: First, the \"bad\"  exception AND the missing error message from the wrapper."}}
{"actor":{"display_login":"dankwart-de"}}