common-workflow-language / cwlviewer

A web application to view and share Common Workflow Language workflows
https://view.commonwl.org/
Apache License 2.0
44 stars 28 forks source link

Need better error message when a CommandLineTool is submitted #582

Closed mexanick closed 1 month ago

mexanick commented 11 months ago

Description

CWL Viewer cannot find a workflow in gitlab (self-hosted) repository.

Expected Behavior

CWL Viewer shall find and parse the workflow correctly

Actual Behavior

Error: The workflow could not be found within the repository

Possible Fix

Must be related to #424

Steps to Reproduce

  1. Go to the https://view.commonwl.org/ and paste the address of the repository https://gitlab.cta-observatory.org/cta-computing/dpps/dpps-workflows.git as URL to workflow.
  2. Paste this commit hash: 76f7c25c0472da23b7e0bfe9f2c18ab6bc369c9d to the "Branch Name/Commit ID" field
  3. Now, the workflow that has been previously registered (long time ago) works: /workflows/calibpipe/uc-cp-001.cwl
  4. However, the other workflow (that has not been registered before) doesn't: /workflows/datapipe/uc-dp-XXX.cwl

Context

I can't render my workflows

Your Environment

mr-c commented 11 months ago

Error reported in the webapp

Error: The workflow could not be found within the repository

From the logs

2023-11-15 14:59:15,556 INFO  [http-nio-8080-exec-6] org.commonwl.view.workflow.WorkflowService: Time has expired for caching, checking commits for workflow 7af8dede-2258-4b57-aaa7-f83f63f88342
2023-11-15 14:59:15,895 INFO  [http-nio-8080-exec-6] org.commonwl.view.workflow.WorkflowService: Current: 9495f778ed203c82c554144f9ae2dc7e3b66378b, HEAD: 9495f778ed203c82c554144f9ae2dc7e3b66378b for workflow 7af8dede-2258-4b57-aaa7-f83f63f88342
2023-11-15 14:59:28,484 ERROR [task-1776] org.commonwl.view.cwl.CWLToolRunner: Jena query exception for workflow c37d89d2-44cd-4971-a21d-5844d8540dff
org.apache.jena.sparql.engine.http.QueryExceptionHTTP: HTTP 503 error making the query: Service Unavailable

I restarted the service and now I get

cwl-docker-spring-1    | 2023-11-15 15:07:20,061 WARN  [http-nio-8080-exec-10] org.commonwl.view.workflow.WorkflowController: git.notFound WorkflowForm [url=https://gitlab.cta-observatory.org/cta-computing/dpps/dpps-workflows.git, branch=main, path=/workflows/datapipe/uc-dp-XXX.cwl]
cwl-docker-spring-1    | org.commonwl.view.workflow.WorkflowNotFoundException: null
cwl-docker-spring-1    |    at org.commonwl.view.cwl.CWLService.parseWorkflowNative(CWLService.java:212)
cwl-docker-spring-1    |    at org.commonwl.view.cwl.CWLService.parseWorkflowNative(CWLService.java:256)

Looking at the code

https://github.com/common-workflow-language/cwlviewer/blob/2b3449f28a034c798cd54c376fe25c8dd65f3336/src/main/java/org/commonwl/view/workflow/WorkflowService.java#L361-L363

But https://gitlab.cta-observatory.org/cta-computing/dpps/dpps-workflows/-/blob/main/workflows/datapipe/uc-dp-XXX.cwl?ref_type=heads is not a packed workflow. In fact, it isn't a workflow, it is a CommandLineTool.

@mexanick Thank you for your report. This service is for visualizing CWL Workflows, not CommandLineTools. We should have given a better error message in this instance.

mexanick commented 11 months ago

Ah, I see! This explains things! Right, can you please improve the error message? :)

kinow commented 11 months ago

We should have given a better error message in this instance.

+1