Struggling to get the map displayed

After spending a lot of time to figure out how to do it by myself, I’ll have to ask for your kind help to let me display a map properly. It’s being show properly when I’m upping the .json to auspice.us.

Now I would like to host a server locally and run auspice on local machine.

Here are the steps that I’ve followed in order to make the changes and use Openstreetmap (According to this post : https://discussion.nextstrain.org/t/build-with-newest-nextstrain-ncov-has-api-requests-to-mapbox-403-forbidden/396/11

bash /opt/Anaconda3-2021.05-Linux-x86_64.sh
conda create -n nextstrain -c conda-forge -c bioconda augur auspice nextstrain-cli nextalign snakemake awscli git pip
conda activate nextstrain
cd anaconda3/envs/nextstrain/lib/auspice/node_modules/
mkdir customisations
cd customisations
vi config.json
auspice build --extend ./customisations/config.json --verbose

The build seems ok

The content of my config.json

{
“mapTiles”: {
“api”: “https://a.tile.openstreetmap.org/{z}/{x}/{y}.png”,
“attribution”: “©; <a href=“https://www.openstreetmap.org/copyright”>OpenStreetMap contributors”,
“mapboxWordmark”: false
}
}

I’m running this command afterwards to access the server
nextstrain view /home/myuser/datasets/ --allow-remote-access
But the map is still showing a grey tile (meaning that the changes I’m making are not taken into account).

Would someone let me know what I’m doing wrong? And how would I be able to get this map finally being displayed properly. Thanks!

map

That all looks good @ipcitsupport, however the command to run a customised auspice is

auspice view --datasetDir /home/myuser/datasets

Longer version: nextstrain view will typically use a pre-made docker image, not the local version of auspice. If you want the --allow-remote-access functionality, you can try nextstrain view --native /home/myuser/datasets/ --allow-remote-access however I haven’t yet tested this.

Thank you very much for your reply

I tried with your command, but the output is similar, grey tile map

~$ nextstrain view --native /home/ipcuser/datasets/ --allow-remote-access

——————————————————————————————————————————————————————————————————————————————
The following datasets should be available in a moment:
http://192.168.10.140:4000/ncov/Cambodian/build
——————————————————————————————————————————————————————————————————————————————

[verbose] Serving index / favicon etc from “/home/ipcuser/anaconda3/envs/nextstrain/lib/auspice/node_modules/auspice”
[verbose] Serving built javascript from “/home/ipcuser/anaconda3/envs/nextstrain/lib/auspice/node_modules/auspice/dist”


Auspice server now running at http://0.0.0.0:4000
Serving auspice version 2.23.0
Looking for datasets in /home/ipcuser/datasets
Looking for narratives in /home/ipcuser/anaconda3/envs/nextstrain/lib/auspice/node_modules/auspice/narratives

GET DATASET query received: prefix=/ncov/Cambodian/build
GET AVAILABLE returning locally available datasets & narratives
[warning] Couldn’t collect available narratives (path searched: /home/ipcuser/anaconda3/envs/nextstrain/lib/auspice/node_modules/auspice/narratives)
[verbose] Error: ENOENT: no such file or directory, scandir ‘/home/ipcuser/anaconda3/envs/nextstrain/lib/auspice/node_modules/auspice/narratives’
GET DATASET query received: prefix=/ncov/Cambodian/build&type=root-sequence
GET DATASET query received: prefix=/ncov/Cambodian/build

The problem with auspice view --datasetDir /home/ipcuser/datasets/ is that it will run only on localhost and even after going through the how-tos to run a server to access data from external, I really lack the skills to get things working properly (hence the choice of going through the CONDA installation and nextstrain view --allow-remote-access)

I tried the docker image, I wasn’t more succesful, I tried building with NPM and making some changes to the code, it failed displaying the map properly.

I guess my only choice is to dig deeper and figure out how to make this auspice view connect with a web server.

What is your end goal? auspice view is a server in its own right, running on localhost:4000, and seems to be working as intended in that it’s delivering the correct map tiles. If you want to expose this address to the outside world (or, at least to your network) then that’s somewhat unrelated to auspice; googling “expose localhost to network” seems to have a lot of possible solutions.

P.S. You can specify whatever host and port you want auspice view to run on via the HOST and PORT env vars. Maybe it’s as simple as running HOST=192.168.10.140 PORT=4000 auspice view --datasetDir /home/ipcuser/datasets.

Thank you very much for taking the time to reply

Our goal is just to setup a local Auspice server that will be browsable by our staff internally

The solution you provided with defining the variable HOST before running auspice view does the trick. We can access the Auspice server from computer in our LAN. (No need to install the whole conda nextstrain) Thank you for that.

However I am still having issues with grey tiled map. Even when trying to build auspice with a custom config.json as explained in your post Build with newest nextstrain/ncov has API requests to mapbox 403:Forbidden - #11 by james

Here are all the steps I’ve been doing

  • Install Ubuntu 20.04 server machine from scratch (8Gb RAM + 100Gb HDD)
  • Install updates
  • Install Nodejs 14
  • Download Anaconda
  • Make conda available for user ipcuser
  • Create auspice environment
  • Install auspice with NPM
  • Create datasets folder & place my json dataset inside
  • Running auspice view --datasetDir /home/ipcuser/datasets

bash /opt/Anaconda3-2021.05-Linux-x86_64.sh
source ~/.bashrc
conda create --name auspice nodejs=14
conda update conda
conda activate auspice
npm install --global auspice
auspice --version
mkdir datasets
HOST=192.168.10.139 PORT=4000 auspice view --datasetDir /home/ipcuser/datasets

= Maps are not showing (grey tile)

If i try to create a config.json with the content you listed in your post

{
“mapTiles”: {
“api”: “https://a.tile.openstreetmap.org/{z}/{x}/{y}.png”,
“attribution”: “<a href=“https://www.openstreetmap.org/copyright”>OpenStreetMap contributors”,
“mapboxWordmark”: false
}
}

And build auspice again, I’m getting a core dump :

(auspice) ipcuser@srvlxubu:~$ auspice build --verbose --extend anaconda3/envs/auspice/config.json
[verbose] Generating webpack config. Extensions? true. devMode: false
[verbose] Webpack writing output to: /home/ipcuser/dist
Running webpack compiler
[verbose] Generating Babel Config
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/lodash/lodash.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/react-icons/fa/index.esm.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/npm/node_modules/ajv/dist/regenerator.min.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/react-icons/ri/index.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/react-icons/ri/index.esm.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/react-icons/si/index.esm.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/react-icons/si/index.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/react-icons/fa/index.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/react-icons/di/index.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/react-icons/di/index.esm.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/react-icons/ai/index.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/react-icons/ai/index.esm.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/react-icons/gi/index.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/react-icons/gi/index.esm.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/react-dom/umd/react-dom.development.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/react-dom/cjs/react-dom.development.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/@hot-loader/react-dom/umd/react-dom.development.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/node_modules/@hot-loader/react-dom/cjs/react-dom.development.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/ipcuser/anaconda3/envs/auspice/lib/node_modules/auspice/dist/auspice.chunk.core-vendors.bundle.ea6fafa4f175e7278319.js as it exceeds the max of 500KB.

<— Last few GCs —>

[9736:0x55baaed951a0] 1293410 ms: Mark-sweep (reduce) 2038.1 (2054.5) → 2037.9 (2055.2) MB, 2224.1 / 0.0 ms (average mu = 0.145, current mu = 0.003) allocation failure scavenge might not succeed
[9736:0x55baaed951a0] 1296341 ms: Mark-sweep (reduce) 2038.9 (2052.2) → 2038.6 (2053.7) MB, 2916.4 / 0.0 ms (average mu = 0.069, current mu = 0.005) allocation failure scavenge might not succeed

<— JS stacktrace —>

FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
1: 0x7f56005a91b9 node::Abort() [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
2: 0x7f56005a9ed9 node::OnFatalError(char const*, char const*) [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
3: 0x7f56008fe1d2 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
4: 0x7f56008fe48b v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
5: 0x7f5600a979e6 [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
6: 0x7f5600acb7aa [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
7: 0x7f5600ad319e void v8::internal::LiveObjectVisitor::VisitBlackObjectsNoFail<v8::internal::EvacuateNewSpaceVisitor, v8::internal::MajorNonAtomicMarkingState>(v8::internal::MemoryChunk*, v8::internal::MajorNonAtomicMarkingState*, v8::internal::EvacuateNewSpaceVisitor*, v8::internal::LiveObjectVisitor::IterationMode) [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
8: 0x7f5600ad8f86 v8::internal::FullEvacuator::RawEvacuatePage(v8::internal::MemoryChunk*, long*) [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
9: 0x7f5600ac1f2a v8::internal::Evacuator::EvacuatePage(v8::internal::MemoryChunk*) [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
10: 0x7f5600ac221d [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
11: 0x7f5600ab75a5 v8::internal::ItemParallelJob::Task::RunInternal() [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
12: 0x7f5600ab79ae v8::internal::ItemParallelJob::Run() [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
13: 0x7f5600ad4478 void v8::internal::MarkCompactCollectorBase::CreateAndExecuteEvacuationTasks<v8::internal::FullEvacuator, v8::internal::MarkCompactCollector>(v8::internal::MarkCompactCollector*, v8::internal::ItemParallelJob*, v8::internal::MigrationObserver*, long) [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
14: 0x7f5600ad7a33 v8::internal::MarkCompactCollector::EvacuatePagesInParallel() [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
15: 0x7f5600ad7bda v8::internal::MarkCompactCollector::Evacuate() [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
16: 0x7f5600af0c7b v8::internal::MarkCompactCollector::CollectGarbage() [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
17: 0x7f5600aab272 v8::internal::Heap::MarkCompact() [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
18: 0x7f5600aabae1 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
19: 0x7f5600aac1c4 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
20: 0x7f5600aaf2ed v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
21: 0x7f5600aaf356 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
22: 0x7f5600a7847c v8::internal::factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
23: 0x7f5600da63f8 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
24: 0x7f560076ccf9 [/home/ipcuser/anaconda3/envs/auspice/bin/…/lib/libnode.so.83]
Aborted (core dumped)

Still unsure what could be the reason for this failure when steps you listed are really straightforward

I’ve seen this happen sporadically when the dependency/import graph gets too tangled between the customised code and the auspice install (not a very scientific explanation). The solution has been to ensure the customised code is being generated in a directory that is not a descendent directory of where auspice itself is installed.

Reading your original post I think you are doing just this. In the tutorial I wrote they are separate, i.e. the customisations directory is not within anaconda3/envs/nextstrain/lib/auspice/node_modules/, so that the dependency trees remain separate. (P.S. It’s generally not a good idea to reach into node_modules and modify things.)

mkdir ~/customised-auspice # i.e. not inside node_modules/auspice
cd ~/customised-auspice
# add your own `config.json` here
auspice build --verbose --extend config.json # note that this creates `index.html`, `dist` etc in the current directory
auspice view --datasetDir <PATH>

Hurray, that’s it!
I restarted everything from scratch again and the map is now displaying properly

Capture

Tons of thanks for spending time to help me!

Just a small addition, I need to run auspice view from the folder I had built it from to get the map to be displayed properly.
I ran the build command from /home/ipcuser/customised-auspice folder and ran auspice view right after without cwd or anything. After that I went to update datasets and cwd to homedir (/home/ipcuser) and the map back to the grey tile with Mapbox links and everything

If I run auspice view from /home/ipcuser, the map is showing the grey tiles again
If I run auspice view from /home/ipcuser/customised-auspice the map is showing properly

Good news – thanks for persevering!