Duke-GCB / bespin-cli

Command line client for Bespin
MIT License
0 stars 0 forks source link

Cannot list workflow, workflow-config, or job #29

Closed dleehr closed 5 years ago

dleehr commented 5 years ago

Not sure if we deployed some API changes ahead of releasing a version of bespin-cli to address those, but the current released version (0.0.12) cannot list jobs, workflows, or workflow-configs with the production server:

(venv-bespin-cli) Homer15:python dcl9$ cat ~/.bespin.yml 
token: REMOVED
url: https://bespin.genome.duke.edu/api/
(venv-bespin-cli) Homer15:python dcl9$ pip freeze | grep bespin
bespin-cli==0.0.12
(venv-bespin-cli) Homer15:python dcl9$ 

job:

(venv-bespin-cli) Homer15:python dcl9$ bespin job list
Traceback (most recent call last):
  File "/Users/dcl9/Code/python/venv-bespin-cli/bin/bespin", line 11, in <module>
    sys.exit(main())
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/__main__.py", line 17, in main
    arg_parser.parse_and_run_commands()
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/argparser.py", line 45, in parse_and_run_commands
    parsed_args.func(parsed_args)
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/argparser.py", line 270, in _list
    self.target.jobs_list()
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/commands.py", line 103, in jobs_list
    self._print_details_as_table(jobs_list)
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/commands.py", line 31, in _print_details_as_table
    print(Table(details.column_names, details.get_column_data()))
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/commands.py", line 331, in get_column_data
    job[self.WORKFLOW_VERSION_TAG] = self.get_workflow_version_tag(job['workflow_version'])
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/commands.py", line 337, in get_workflow_version_tag
    return workflow_version['tag']
KeyError: 'tag'

workflow-config:

(venv-bespin-cli) Homer15:python dcl9$ bespin workflow-config list
Traceback (most recent call last):
  File "/Users/dcl9/Code/python/venv-bespin-cli/bin/bespin", line 11, in <module>
    sys.exit(main())
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/__main__.py", line 17, in main
    arg_parser.parse_and_run_commands()
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/argparser.py", line 45, in parse_and_run_commands
    parsed_args.func(parsed_args)
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/argparser.py", line 154, in _list
    self.target.workflow_configs_list(workflow_tag=args.workflow)
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/commands.py", line 63, in workflow_configs_list
    self._print_details_as_table(WorkflowConfigurationsList(api, workflow_tag))
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/commands.py", line 31, in _print_details_as_table
    print(Table(details.column_names, details.get_column_data()))
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/commands.py", line 300, in get_column_data
    for item in self.api.workflow_configurations_list(workflow_tag=self.workflow_tag):
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/api.py", line 131, in workflow_configurations_list
    return self._get_request(url)
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/api.py", line 32, in _get_request
    self._check_response(response)
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/api.py", line 59, in _check_response
    raise NotFoundException(BespinApi.make_message_for_http_error(response))
bespin.api.NotFoundException: <h1>Not Found</h1><p>The requested URL /api/workflow-configurations/ was not found on this server.</p>

workflow:

(venv-bespin-cli) Homer15:python dcl9$ bespin workflow list
Traceback (most recent call last):
  File "/Users/dcl9/Code/python/venv-bespin-cli/bin/bespin", line 11, in <module>
    sys.exit(main())
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/__main__.py", line 17, in main
    arg_parser.parse_and_run_commands()
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/argparser.py", line 45, in parse_and_run_commands
    parsed_args.func(parsed_args)
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/argparser.py", line 77, in _list
    tag=args.tag)
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/commands.py", line 44, in workflows_list
    self._print_details_as_table(FullWorkflowDetails(api, all_versions, tag))
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/commands.py", line 31, in _print_details_as_table
    print(Table(details.column_names, details.get_column_data()))
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/commands.py", line 263, in get_column_data
    configurations = self.api.workflow_configurations_list(workflow_tag=workflow['tag'])
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/api.py", line 131, in workflow_configurations_list
    return self._get_request(url)
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/api.py", line 32, in _get_request
    self._check_response(response)
  File "/Users/dcl9/Code/python/venv-bespin-cli/lib/python3.6/site-packages/bespin/api.py", line 59, in _check_response
    raise NotFoundException(BespinApi.make_message_for_http_error(response))
bespin.api.NotFoundException: <h1>Not Found</h1><p>The requested URL /api/workflow-configurations/ was not found on this server.</p>
johnbradley commented 5 years ago

I think this is because your url is pointing at the v1 api. Try removing that line from the config or changing it to https://bespin.genome.duke.edu/api/v2.

dleehr commented 5 years ago

I think this is because your url is pointing at the v1 api.

I see. I wondered about that but forgot that /api is v1 and /api/v2 is v2. It doesn't help that DRF hides the URL unless you know to go look for it.

Try removing that line from the config or changing it to https://bespin.genome.duke.edu/api/v2.

Yep, that worked.