Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting 400 error when updating existing annotations file #1072

Closed
alokito opened this issue Dec 22, 2019 · 3 comments · Fixed by #1074
Closed

Getting 400 error when updating existing annotations file #1072

alokito opened this issue Dec 22, 2019 · 3 comments · Fixed by #1074
Assignees

Comments

@alokito
Copy link

alokito commented Dec 22, 2019

I am able to open existing annotations with the following command:

~/code/nsnx/cellxgene-gateway/.cellxgene-gateway/bin/cellxgene launch ../cellxgene_data/somedir/pbmc3k.h5ad --port 8002 --host 127.0.0.1 --experimental-annotations --experimental-annotations-file ../cellxgene_data/somedir/pbmc3k_annotations/somedirAnno1-MW36MWBW.csv

However, if I edit the annotations, I get a series of 400 errors in the Chrome Developer Tools. The request is a PUT to http://localhost:8002/api/v0.2/annotations/obs?annotation-collection-name=somedirAnno1-MW36MWBW. The error message is:

Error, bad annotation collection name

@bkmartinjr
Copy link
Contributor

Hi @alokito - the collection name test is more-or-less a test for path name safety, and worst case is the regex [0-9][a-Z][A-Z]_. You collection name would appear to satisfy that test.

The error occurs when running cellxgene behind the proxy, right? Any chance the proxy is somehow modifying the query params on the request? Ideas on debugging: either run cellxgene directly (no proxy) and see if it works, or alternatively, run in --debug mode and see what request it actually receives. One of those should shed some light on what is occurring.

@alokito
Copy link
Author

alokito commented Dec 23, 2019

Hi Bruce! Sorry about the confusing command line, I am actually running cellxgene v0.13.0 directly from a venv named .cellxgene-gateway. If I read the regex correctly, the hyphen character is not allowed in the collection name, which is unfortunate since it is automatically added when new collections are made. The use case here is to allow users to open each other's annotations.

If I add --debug, it complains with:

Error: --port and --debug may not be used together (try --verbose for error logging).

if I add --verbose, it says that it is receiving the following request:

127.0.0.1 - - [22/Dec/2019 19:34:39] "PUT /api/v0.2/annotations/obs?annotation-collection-name=somedirAnno1-MW36MWBW HTTP/1.1" 400 -

@bkmartinjr bkmartinjr added this to the 0.14.0 milestone Dec 23, 2019
@bkmartinjr
Copy link
Contributor

Oh, darn - you are right. This is simply a use case we did not think through correctly.

Short-term work-around: rename the file.

I'll get it fixed in the next release. I think the simplest fix is to only use legal characters (turn the hyphen into an underscore).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants