galaxyproject / galaxyproject/planemo

Cryptic AttributeError attempting to use shed_upload

Open
#153 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
110
Forks
102
Avg merge
4d 21h
Merged PRs (30d)
13

Description

This was my first attempt to use `planemo shed_upload`, where I first manually generated a tar-ball (which I would normally have uploaded to the Tool Shed by hand) supplied here with the `--tar` option.

I presume `PROJECT` means a folder (containing `.shed.yml`), thus I tried:

```
$ planemo shed_upload --shed_target testtoolshed --message "v0.0.8; fixed missing rpy error; relaxed test" --tar ~/toolshed_archives/venn_list_v0.0.8.tar.gz ~/repositories/pico_galaxy/tools/venn_list/
/mnt/galaxy/repositories/planemo/.venv/lib/python2.6/site-packages/requests-2.6.2-py2.6.egg/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
/mnt/galaxy/repositories/planemo/.venv/lib/python2.6/site-packages/requests-2.6.2-py2.6.egg/requests/packages/urllib3/connectionpool.py:768: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
Traceback (most recent call last):
File "/mnt/galaxy/repositories/planemo/.venv/bin/planemo", line 9, in
load_entry_point('planemo==0.9.0.dev0', 'console_scripts', 'planemo')()
File "/mnt/galaxy/repositories/planemo/.venv/lib/python2.6/site-packages/click-4.0-py2.6.egg/click/core.py", line 664, in __call__
return self.main(*args, **kwargs)
File "/mnt/galaxy/repositories/planemo/.venv/lib/python2.6/site-packages/click-4.0-py2.6.egg/click/core.py", line 644, in main
rv = self.invoke(ctx)
File "/mnt/galaxy/repositories/planemo/.venv/lib/python2.6/site-packages/click-4.0-py2.6.egg/click/core.py", line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/mnt/galaxy/repositories/planemo/.venv/lib/python2.6/site-packages/click-4.0-py2.6.egg/click/core.py", line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/mnt/galaxy/repositories/planemo/.venv/lib/python2.6/site-packages/click-4.0-py2.6.egg/click/core.py", line 464, in invoke
return callback(*args, **kwargs)
File "/mnt/galaxy/repositories/planemo/.venv/lib/python2.6/site-packages/click-4.0-py2.6.egg/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/mnt/galaxy/repositories/planemo/.venv/lib/python2.6/site-packages/click-4.0-py2.6.egg/click/core.py", line 464, in invoke
return callback(*args, **kwargs)
File "/mnt/galaxy/repositories/planemo/.venv/lib/python2.6/site-packages/planemo-0.9.0.dev0-py2.6.egg/planemo/commands/cmd_shed_upload.py", line 63, in cli
exit_code = shed.for_each_repository(upload, path, **kwds)
File "/mnt/galaxy/repositories/planemo/.venv/lib/python2.6/site-packages/planemo-0.9.0.dev0-py2.6.egg/planemo/shed.py", line 417, in for_each_repository
function(realized_repository)
File "/mnt/galaxy/repositories/planemo/.venv/lib/python2.6/site-packages/planemo-0.9.0.dev0-py2.6.egg/planemo/commands/cmd_shed_upload.py", line 61, in upload
return __handle_upload(ctx, realized_repository, **kwds)
File "/mnt/galaxy/repositories/planemo/.venv/lib/python2.6/site-packages/planemo-0.9.0.dev0-py2.6.egg/planemo/commands/cmd_shed_upload.py", line 99, in __handle_upload
exception_content = e.read()
AttributeError: 'exceptions.TypeError' object has no attribute 'read'
```

Note that I expected this to read the name and owner from the `.shed.yml` file (including the `--name` and `--owner` arguments made no difference):

```
$ more ~/repositories/pico_galaxy/tools/venn_list/.shed.yml
name: venn_list
owner: peterjc
homepage_url: https://github.com/peterjc/pico_galaxy/tools/venn_list
remote_repository_url: https://github.com/peterjc/pico_galaxy/tools/venn_list
description: Draw Venn Diagram (PDF) from lists, FASTA files, etc
long_description: |
Draw Venn Diagrams for 1, 2 or 3 sets of identifiers as a PDF file.

Can parse FASTA, FASTQ, SFF or tabular files (taking column one) for identifiers.
This can be combined with the extensive tabular file filtering and manipulation
tools within Galaxy to prepare the input data.

Uses the R/Bioconductor package limma to draw the PDF file, called from Python with
rpy.

Uses Biopython to parse SFF files.
categories:
- Graphics
- Sequence Analysis
- Visualization
type: unrestricted
```

Contributor guide

Open the contributing guide

Research direction

Start with planemo/commands/cmd_shed_upload.py, especially __handle_upload around line 99, and follow the call through planemo/shed.py:417. Reproduce the shown shed_upload command and inspect how the caught exception is handled. Done means the upload failure no longer produces the cryptic AttributeError and reports the underlying problem clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.