elsiklab / jbrowse_elasticsearch

A JBrowse plugin for generating an elasticsearch database and an express.js adaptor for the Names API
6 stars 0 forks source link

Error: Cannot find module 'elasticsearch' #11

Open mictadlo opened 4 years ago

mictadlo commented 4 years ago

Hi @cmdcolin and @nathandunn, I followed this topic and did change a little of its docker-compose.yml file. Please find the updated file below:

version: "3.2"
services:

  apollo:
    build: Apollo
    volumes:
      - ./data/:/data
      - postgres-data:/var/lib/postgresql
    ports:
       - 8888:8080
    restart: always
    links:
      - elasticsearch:elasticsearch

  elasticsearch:
    image: elasticsearch:6.4.2
    container_name: elasticsearch
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - esdata1:/usr/share/elasticsearch/data

volumes:
  postgres-data:
  esdata1:
    driver: local

To start it:

> mkdir benthgenome
> cd benthgenome
> git clone https://github.com/GMOD/Apollo.git
> vim Apollo/docker-files/docker-apollo-config.groovy

jbrowse {
...
        ElasticSearch{
            git = 'https://github.com/elsiklab/jbrowse_elasticsearch'
            branch = 'master'
            alwaysRecheck = "true"
            alwaysPull = "true"
        }
...
    }
}

> docker-compose up
> docker-compose exec apollo /bin/bash

However, I ran into the following errors:

/usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch# npm start

> jbrowse_elasticsearch@1.0.5 start /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch
> node ./bin/www

module.js:550
    throw err;
    ^

Error: Cannot find module 'elasticsearch'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch/app.js:1:83)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jbrowse_elasticsearch@1.0.5 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the jbrowse_elasticsearch@1.0.5 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-08-14T23_25_40_124Z-debug.log

Next, I did:

/usr/local/tomcat/webapps/ROOT/jbrowse# bash setup.sh 
Gathering system information ...done.
NOTE: Legacy scripts wig-to-json.pl and bam-to-json.pl have been removed from setup. Their functionality has been superseded by add-bam-track.pl and add-bw-track.pl. If you require the old versions, please use JBrowse 1.12.3 or earlier.
Installing node.js dependencies and building with webpack ...done.
Installing Perl prerequisites ...done.

Formatting Volvox example data ...done.
To see the volvox example data, browse to http://your.jbrowse.root/index.html?data=sample_data/json/volvox.

Formatting Yeast example data ... failed.  See setup.log file for error messages.

I also tried:

/usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch# bash setup.sh 
Installing Perl pre-requisites
cpanm (App::cpanminus) 1.7043 on perl 5.024001 built for x86_64-linux-gnu-thread-multi
Work directory is /root/.cpanm/work/1565824368.10065
You have make /usr/bin/make
You have LWP 6.39
You have /bin/tar: tar (GNU tar) 1.29
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching Bio::Perl (== 1.7.2) on cpanmetadb ...
--> Working on Bio::Perl
Fetching http://www.cpan.org/authors/id/C/CJ/CJFIELDS/BioPerl-1.007002.tar.gz ... OK
Unpacking BioPerl-1.007002.tar.gz
BioPerl-1.007002
...

Entering BioPerl-1.007002
Checking configure dependencies from META.json
Checking if you have Module::Build 0.42 ... Yes (0.4229)
Checking if you have ExtUtils::Install 1.46 ... Yes (2.04)
Running Build.PL
Configuring BioPerl-1.007002 ... Checking prerequisites...
  recommends:
    *  Algorithm::Munkres is not installed
    *  Array::Compare is not installed
    *  Bio::Phylo is not installed
    *  CGI is not installed
    *  Convert::Binary::C is not installed
    *  GD is not installed
    *  Graph is not installed
    *  GraphViz is not installed
    *  HTML::TableExtract is not installed
    *  IO::Scalar is not installed
    *  Inline::C is not installed
    *  List::MoreUtils is not installed
    *  PostScript::TextBlock is not installed
    *  SVG is not installed
    *  SVG::Graph is not installed
    *  Set::Scalar is not installed
    *  Sort::Naturally is not installed
    *  Spreadsheet::ParseExcel is not installed
    *  XML::DOM is not installed
    *  XML::DOM::XPath is not installed
    *  XML::LibXML is not installed
    *  XML::Parser is not installed
    *  XML::Parser::PerlSAX is not installed
    *  XML::SAX is not installed
    *  XML::SAX::Writer is not installed
    *  XML::Simple is not installed
    *  XML::Twig is not installed
    *  XML::Writer is not installed
    *  YAML is not installed

Checking optional features...
Bio::DB::GFF Tests....disabled
  requires:
    ! DBI is not installed
EntrezGene............disabled
  requires:
    ! Bio::ASN1::EntrezGene is not installed
MySQL Tests...........disabled
  requires:
    ! DBD::mysql is not installed
    ! DBI is not installed
Pg Tests..............disabled
  requires:
    ! DBD::Pg is not installed
    ! DBI is not installed
SQLite Tests..........disabled
  requires:
    ! DBD::SQLite is not installed
    ! DBI is not installed

ERRORS/WARNINGS FOUND IN PREREQUISITES.  You may wish to install the versions
of the modules indicated above before proceeding with this installation

Install [a]ll BioPerl scripts, [n]one, or choose groups [i]nteractively? [a]   - will install all scripts

Do you want to run tests that require connection to servers across the internet
(likely to cause some failures)? y/n [n]   - will not run internet-requiring tests
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'BioPerl' version '1.007002'
OK
Checking dependencies from MYMETA.json ...
Checking if you have Data::Stag 0.11 ... Yes (0.14)
Checking if you have ExtUtils::Manifest 1.52 ... Yes (1.70)
Checking if you have URI::Escape 0 ... Yes (3.31)
Checking if you have Scalar::Util 0 ... Yes (1.42_02)
Checking if you have Module::Build 0.42 ... Yes (0.4229)
Checking if you have Test::Harness 2.62 ... Yes (3.36_01)
Checking if you have CPAN 1.81 ... Yes (2.11_01)
Checking if you have IO::String 0 ... Yes (1.08)
Checking if you have Test::Most 0 ... Yes (0.35)
Building BioPerl-1.007002 ... Building BioPerl
Building BioPerl
Reading skip patterns from 'INSTALL.SKIP'.
Skipping /usr/local/man/man1/bp_classify_hits_kingdom.pl.1p (unchanged)

...

Skipping /usr/local/bin/bp_parse_hmmsearch.pl (unchanged)
Writing /usr/local/lib/x86_64-linux-gnu/perl/5.24.1/auto/Bio/.packlist
OK
Successfully installed BioPerl-1.007002
Installing /usr/local/share/perl/5.24.1/x86_64-linux-gnu-thread-multi/.meta/BioPerl-1.007002/install.json
1 distribution installed
cpanm (App::cpanminus) 1.7043 on perl 5.024001 built for x86_64-linux-gnu-thread-multi
Work directory is /root/.cpanm/work/1565824380.11799
You have make /usr/bin/make
You have LWP 6.39
You have /bin/tar: tar (GNU tar) 1.29
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching Bio::Perl (== 1.7.2) on cpanmetadb ...
--> Working on Bio::Perl
Fetching http://www.cpan.org/authors/id/C/CJ/CJFIELDS/BioPerl-1.007002.tar.gz ... OK
Unpacking BioPerl-1.007002.tar.gz
BioPerl-1.007002

...

BioPerl-1.007002/t/data/ps_scan/out.PrositeScan
BioPerl-1.007002/travis_scripts/trigger-dockerhub.sh
Entering BioPerl-1.007002
Checking configure dependencies from META.json
Checking if you have ExtUtils::Install 1.46 ... Yes (2.04)
Checking if you have Module::Build 0.42 ... Yes (0.4229)
Running Build.PL
Configuring BioPerl-1.007002 ... Checking prerequisites...
  recommends:
    *  Algorithm::Munkres is not installed
    *  Array::Compare is not installed
    *  Bio::Phylo is not installed
    *  CGI is not installed
    *  Convert::Binary::C is not installed
    *  GD is not installed
    *  Graph is not installed
    *  GraphViz is not installed
    *  HTML::TableExtract is not installed
    *  IO::Scalar is not installed
    *  Inline::C is not installed
    *  List::MoreUtils is not installed
    *  PostScript::TextBlock is not installed
    *  SVG is not installed
    *  SVG::Graph is not installed
    *  Set::Scalar is not installed
    *  Sort::Naturally is not installed
    *  Spreadsheet::ParseExcel is not installed
    *  XML::DOM is not installed
    *  XML::DOM::XPath is not installed
    *  XML::LibXML is not installed
    *  XML::Parser is not installed
    *  XML::Parser::PerlSAX is not installed
    *  XML::SAX is not installed
    *  XML::SAX::Writer is not installed
    *  XML::Simple is not installed
    *  XML::Twig is not installed
    *  XML::Writer is not installed
    *  YAML is not installed

Checking optional features...
Bio::DB::GFF Tests....disabled
  requires:
    ! DBI is not installed
EntrezGene............disabled
  requires:
    ! Bio::ASN1::EntrezGene is not installed
MySQL Tests...........disabled
  requires:
    ! DBD::mysql is not installed
    ! DBI is not installed
Pg Tests..............disabled
  requires:
    ! DBD::Pg is not installed
    ! DBI is not installed
SQLite Tests..........disabled
  requires:
    ! DBD::SQLite is not installed
    ! DBI is not installed

ERRORS/WARNINGS FOUND IN PREREQUISITES.  You may wish to install the versions
of the modules indicated above before proceeding with this installation

Install [a]ll BioPerl scripts, [n]one, or choose groups [i]nteractively? [a]   - will install all scripts

Do you want to run tests that require connection to servers across the internet
(likely to cause some failures)? y/n [n]   - will not run internet-requiring tests
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'BioPerl' version '1.007002'
OK
Checking dependencies from MYMETA.json ...
Checking if you have URI::Escape 0 ... Yes (3.31)
Checking if you have Data::Stag 0.11 ... Yes (0.14)
Checking if you have Scalar::Util 0 ... Yes (1.42_02)
Checking if you have IO::String 0 ... Yes (1.08)
Checking if you have CPAN 1.81 ... Yes (2.11_01)
Checking if you have ExtUtils::Manifest 1.52 ... Yes (1.70)
Checking if you have Test::Most 0 ... Yes (0.35)
Checking if you have Test::Harness 2.62 ... Yes (3.36_01)
Checking if you have Module::Build 0.42 ... Yes (0.4229)
Building BioPerl-1.007002 ... Building BioPerl
Building BioPerl
Reading skip patterns from 'INSTALL.SKIP'.
Skipping /usr/local/man/man1/bp_classify_hits_kingdom.pl.1p (unchanged)

...

Skipping /usr/local/bin/bp_parse_hmmsearch.pl (unchanged)
Writing /usr/local/lib/x86_64-linux-gnu/perl/5.24.1/auto/Bio/.packlist
OK
Successfully installed BioPerl-1.007002
Installing /usr/local/share/perl/5.24.1/x86_64-linux-gnu-thread-multi/.meta/BioPerl-1.007002/install.json
1 distribution installed
--> Working on .
Configuring /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch ... OK
Building jbrowse_elasticsearch-1.0 ... OK
Successfully installed jbrowse_elasticsearch-1.0
1 distribution installed
--> Working on https://github.com/GMOD/jbrowse/archive/master.tar.gz
Fetching https://github.com/GMOD/jbrowse/archive/master.tar.gz ... ERROR: LWP will support https URLs if the LWP::Protocol::https module is installed.
FAIL
! Download https://github.com/GMOD/jbrowse/archive/master.tar.gz failed. Retrying ... 
ERROR: LWP will support https URLs if the LWP::Protocol::https module is installed.
! Download https://github.com/GMOD/jbrowse/archive/master.tar.gz failed. Retrying ... 
ERROR: LWP will support https URLs if the LWP::Protocol::https module is installed.
! Download https://github.com/GMOD/jbrowse/archive/master.tar.gz failed. Retrying ... 
! Failed to download https://github.com/GMOD/jbrowse/archive/master.tar.gz
! Failed to fetch distribution 

What did I miss?

Thank you in advance

Michal

nathandunn commented 4 years ago

@mictadlo Is there something that the elasticsearch plugin is doing that the regular name search is not?

Apologize if you've already answered this.

This is kind of an advanced plugin to setup if you don't need it.

mictadlo commented 4 years ago

Hi, I presented Apollo to our group and the biggest request was to improve the search. Most of our annotation starts with Protein i.e. we have first type Protein follow by the next part of the gene description.

NbV1Ch01        NbGenome        mRNA    31788319        31794554        .       +       .       ID=Nb3PK41369.mrna1;Name=Nb3PK41369;Note=Protein CASEIN KINASE I-LIKE 3;Parent=Nb3PK41369.path1;coverage=100.0;identity=100.0;indels=0;matches=1272;mismatches=0;unknowns=0

However, the biologist would like to to be able to type e.g. KINASE and find all possibilities in a similar way to https://www.youtube.com/watch?v=W2FLc-sRzLA .

If I understood this plugin correctly then it will provide this kind of improved search.

Michal

nathandunn commented 4 years ago

@mictadlo gotcha.

Is this elasticsearch @cmdcolin ? It looks different from https://github.com/elsiklab/jbrowse_elasticsearch , but maybe its just newer.

@abretadeau is this a project you are familiar with (I see the INRA label).

nathandunn commented 4 years ago

Also, as much as I like docker, it might be easier to do without it to get it started.

cmdcolin commented 4 years ago

This is the error message you need to resolve

ERROR: LWP will support https URLs if the LWP::Protocol::https module is installed.

If you install this module manually maybe with

cpanm  LWP::Protocol::https

Then you can then re-run the setup.sh

mictadlo commented 4 years ago

Hi, Thank you. To solve the Error few additianal packages had to be intalled:

# cd /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch
# apt install cpanminus libssl-dev
# cpanm  LWP::Protocol::https

# bash setup.sh
...
Skipping /usr/local/bin/bp_extract_feature_seq.pl (unchanged)
Skipping /usr/local/bin/bp_parse_hmmsearch.pl (unchanged)
Writing /usr/local/lib/x86_64-linux-gnu/perl/5.24.1/auto/Bio/.packlist
OK
Successfully installed BioPerl-1.007002
Installing /usr/local/share/perl/5.24.1/x86_64-linux-gnu-thread-multi/.meta/BioPerl-1.007002/install.json
1 distribution installed
--> Working on .
Configuring /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch ... OK
Building jbrowse_elasticsearch-1.0 ... OK
Successfully installed jbrowse_elasticsearch-1.0
1 distribution installed
--> Working on https://github.com/GMOD/jbrowse/archive/master.tar.gz
Fetching https://github.com/GMOD/jbrowse/archive/master.tar.gz ... OK
Configuring jbrowse-master ... OK
Building JBrowse- ... OK
Successfully installed JBrowse-
1 distribution installed
Installing NodeJS pre-requisites
audited 148 packages in 1.526s
found 16 vulnerabilities (7 low, 2 moderate, 6 high, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details

   ╭────────────────────────────────────────────────────────────────╮
   │                                                                │
   │       New minor version of npm available! 6.4.1 → 6.10.3       │
   │   Changelog: https://github.com/npm/cli/releases/tag/v6.10.3   │
   │               Run npm install -g npm to update!                │
   │                                                                │
   ╰────────────────────────────────────────────────────────────────╯

Setting up test dataset
Done

# npm start

> jbrowse_elasticsearch@1.0.5 start /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch
> node ./bin/www

However, when I search I get Error: RequestError: Unable to load undefined status: 404 as show below.

image

What did I miss?

@nathandunn The source code from MyGenomeBrowser can be found here. It appears that there are not using any EleasticSearch. Thank you in advance.

Michal

cmdcolin commented 4 years ago

You have to run the bin/generate-elastic-search.pl script probably, it is looking for a config variable that this script outputs

mictadlo commented 4 years ago
/data/apollo_data/benth-NbV1Ch03# perl /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch/bin/generate-elastic-search.pl --genome /data/apollo_data/benth-NbV1Ch03/NbV1Ch03.fa --out /data/apollo_data/benth-NbV1Ch03
[NoNodes] ** No nodes are available: [http://localhost:9200], called from sub Search::Elasticsearch::Client::6_0::Role::Bulk::index at /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch/bin/../src/perl5/Bio/JBrowse/Cmd/ElasticSearch.pm line 104.root@3870b7ed7057

What did I miss?

Thank you in advance,

Michal

cmdcolin commented 4 years ago

This means your elasticsearch daemon is not running. You need to do something like sudo service elasticsearch start. The default elasticsearch daemon runs on localhost:9200 which is why it is looking for nodes there

mictadlo commented 4 years ago

I add the below missing dependencies to Apollo/Dockerfile

...
RUN apt-get -qq update --fix-missing && \
    apt-get --no-install-recommends -y install cpanminus libssl-dev vim less && \
    apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
    cpanm  LWP::Protocol::https

ADD docker-files/createenv.sh /createenv.sh
CMD "/createenv.sh"

ADD docker-files/launch.sh /launch.sh
CMD "/launch.sh"

When I log into docker-compose exec apollo /bin/bash and I execute

service elasticsearch start
elasticsearch: unrecognized service

and

/usr/local/tomcat# perl /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch/bin/generate-elastic-search.pl --genome /data/apollo_data/benth-NbV1Ch03/NbV1Ch03.fa --out /data/apollo_data/benth-NbV1Ch03
Can't locate Search/Elasticsearch.pm in @INC (you may need to install the Search::Elasticsearch module) (@INC contains: /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch/bin/../src/perl5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch/bin/../src/perl5/Bio/JBrowse/Cmd/ElasticSearch.pm line 14.
BEGIN failed--compilation aborted at /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch/bin/../src/perl5/Bio/JBrowse/Cmd/ElasticSearch.pm line 14.
Compilation failed in require at /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch/bin/generate-elastic-search.pl line 7.

P. S. I just discovered that

elasticsearch    | [2019-08-19T04:57:50,322][INFO ][o.e.n.Node               ] [tOzB2e6] closed
elasticsearch    | [2019-08-19T04:57:50,324][INFO ][o.e.x.m.j.p.NativeController] Native controller process has stopped - no new native processes can be started
elasticsearch exited with code 78

What did I miss?

Thank you in advance,

Michal

cmdcolin commented 4 years ago

I think elasticsearch is just not installed on your machine? Follow instructions e.g. https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html

mictadlo commented 4 years ago

The problem with:

elasticsearch    | [2019-08-19T04:57:50,322][INFO ][o.e.n.Node               ] [tOzB2e6] closed
elasticsearch    | [2019-08-19T04:57:50,324][INFO ][o.e.x.m.j.p.NativeController] Native controller process has stopped - no new native processes can be started
elasticsearch exited with code 78

I solved it with:

> sudo sysctl -w vm.max_map_count=262144
> docker-compose up --build

However, I still have the below problem. Your right ElasticSearch is not install in the same Docker as Apollo but in a seperated one similar to.

> cd /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch
> bash setup.sh
found 16 vulnerabilities (7 low, 2 moderate, 6 high, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details

  ╭────────────────────────────────────────────────────────────────╮
   │                                                                │
   │       New minor version of npm available! 6.4.1 → 6.10.3       │
   │   Changelog: https://github.com/npm/cli/releases/tag/v6.10.3   │
   │               Run npm install -g npm to update!                │
   │                                                                │
   ╰────────────────────────────────────────────────────────────────╯

Setting up test dataset
Done

# perl /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch/bin/generate-elastic-search.pl --genome /data/apollo_data/benth-NbV1Ch03/NbV1Ch03.fa --out /data/apollo_data/benth-NbV1Ch03
[NoNodes] ** No nodes are available: [http://localhost:9200], called from sub Search::Elasticsearch::Client::6_0::Role::Bulk::index at /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch/bin/../src/perl5/Bio/JBrowse/Cmd/ElasticSearch.pm line 104.root@c37f95c35332

What did I miss?

Thank you in advance

Michal

cmdcolin commented 4 years ago

If it is a different machine you can pass the --elasticurl parameter in the bin/generate-elastic-search.pl

mictadlo commented 4 years ago

A new error came up after

perl /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch/bin/generate-elastic-search.pl --genome /data/apollo_data/benth-NbV1Ch03/NbV1Ch03.fa --out /data/apollo_data/benth-NbV1Ch03 --elasticurl elasticsearch:9200
...
Bulk error [index]: {"_type":"loc","_index":"gene/data/apollo_data/benth-NbV1Ch03/NbV1Ch03.fa","error":{"index":"gene/data/apollo_data/benth-NbV1Ch03/NbV1Ch03.fa","reason":"Invalid index name [gene/data/apollo_data/benth-NbV1Ch03/NbV1Ch03.fa], must not contain the following characters [ , \", *, \\, <, |, ,, >, /, ?]","index_uuid":"_na_","type":"invalid_index_name_exception"},"_id":null,"status":400} at /usr/local/share/perl/5.24.1/Search/Elasticsearch/Client/6_0/Role/Bulk.pm line 47, <$fh> line 8153.

What did I miss?

Thank you in advance,

Michal

cmdcolin commented 4 years ago

Just use a simple "genome" name e.g. --genome FruitFly

This will output a config parameter in your trackList.json called elasticIndexName, and the error message you are seeing meant that the index names are not allowed to contain complicated characters, so just use a simple genome name

mictadlo commented 4 years ago

I changed it to the below one

# perl /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch/bin/generate-elastic-search.pl --genome nbv1ch03 --out /data/apollo_data/benth-NbV1Ch03 --elasticurl elasticsearch:9200

and the previous error disappeared but in Apollo I got now:

Error: RequestError: Unable to load http://localhost:3000/?contains=d&index=nbv1ch03&exact=false status: 0

What did I miss?

Thank you in advance.

Michal

cmdcolin commented 4 years ago

You have to configure where the plugin looks for the node.js middleware app e.g. the "node bin/www" the --url argument to bin/generate-elastic-search.pl

By default it runs on Port 3000 and for testing it makes since to be localhost but in a production instance it may be http://yourhost.com:3000

mictadlo commented 4 years ago

The error remained after the below command

perl /usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch/bin/generate-elastic-search.pl --genome nbv1ch03 --out /data/apollo_data/benth-NbV1Ch03 --elasticurl elasticsearch:9200 --url http://apollo:3000

What did I miss?

Thank you in advance,

Michal

mictadlo commented 4 years ago

I changed the docker-compose.yml file to support port 3000:

version: "3.2"
services:

  apollo:
    build: Apollo
    volumes:
      - ./data/:/data
      - postgres-data:/var/lib/postgresql
    ports:
       - 8888:8080
       - 3000:3000
    restart: always
    depends_on:
       - elasticsearch

  elasticsearch:
    image: elasticsearch:6.4.2
    container_name: elasticsearch
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - esdata1:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
      - 9300:9300

volumes:
  postgres-data:
  esdata1:
    driver: local

Additionally, I changed also Apollo's Dockerfile:

EXPOSE 3000
RUN apt-get -qq update --fix-missing && \
    apt-get --no-install-recommends -y install cpanminus libssl-dev vim less && \
    apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
    cpanm  LWP::Protocol::https

ADD docker-files/createenv.sh /createenv.sh
CMD "/createenv.sh"

ADD docker-files/launch.sh /launch.sh
CMD "/launch.sh"

Then I did

docker-compose up --build
docker-compose exec apollo /bin/bash

Inside the Apollo container I tried the below comands but I got Connection refused

root@2c797efffc92:/usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch# curl http://apollo:3000
curl: (7) Failed to connect to apollo port 3000: Connection refused
root@2c797efffc92:/usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch# curl http://localhost:3000
curl: (7) Failed to connect to localhost port 3000: Connection refused

What possible could I miss?

Thank you in advance,

Michal

cmdcolin commented 4 years ago

Does the docker container launch the nodejs middleware e.g. the node ./bin/www

You can configure nodejs middlewares to be launched by system services e.g. pm2 but otherwise just need to launch this middleware

mictadlo commented 4 years ago

Still the same problem with:

root@2c797efffc92:/usr/local/tomcat/webapps/ROOT/jbrowse/plugins/ElasticSearch# node ./bin/www
cmdcolin commented 4 years ago

I'd recommend looking up how simple express.js nodejs webservices work in your environment. See if you can get a hello world example from express.js to work perhaps https://expressjs.com/en/starter/hello-world.html and then you can see if my service works if you can get that to work