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

WebSocket connection failed - RR_CONNECTION_TIMED_OUT #2201

Closed
dalijolijo opened this issue May 23, 2019 · 6 comments
Closed

WebSocket connection failed - RR_CONNECTION_TIMED_OUT #2201

dalijolijo opened this issue May 23, 2019 · 6 comments

Comments

@dalijolijo
Copy link

Insight request https://explorer.bitcore.cc/#/BTX/mainnet/address/2aup33vQpXm3TJmNoa3CHXJggf3gxxa9vi

JavaScript browser console output

WebSocket connection to 'wss://explorer.bitcore.cc:53703/' failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT
openConnection @ ion-dev.js?v=3.2.3:102
start @ ion-dev.js?v=3.2.3:18
(anonymous) @ ion-dev.js?v=3.2.3:468
(index):39 GET https://explorer.bitcore.cc:35729/livereload.js?snipver=1 net::ERR_CONNECTION_TIMED_OUT

The insight explorer is running with docker-compose.

Here is my docker-compose.yml

version: '3'

services:
  bitcored:
    build:
      context: ./docker-bitcored
      dockerfile: ./Dockerfile
    image: bitcored
    container_name: bitcored
    command:
      -whitebind=172.21.0.10:8555
      -whitelist=172.21.0.0/24
      -whitelist=127.0.0.1
      -txindex=1
      -maxconnections=100
      -rpcbind=172.21.0.10
      -rpcallowip=172.21.0.0/24
      -rpcallowip=127.0.0.1
      -port=8555
      -rpcport=8556
      -rpcuser=xx
      -rpcpassword=xx
    restart: always
    networks:
      insight-net:
        ipv4_address: 172.21.0.10
    ports:
      - 8555:8555
    expose:
      - 8555
      - 8556
    volumes:
      - /home/bitcore:/data

  mongodb:
    image: mongo:3.4-jessie
    container_name: mongodb
    restart: always
    networks:
      insight-net:
        ipv4_address: 172.21.0.11
    ports:
      - 127.0.0.1:27017:27017
    expose:
      - 27017
    volumes:
      - /home/mongodb:/data/db

  bitcore-node:
    build:
      context: .
      dockerfile: ./Dockerfile.bitcore-node.btx
    image: bitcore-node
    container_name: bitcore-node
    restart: always
    networks:
      insight-net:
        ipv4_address: 172.21.0.13
    ports:
      - 127.0.0.1:8100:8100
      - 3000:3000
    environment:
      - "DB_HOST=mongodb"
      - "BITCORE_CONFIG_PATH=/bitcore/bitcore.config.json"
    depends_on:
      - mongodb
      - bitcored

  insight:
    image: insight-previous
    build:
      context: .
      dockerfile: ./Dockerfile.insight-previous.btx
    container_name: insight-previous
    restart: always
    networks:
      insight-net:
        ipv4_address: 172.21.0.14
    ports:
      - 8080:8080
    environment:
      - "ENV=prod"
      - "CHAIN=BTX"
      - "NETWORK=mainnet"
      - "API_PREFIX=https://api.bitcore.cc/api"
    depends_on:
      - bitcore-node

networks:
  insight-net:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 172.21.0.0/24

Is something still wrong in the config?
What are the ports 35729 and 53703 needed for? In which way do I have to configure that?

@micahriggan
Copy link
Contributor

When you're serving insight, are you using npm run serve:prod or are you using npm start

If you're using npm start, then I think that websocket thing is for livereload, to update the page when it updates on your machine.

@dalijolijo
Copy link
Author

I`m using npm start . Is it possible to deactivate the livereload?

If I use npm run serve:prod I get an error.

> @bitpay/insight-previous@8.3.0 start /bitcore/packages/insight-previous
> npm run serve:prod


> @bitpay/insight-previous@8.3.0 serve:prod /bitcore/packages/insight-previous
> npm run clean && npm run build:prod && npm run serve


> @bitpay/insight-previous@8.3.0 clean /bitcore/packages/insight-previous
> ionic-app-scripts clean

[17:59:06]  ionic-app-scripts 3.2.3
[17:59:06]  clean started ...
[17:59:06]  clean finished in 1 ms

> @bitpay/insight-previous@8.3.0 build:prod /bitcore/packages/insight-previous
> ENV=prod CHAIN=BTX NETWORK=mainnet API_PREFIX=https://api.bitcore.cc/api npm run ionic:build --prod


> @bitpay/insight-previous@8.3.0 ionic:build /bitcore/packages/insight-previous
> ionic-app-scripts build

[17:59:08]  ionic-app-scripts 3.2.3
[17:59:08]  build prod started ...
[17:59:08]  clean started ...
[17:59:08]  clean finished in less than 1 ms
[17:59:08]  copy started ...
[17:59:08]  deeplinks started ...
[17:59:09]  deeplinks finished in 170 ms
[17:59:09]  ngc started ...
[17:59:23]  ngc finished in 14.82 s
[17:59:23]  preprocess started ...
[17:59:23]  preprocess finished in 1 ms
[17:59:23]  webpack started ...
[17:59:24]  copy finished in 15.32 s
[18:00:00]  ionic-app-script task: "build"
[18:00:00]  Error: ../bitcore-lib-btx/lib/transaction/transaction.js Module not found: Error: Can't resolve
            'buffer-compare' in '/bitcore/packages/bitcore-lib-btx/lib/transaction' resolve 'buffer-compare' in
            '/bitcore/packages/bitcore-lib-btx/lib/transaction' Parsed request is a module using description file:
            /bitcore/packages/bitcore-lib-btx/package.json (relative path: ./lib/transaction) after using description
            file: /bitcore/packages/bitcore-lib-btx/package.json (relative path: ./lib/transaction) resolve as module
            looking for modules in /bitcore/packages/insight-previous/node_modules using description file:
            /bitcore/packages/insight-previous/package.json (relative path: ./node_modules) Field 'browser' doesn't
            contain a valid alias configuration after using description file:
            /bitcore/packages/insight-previous/package.json (relative path: ./node_modules) using description file:
            /bitcore/packages/insight-previous/package.json (relative path: ./node_modules/buffer-compare) no extension
            Field 'browser' doesn't contain a valid alias configuration
            /bitcore/packages/insight-previous/node_modules/buffer-compare doesn't exist .ts Field 'browser' doesn't
            contain a valid alias configuration /bitcore/packages/insight-previous/node_modules/buffer-compare.ts
            doesn't exist .js Field 'browser' doesn't contain a valid alias configuration
            /bitcore/packages/insight-previous/node_modules/buffer-compare.js doesn't exist .json Field 'browser'
            doesn't contain a valid alias configuration
            /bitcore/packages/insight-previous/node_modules/buffer-compare.json doesn't exist as directory
            /bitcore/packages/insight-previous/node_modules/buffer-compare doesn't exist
            [/bitcore/packages/insight-previous/node_modules/buffer-compare]
            [/bitcore/packages/insight-previous/node_modules/buffer-compare.ts]
            [/bitcore/packages/insight-previous/node_modules/buffer-compare.js]
            [/bitcore/packages/insight-previous/node_modules/buffer-compare.json]
            [/bitcore/packages/insight-previous/node_modules/buffer-compare] @
            ../bitcore-lib-btx/lib/transaction/transaction.js 6:32-57 @ ../bitcore-lib-btx/lib/transaction/sighash.js @
            ../bitcore-lib-btx/index.js @ ./src/pages/messages/messages.ts @ ./src/pages/messages/messages.module.ts @
            ./src/app/app.module.ngfactory.js @ ./src/app/main.ts,../bitcore-lib-cash/lib/transaction/transaction.js
            Module not found: Error: Can't resolve 'buffer-compare' in
            '/bitcore/packages/bitcore-lib-cash/lib/transaction' resolve 'buffer-compare' in
            '/bitcore/packages/bitcore-lib-cash/lib/transaction' Parsed request is a module using description file:
            /bitcore/packages/bitcore-lib-cash/package.json (relative path: ./lib/transaction) after using description
            file: /bitcore/packages/bitcore-lib-cash/package.json (relative path: ./lib/transaction) resolve as module
            looking for modules in /bitcore/packages/insight-previous/node_modules using description file:
            /bitcore/packages/insight-previous/package.json (relative path: ./node_modules) Field 'browser' doesn't
            contain a valid alias configuration after using description file:
            /bitcore/packages/insight-previous/package.json (relative path: ./node_modules) using description file:
            /bitcore/packages/insight-previous/package.json (relative path: ./node_modules/buffer-compare) no extension
            Field 'browser' doesn't contain a valid alias configuration
            /bitcore/packages/insight-previous/node_modules/buffer-compare doesn't exist .ts Field 'browser' doesn't
            contain a valid alias configuration /bitcore/packages/insight-previous/node_modules/buffer-compare.ts
            doesn't exist .js Field 'browser' doesn't contain a valid alias configuration
            /bitcore/packages/insight-previous/node_modules/buffer-compare.js doesn't exist .json Field 'browser'
            doesn't contain a valid alias configuration
            /bitcore/packages/insight-previous/node_modules/buffer-compare.json doesn't exist as directory
            /bitcore/packages/insight-previous/node_modules/buffer-compare doesn't exist
            [/bitcore/packages/insight-previous/node_modules/buffer-compare]
            [/bitcore/packages/insight-previous/node_modules/buffer-compare.ts]
            [/bitcore/packages/insight-previous/node_modules/buffer-compare.js]
            [/bitcore/packages/insight-previous/node_modules/buffer-compare.json]
            [/bitcore/packages/insight-previous/node_modules/buffer-compare] @
            ../bitcore-lib-cash/lib/transaction/transaction.js 6:32-57 @ ../bitcore-lib-cash/lib/transaction/sighash.js
            @ ../bitcore-lib-cash/index.js @ ./src/pages/messages/messages.ts @ ./src/pages/messages/messages.module.ts
            @ ./src/app/app.module.ngfactory.js @ ./src/app/main.ts,../bitcore-lib/lib/transaction/transaction.js Module
            not found: Error: Can't resolve 'buffer-compare' in '/bitcore/packages/bitcore-lib/lib/transaction' resolve
            'buffer-compare' in '/bitcore/packages/bitcore-lib/lib/transaction' Parsed request is a module using
            description file: /bitcore/packages/bitcore-lib/package.json (relative path: ./lib/transaction) after using
            description file: /bitcore/packages/bitcore-lib/package.json (relative path: ./lib/transaction) resolve as
            module looking for modules in /bitcore/packages/insight-previous/node_modules using description file:
            /bitcore/packages/insight-previous/package.json (relative path: ./node_modules) Field 'browser' doesn't
            contain a valid alias configuration after using description file:
            /bitcore/packages/insight-previous/package.json (relative path: ./node_modules) using description file:
            /bitcore/packages/insight-previous/package.json (relative path: ./node_modules/buffer-compare) no extension
            Field 'browser' doesn't contain a valid alias configuration
            /bitcore/packages/insight-previous/node_modules/buffer-compare doesn't exist .ts Field 'browser' doesn't
            contain a valid alias configuration /bitcore/packages/insight-previous/node_modules/buffer-compare.ts
            doesn't exist .js Field 'browser' doesn't contain a valid alias configuration
            /bitcore/packages/insight-previous/node_modules/buffer-compare.js doesn't exist .json Field 'browser'
            doesn't contain a valid alias configuration
            /bitcore/packages/insight-previous/node_modules/buffer-compare.json doesn't exist as directory
            /bitcore/packages/insight-previous/node_modules/buffer-compare doesn't exist
            [/bitcore/packages/insight-previous/node_modules/buffer-compare]
            [/bitcore/packages/insight-previous/node_modules/buffer-compare.ts]
            [/bitcore/packages/insight-previous/node_modules/buffer-compare.js]
            [/bitcore/packages/insight-previous/node_modules/buffer-compare.json]
            [/bitcore/packages/insight-previous/node_modules/buffer-compare] @
            ../bitcore-lib/lib/transaction/transaction.js 6:32-57 @ ../bitcore-lib/lib/transaction/sighash.js @
            ../bitcore-lib/index.js @ ./src/pages/messages/messages.ts @ ./src/pages/messages/messages.module.ts @
            ./src/app/app.module.ngfactory.js @ ./src/app/main.ts
Error: ../bitcore-lib-btx/lib/transaction/transaction.js
Module not found: Error: Can't resolve 'buffer-compare' in '/bitcore/packages/bitcore-lib-btx/lib/transaction'
resolve 'buffer-compare' in '/bitcore/packages/bitcore-lib-btx/lib/transaction'
  Parsed request is a module
  using description file: /bitcore/packages/bitcore-lib-btx/package.json (relative path: ./lib/transaction)
  after using description file: /bitcore/packages/bitcore-lib-btx/package.json (relative path: ./lib/transaction)
    resolve as module
      looking for modules in /bitcore/packages/insight-previous/node_modules
        using description file: /bitcore/packages/insight-previous/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
        after using description file: /bitcore/packages/insight-previous/package.json (relative path: ./node_modules)
          using description file: /bitcore/packages/insight-previous/package.json (relative path: ./node_modules/buffer-compare)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /bitcore/packages/insight-previous/node_modules/buffer-compare doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              /bitcore/packages/insight-previous/node_modules/buffer-compare.ts doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /bitcore/packages/insight-previous/node_modules/buffer-compare.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /bitcore/packages/insight-previous/node_modules/buffer-compare.json doesn't exist
            as directory
              /bitcore/packages/insight-previous/node_modules/buffer-compare doesn't exist
[/bitcore/packages/insight-previous/node_modules/buffer-compare]
[/bitcore/packages/insight-previous/node_modules/buffer-compare.ts]
[/bitcore/packages/insight-previous/node_modules/buffer-compare.js]
[/bitcore/packages/insight-previous/node_modules/buffer-compare.json]
[/bitcore/packages/insight-previous/node_modules/buffer-compare]
 @ ../bitcore-lib-btx/lib/transaction/transaction.js 6:32-57
 @ ../bitcore-lib-btx/lib/transaction/sighash.js
 @ ../bitcore-lib-btx/index.js
 @ ./src/pages/messages/messages.ts
 @ ./src/pages/messages/messages.module.ts
 @ ./src/app/app.module.ngfactory.js
 @ ./src/app/main.ts,../bitcore-lib-cash/lib/transaction/transaction.js
Module not found: Error: Can't resolve 'buffer-compare' in '/bitcore/packages/bitcore-lib-cash/lib/transaction'
resolve 'buffer-compare' in '/bitcore/packages/bitcore-lib-cash/lib/transaction'
  Parsed request is a module
  using description file: /bitcore/packages/bitcore-lib-cash/package.json (relative path: ./lib/transaction)
  after using description file: /bitcore/packages/bitcore-lib-cash/package.json (relative path: ./lib/transaction)
    resolve as module
      looking for modules in /bitcore/packages/insight-previous/node_modules
        using description file: /bitcore/packages/insight-previous/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
        after using description file: /bitcore/packages/insight-previous/package.json (relative path: ./node_modules)
          using description file: /bitcore/packages/insight-previous/package.json (relative path: ./node_modules/buffer-compare)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /bitcore/packages/insight-previous/node_modules/buffer-compare doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              /bitcore/packages/insight-previous/node_modules/buffer-compare.ts doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /bitcore/packages/insight-previous/node_modules/buffer-compare.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /bitcore/packages/insight-previous/node_modules/buffer-compare.json doesn't exist
            as directory
              /bitcore/packages/insight-previous/node_modules/buffer-compare doesn't exist
[/bitcore/packages/insight-previous/node_modules/buffer-compare]
[/bitcore/packages/insight-previous/node_modules/buffer-compare.ts]
[/bitcore/packages/insight-previous/node_modules/buffer-compare.js]
[/bitcore/packages/insight-previous/node_modules/buffer-compare.json]
[/bitcore/packages/insight-previous/node_modules/buffer-compare]
 @ ../bitcore-lib-cash/lib/transaction/transaction.js 6:32-57
 @ ../bitcore-lib-cash/lib/transaction/sighash.js
 @ ../bitcore-lib-cash/index.js
 @ ./src/pages/messages/messages.ts
 @ ./src/pages/messages/messages.module.ts
 @ ./src/app/app.module.ngfactory.js
 @ ./src/app/main.ts,../bitcore-lib/lib/transaction/transaction.js
Module not found: Error: Can't resolve 'buffer-compare' in '/bitcore/packages/bitcore-lib/lib/transaction'
resolve 'buffer-compare' in '/bitcore/packages/bitcore-lib/lib/transaction'
  Parsed request is a module
  using description file: /bitcore/packages/bitcore-lib/package.json (relative path: ./lib/transaction)
  after using description file: /bitcore/packages/bitcore-lib/package.json (relative path: ./lib/transaction)
    resolve as module
      looking for modules in /bitcore/packages/insight-previous/node_modules
        using description file: /bitcore/packages/insight-previous/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
        after using description file: /bitcore/packages/insight-previous/package.json (relative path: ./node_modules)
          using description file: /bitcore/packages/insight-previous/package.json (relative path: ./node_modules/buffer-compare)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /bitcore/packages/insight-previous/node_modules/buffer-compare doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              /bitcore/packages/insight-previous/node_modules/buffer-compare.ts doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /bitcore/packages/insight-previous/node_modules/buffer-compare.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /bitcore/packages/insight-previous/node_modules/buffer-compare.json doesn't exist
            as directory
              /bitcore/packages/insight-previous/node_modules/buffer-compare doesn't exist
[/bitcore/packages/insight-previous/node_modules/buffer-compare]
[/bitcore/packages/insight-previous/node_modules/buffer-compare.ts]
[/bitcore/packages/insight-previous/node_modules/buffer-compare.js]
[/bitcore/packages/insight-previous/node_modules/buffer-compare.json]
[/bitcore/packages/insight-previous/node_modules/buffer-compare]
 @ ../bitcore-lib/lib/transaction/transaction.js 6:32-57
 @ ../bitcore-lib/lib/transaction/sighash.js
 @ ../bitcore-lib/index.js
 @ ./src/pages/messages/messages.ts
 @ ./src/pages/messages/messages.module.ts
 @ ./src/app/app.module.ngfactory.js
 @ ./src/app/main.ts
    at new BuildError (/bitcore/packages/insight-previous/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
    at callback (/bitcore/packages/insight-previous/node_modules/@ionic/app-scripts/dist/webpack.js:121:28)
    at emitRecords.err (/bitcore/packages/insight-previous/node_modules/webpack/lib/Compiler.js:265:13)
    at Compiler.emitRecords (/bitcore/packages/insight-previous/node_modules/webpack/lib/Compiler.js:371:38)
    at emitAssets.err (/bitcore/packages/insight-previous/node_modules/webpack/lib/Compiler.js:258:10)
    at applyPluginsAsyncSeries1.err (/bitcore/packages/insight-previous/node_modules/webpack/lib/Compiler.js:364:12)
    at next (/bitcore/packages/insight-previous/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/bitcore/packages/insight-previous/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/bitcore/packages/insight-previous/node_modules/tapable/lib/Tapable.js:22

packages/insight-previous/package.json

{
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build:prod": "ENV=prod CHAIN=BTX NETWORK=mainnet API_PREFIX=https://api.bitcore.cc/api npm run ionic:build --prod",
    "serve:prod": "npm run clean && npm run build:prod && npm run serve",
    "serve": "serve www"
}

@micahriggan
Copy link
Contributor

This is an issue where webpack isn't resolving the symlinks when building. It's really annoying. Are you able to install bitcore-lib-btx from npm? If so, I think by running an npm install in that directory, or doing an npm install bitcore-lib-btx

Using lerna and webpack apparently doesn't work very well.

@dalijolijo
Copy link
Author

It is necessary to install all libs (bitcore-lib-btx, bitcore-lib, bitcore-lib-cash) in directory packages/insight-previous , so that no more errors occur.

> @bitpay/insight-previous@8.3.0 start /bitcore/packages/insight-previous
> npm run serve:prod


> @bitpay/insight-previous@8.3.0 serve:prod /bitcore/packages/insight-previous
> npm run clean && npm run build:prod && npm run serve


> @bitpay/insight-previous@8.3.0 clean /bitcore/packages/insight-previous
> ionic-app-scripts clean

[18:51:01]  ionic-app-scripts 3.2.3
[18:51:01]  clean started ...
[18:51:01]  clean finished in 1 ms

> @bitpay/insight-previous@8.3.0 build:prod /bitcore/packages/insight-previous
> ENV=prod CHAIN=BTX NETWORK=mainnet API_PREFIX=https://api.bitcore.cc/api npm run ionic:build --prod


> @bitpay/insight-previous@8.3.0 ionic:build /bitcore/packages/insight-previous
> ionic-app-scripts build

[18:51:03]  ionic-app-scripts 3.2.3
[18:51:03]  build prod started ...
[18:51:03]  clean started ...
[18:51:03]  clean finished in 1 ms
[18:51:03]  copy started ...
[18:51:03]  deeplinks started ...
[18:51:03]  deeplinks finished in 159 ms
[18:51:03]  ngc started ...
[18:51:16]  ngc finished in 13.15 s
[18:51:16]  preprocess started ...
[18:51:16]  preprocess finished in less than 1 ms
[18:51:16]  webpack started ...
[18:51:16]  copy finished in 13.62 s
[18:51:49]  webpack finished in 32.83 s
[18:51:49]  uglify started ...
[18:51:49]  sass started ...
[18:51:50]  sass finished in 682 ms
[18:51:50]  cleancss started ...
[18:51:51]  cleancss finished in 990 ms
[18:52:33]  uglify finished in 43.85 s
[18:52:33]  postprocess started ...
[18:52:33]  postprocess finished in 13 ms
[18:52:33]  lint started ...
[18:52:33]  build prod finished in 90.16 s
[18:52:39]  lint finished in 6.28 s

> @bitpay/insight-previous@8.3.0 serve /bitcore/packages/insight-previous
> serve www

UPDATE AVAILABLE The latest version of `serve` is 11.0.0
INFO: Accepting connections at http://localhost:5000

@micahriggan
Copy link
Contributor

Awesome, glad you got it built. Did that fix your websocket issue?

@dalijolijo
Copy link
Author

The websocket issue is resolved. Thank you.

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

No branches or pull requests

2 participants