watchdog-wms / watchdog-wms-modules

Sharing repository for Watchdog modules.
Apache License 2.0
2 stars 5 forks source link

wget FileNotFoundException: is a directory (wget stdout missing default value?) #88

Closed stain closed 4 years ago

stain commented 4 years ago

Affected module: wget

Describe the bug

When trying to use wget module from workflowDesigner it will mistakenly try to save stdout to the output directory instead of a file.

To Reproduce

Steps to reproduce the behavior:

  1. Add modules to fresh install of watchdog-2.0.4 using modules/downloadCommunityModules.sh
  2. Start ./workflowDesigner.sh
  3. Add wgetTask to the workflow
  4. In the property manager, fill in the required fields:
    • task name: test
    • required parameter: output: /tmp/1/ (make the directory in the shell)
    • required parameter: uri: http://s11.no/2018/arcp.html
  5. Save changes
  6. Run the workflow

Expected behavior

A file arcp.html to be downloaded into /tmp/1/

Screenshots or logs

[ERROR, 10.02.2020 - 17:15:59] Command failed (exit code: 0): '/home/stain/software/watchdog-2.0.4/modules/wget/wget.sh' with following arguments.
[ERROR, 10.02.2020 - 17:15:59] --nodisableSizeCheck --output '/tmp/1/' --uri 'http://s11.no/2018/arcp.html' --returnFilePath '/home/stain/software/watchdog-2.0.4/tmp/returnParam2672828147840172328.tmp'
[ERROR, 10.02.2020 - 17:15:59] Errors: (1)
[ERROR, 10.02.2020 - 17:15:59] /home/stain/software/watchdog-2.0.4 (Is a directory)
[ERROR, 10.02.2020 - 17:15:59] Failed command: /home/stain/software/watchdog-2.0.4/modules/wget/wget.sh --nodisableSizeCheck --output '/tmp/1/' --uri 'http://s11.no/2018/arcp.html' --returnFilePath '/home/stain/software/watchdog-2.0.4/tmp/returnParam2672828147840172328.tmp'
java.io.FileNotFoundException: /home/stain/software/watchdog-2.0.4 (Is a directory)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
    at java.base/java.io.FileReader.<init>(FileReader.java:75)
    at de.lmu.ifi.bio.watchdog.errorChecker.WatchdogErrorCatcher.checkFile(WatchdogErrorCatcher.java:56)
    at de.lmu.ifi.bio.watchdog.errorChecker.WatchdogErrorCatcher.hasTaskFailed(WatchdogErrorCatcher.java:86)
    at de.lmu.ifi.bio.watchdog.task.TaskStatusUpdate.executeLoop(TaskStatusUpdate.java:81)
    at de.lmu.ifi.bio.multithreading.StopableLoopRunnable.run(StopableLoopRunnable.java:24)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)

Software versions (please complete the following information):

Additional context

It seems I have to fill in /tmp/1/stdout.txt and /tmp/1/stderr.txt in the "streams" boxes under "Advanced settings" rather than leaving then green/empty. However I should not fill in "standard input".

The "working directory" is set to /usr/local/storage/ which I do not have and would not have write access to as non-root.

klugem commented 4 years ago

Thanks for the detailed description. I will try to reproduce and fix the bug.

klugem commented 4 years ago

Unfortunately, I'm was not able to reproduce the bug so far.

However, I think that the workflowDesigner is causing the problem by writing an semantically invalid XML WF file as the WatchdogErrorCatcher class tries to open Watchdog's install directory instead of a log file.

If you still have the WF file, could you please paste it here. Thanks in advance.