nextstrain / auspice

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

auspice view hangs #1720

Closed el239 closed 7 months ago

el239 commented 8 months ago

I'm running auspice with XQuartz from a Linux server. The zika tutorial works fine and loads the tree on a webpage. However, when I got through the tutorial with my own data (I skipped the "Annotate Phylogeny" steps because I don't think they're necessary for it to work?), the webpage hangs on loading and I just see the colorful wheel infinitely spinning. I got a few warnings on the export, but have to wonder if it's something else. Please advise

Nextstrain  ~/covid_augur $ augur export v2 --tree timed.tree.nwk --metadata meta --node-data out.node.data --output ouput.auspice_json --colors config/colors.tsv --lat-longs config/lat_longs.tsv --auspice-config config/auspice_config.json --output covid.json
Validating config file config/auspice_config.json against the JSON schema
Validating schema of 'config/auspice_config.json'...
WARNING: [colorings] You asked for mutations ("gt"), but none are defined on the tree. They cannot be used as a coloring.

WARNING: You asked for a color-by for trait 'author', but it has no values on the tree. It has been ignored.

WARNING: You asked for a color-by for trait 'country', but it has no values on the tree. It has been ignored.

WARNING: You asked for a color-by for trait 'region', but it has no values on the tree. It has been ignored.

WARNING: Geo resolution "country" had no demes with supplied lat/longs and will be excluded from the exported "geo_resolutions".

WARNING: Geo resolution "region" had no demes with supplied lat/longs and will be excluded from the exported "geo_resolutions".

Validating produced JSON
Validating schema of 'covid.json'...
Validating that the JSON is internally consistent...
Validation of 'covid.json' succeeded.
tsibley commented 7 months ago

Hi @el239, sorry you're having issues.

To know for sure why it's not loading for you, we'd need to start by seeing the errors and log messages in your web browser's developer console after you've encountered the endless spinner. If you're using Firefox or Chrome you can open the developer tools by pressing Ctrl-Shift-I and clicking on the "Console" tab. Similar developer tools are available in the Safari and Edge browsers as well.

tsibley commented 7 months ago

Also, can you tell us more about the environment in which you're running auspice view and the exact invocation you're using?

From your augur export example, it looks like you're running that from within a nextstrain shell? (maybe using the Conda runtime?)

el239 commented 7 months ago

Certainly, I am using the cli-standalone install of nextstrain (not a conda env), and am indeed running that command after having launched the shell with with

nextstrain shell .

However, I think because I am using XQuartz, I cannot access the developer tools. Just this thin gray bar appears as if it's going to load the console there, but doesn't. I'll get a local install working and try the same dataset there, so that I can share the errors and log messages. Thank you for helping.

Screen Shot 2023-11-14 at 9 30 21 AM
tsibley commented 7 months ago

Hmm. It's possible that the networked X11 display is causing browser performance issues. Based on what you said, my understanding is you're accessing Auspice's web interface by running a web browser (Firefox) on a remote Linux system which is displaying its window on your local macOS system via XQuartz. Have I got that right?

Since Auspice's web interface is itself be served over the network, you could instead run a web browser locally on macOS, without use of remote X11 displays and XQuartz. While the remote web browser would access Auspice via a URL like http://localhost:4000, in your local browser you'd access it like http://remote.server:4000.

Auspice only listens on localhost by default, but you can change that by setting HOST, e.g.:

nextstrain shell .
HOST=0.0.0.0 auspice view

Alternatively, you can use nextstrain view and its --allow-remote-access option instead of nextstrain shell + auspice view + HOST:

nextstrain view --allow-remote-access --no-open .

(The --no-open option prevents it from automatically launching a browser if it finds one.)

Either way the URL that's printed will look like http://0.0.0.0:4000/..., but you'll need to adjust it for the actual IP/hostname of the remote Linux system. (We used to provide the actual IP for you, but alas, had to remove that functionality for now.)

If firewall rules on the remote Linux system get in the way or you'd like to not worry about finding the remote IP/hostname, you can use SSH port forwarding to make your local port 4000 (for example) forward to the remote port 4000, e.g.:

ssh -L localhost:4000:localhost:4000 you@remote.server

I'm presuming you're already using SSH to access the command line interfaces (e.g. nextstrain shell and such) and also to forward X11...

I'll get a local install working and try the same dataset there, so that I can share the errors and log messages.

A local install of the nextstrain command on your macOS system would also avoid this networked X display, of course, so that may also help. That said, I guess if your files on on the remote Linux system you may not want to be shuffling them around just to view them.

el239 commented 7 months ago

Hmm. It's possible that the networked X11 display is causing browser performance issues. Based on what you said, my understanding is you're accessing Auspice's web interface by running a web browser (Firefox) on a remote Linux system which is displaying its window on your local macOS system via XQuartz. Have I got that right?

That's correct. Thank you for the detailed guide! I will explore these options.