nextstrain / auspice

Web app for visualizing pathogen evolution
https://docs.nextstrain.org/projects/auspice/
GNU Affero General Public License v3.0
292 stars 162 forks source link

auspice server fails to expand partial datset URLs #698

Open jameshadfield opened 5 years ago

jameshadfield commented 5 years ago

The current auspice server doesn't redirect partial URLs to available datasets. Note that the nextstrain.org server does redirect these URLs.

E.g. http://localhost:4000/flu/seasonal/h3n2/na will not load (http://localhost:4000/flu/seasonal/h3n2/na/2y) will. Server log:

Getting datasets for: prefix=/flu/seasonal/h3n2/ha
[warning]   flu/seasonal/h3n2/ha not in available datasets --

Importantly, this error is triggered when using (most of) the sidebar dropdowns to access different datasets.

jameshadfield commented 4 years ago

Comment from #1044 (@neavemj) perhaps with a better explanation of this issue :)

Hello and thanks for the great software! I'm just having an issue with 404 errors when changing the drop-down menu options as below:

Current Behavior When running auspice either locally ("auspice view --datasetDir auspice") or from a locally-running server, selecting a different option in the top drop-down menus cause a 404 error. I think this is because the full URL to the dataset is not being retreived, only a partial URL. I think it also only occurs when the virus build has more than one part to the URL, such as strain or segment.

Expected behavior Expect a different dataset to load when drop down menu is changed. For example, selecting a different virus should load that dataset

How to reproduce Steps to reproduce the current behavior:

Run "auspice view --datasetDir auspice" on a set of jsons generated with augur
Open the local server in a webpage (localhost:4000)
Select a different virus from top drop-down menu
A 404 error page is displayed.

Possible solution I'm pretty sure this is because the full URL is not retreived. For example, if I try to load a "BTV" build by clicking on the drop-down menu, auspice tries to load this URL: localhost:4000/BTV However, the correct URL is localhost:4000/BTV/segment1

I think I somehow need to tell auspice to load the full path to a specific segment when a virus is selected.

Your environment: if running Nextstrain locally

Operating system: linux / xcfe
Browser: Firefox
Version: auspice v.2.11.4

Thanks again - any help much appreciated!

Matt.