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

Unhandled rejection Error: not opened #1853

Closed
Jolly-Pirate opened this issue Oct 26, 2017 · 26 comments
Closed

Unhandled rejection Error: not opened #1853

Jolly-Pirate opened this issue Oct 26, 2017 · 26 comments

Comments

@Jolly-Pirate
Copy link
Contributor

Jolly-Pirate commented Oct 26, 2017

I'm running a local instance of condenser. I keep getting those errors after browsing a few pages then letting the browser idle for a minute or two, then pressing F5. The page hangs for a while, and I end up with a 502 or 504 Bad Gateway. I tried with apache and nginx as reverse proxies, but the problem happens on both. Also, the issue is reproducible on Ubuntu 16.04 and Fedora 26. I setup MySQL, but not tarantool.
P.S. Tested on several RPC's, same problem.
Also, tested straight on condenser at port 8080 without any reverse proxy, the websocket error occurs again. Also happens with steemit/condenser docker image.

Unhandled rejection Error: not opened
    at WebSocket.send (/home/server/condenser/node_modules/steem/node_modules/ws/lib/WebSocket.js:355:18)
    at /home/server/condenser/node_modules/steem/lib/api/transports/ws.js:135:19
    at tryCatcher (/home/server/condenser/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/server/condenser/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/home/server/condenser/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromiseCtx (/home/server/condenser/node_modules/bluebird/js/release/promise.js:606:10)
    at Async._drainQueue (/home/server/condenser/node_modules/bluebird/js/release/async.js:138:12)
    at Async._drainQueues (/home/server/condenser/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/home/server/condenser/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:651:20)
    at tryOnImmediate (timers.js:624:5)
    at processImmediate [as _immediateCallback] (timers.js:596:5)

Looking a nginx's error log I find errors like this:

2017/10/25 20:01:35 [error] 28116#28116: *9 upstream prematurely closed connection while reading response header from upstream, client: ***.***.***.***, server: myserver.com, request: "GET /created/steemit HTTP/2.0", upstream: "http://127.0.0.1:8080/created/steemit", host: "myserver.com"
@skenan
Copy link

skenan commented Oct 26, 2017

Same error when I am running my https://cnsteem.com

I have setuped MySQL and tarantool.

@Jolly-Pirate
Copy link
Contributor Author

Jolly-Pirate commented Oct 26, 2017

I have a feeling it's because of jussi's optimizations, it broke the regular apache/nginx reverse proxy. I could be wrong though.

@skenan
Copy link

skenan commented Oct 26, 2017

@Jolly-Pirate I didn't use jussi, you use that locally?

@Jolly-Pirate
Copy link
Contributor Author

I don't use jussi, it's a simple condenser+mysql+nginx/apache setup.

@KINGdotNET
Copy link

@drakos use "wss://steemd.steemit.com" for your RPC node connection.
It should correct those websocket errors.

@KINGdotNET
Copy link

What I want to see added is to provide list of RPC nodes. If the first one is not working or slow to respond, the 2nd node will take over automatically if possible.

@Jolly-Pirate
Copy link
Contributor Author

Jolly-Pirate commented Oct 26, 2017

The idea is to use a different RPC node, given the unstability and slowness of wss://steemd.steemit.com. Upvoting, posting, etc. are all problematic on that node.

P.S. I tested on that node and other RPC nodes, the issue happens again. So it's not an RPC problem, but condenser.

@KINGdotNET
Copy link

I agree.

@KINGdotNET
Copy link

KINGdotNET commented Oct 26, 2017

Now I can see this error when I successful logged in and will continue to appear even you logout.
I restart the service, this error will go away and will re-appear when I login again.

The sign up is broken too.
All this error on a second server.

My first server runs without any bug, but this is using the previous version of condenser.
See it here https://yehey.org

@skenan
Copy link

skenan commented Oct 26, 2017

@KINGdotNET This error only happened in lastest condenser.

@Jolly-Pirate
Copy link
Contributor Author

No, the error has been happening since 3-4 days since I started setting it up, so before and after the new UI.

@KINGdotNET
Copy link

@skenan correction. It is my mistake, got it working. I actually disabled it, stupid me :)
I have it running now, testing the load balancer for https://yehey,org website.

@skenan
Copy link

skenan commented Oct 26, 2017

@KINGdotNET you still use the old version, how about trying new one?

@KINGdotNET
Copy link

@skenan I am working on the 2nd server using the new version of condenser. It seems not stable.
I can browse the site, no issue but every time I connect to sign-up and go back clicking other articles the websockets errors appear. The server will crash eventually.

@skenan
Copy link

skenan commented Oct 27, 2017

With this error, it's very hard to debug locally.. I feel painful and couldn't contribute to the code.
@sneak @valzav could you guys please take a look at it? Or give us some advice.

@bnchdrff
Copy link
Contributor

this is a known issue caused by the steem js lib. to work around this bug:

cd node_modules
rm -r steem
git clone git@github.com:steemit/steem-js steem
cd steem
git checkout ec4439c1319e21ccb4b52a3de3798a37b84b0001
yarn

@KINGdotNET
Copy link

Some of the errors using the new condenser. This will shows right away, when I clicked the new links on the right column e.g. welcome, faq, pick_account, etc. I hope that help.

<-- GET /pick_account 71e2ed19f7108a971c2734008c
Unhandled rejection Error: not opened
at WebSocket.send (/home/kingdotnet/condenser/node_modules/steem/node_modules/ws/lib/WebSocket.js:355:18)
at /home/kingdotnet/condenser/node_modules/steem/lib/api/transports/ws.js:135:19
at tryCatcher (/home/kingdotnet/condenser/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/kingdotnet/condenser/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/home/kingdotnet/condenser/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromiseCtx (/home/kingdotnet/condenser/node_modules/bluebird/js/release/promise.js:606:10)
at Async._drainQueue (/home/kingdotnet/condenser/node_modules/bluebird/js/release/async.js:138:12)
at Async._drainQueues (/home/kingdotnet/condenser/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/home/kingdotnet/condenser/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:651:20)
at tryOnImmediate (timers.js:624:5)
at processImmediate [as _immediateCallback] (timers.js:596:5)
<-- GET /faq.html 71e2ed19f7108a971c2734008c
Unhandled rejection Error: not opened
at WebSocket.send (/home/kingdotnet/condenser/node_modules/steem/node_modules/ws/lib/WebSocket.js:355:18)
at /home/kingdotnet/condenser/node_modules/steem/lib/api/transports/ws.js:135:19
at tryCatcher (/home/kingdotnet/condenser/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/kingdotnet/condenser/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/home/kingdotnet/condenser/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromiseCtx (/home/kingdotnet/condenser/node_modules/bluebird/js/release/promise.js:606:10)
at Async._drainQueue (/home/kingdotnet/condenser/node_modules/bluebird/js/release/async.js:138:12)
at Async._drainQueues (/home/kingdotnet/condenser/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/home/kingdotnet/condenser/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:651:20)
at tryOnImmediate (timers.js:624:5)
at processImmediate [as _immediateCallback] (timers.js:596:5)
<-- GET /welcome 71e2ed19f7108a971c2734008c
Unhandled rejection Error: not opened
at WebSocket.send (/home/kingdotnet/condenser/node_modules/steem/node_modules/ws/lib/WebSocket.js:355:18)
at /home/kingdotnet/condenser/node_modules/steem/lib/api/transports/ws.js:135:19
at tryCatcher (/home/kingdotnet/condenser/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/kingdotnet/condenser/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/home/kingdotnet/condenser/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromiseCtx (/home/kingdotnet/condenser/node_modules/bluebird/js/release/promise.js:606:10)
at Async._drainQueue (/home/kingdotnet/condenser/node_modules/bluebird/js/release/async.js:138:12)
at Async._drainQueues (/home/kingdotnet/condenser/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/home/kingdotnet/condenser/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:651:20)
at tryOnImmediate (timers.js:624:5)
at processImmediate [as _immediateCallback] (timers.js:596:5)

@KINGdotNET
Copy link

@bnchdrff I'm trying to download, permission error.
git clone git@github.com:steemit/steem-js steem

Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

@bnchdrff
Copy link
Contributor

you can use https instead of ssh if you don't have your keys set up; change git@github.com:steemit/steem-js to https://github.com/steemit/steem-js

@skenan
Copy link

skenan commented Oct 27, 2017

@bnchdrff why we couldn't fix this bug at steem-js?

@KINGdotNET
Copy link

@bnchdrff well done! All errors are fixed.
I will continue to test it and share my results here. This will be a 2nd server to be in Europe for my load balancer using the new version of condenser via https://Yehey.org.

Thank you sir.

@skenan
Copy link

skenan commented Oct 27, 2017

@bnchdrff Can another way to change the package.json from
"steem": "github:steemit/steem-js#72a36c835a74f446da47e36feea5d5f1f4dde55b",
to
"steem": "github:steemit/steem-js#ec4439c1319e21ccb4b52a3de3798a37b84b0001"?

@Jolly-Pirate
Copy link
Contributor Author

Thanks for the solution @bnchdrff but it's not working for me. When I run yarn from the new steem dir, I get this error during compilation:

> steem@0.6.4 build-browser /home/gosteem/condenser/node_modules/steem
> rm -rf dist && NODE_ENV=production node ./node_modules/webpack/bin/webpack.js && gzip -k -f ./dist/*.js && du -h ./dist/*

module.js:472
    throw err;
    ^

Error: Cannot find module '/home/gosteem/condenser/node_modules/steem/node_modules/webpack/bin/webpack.js'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:418:7)
    at startup (bootstrap_node.js:139:9)
    at bootstrap_node.js:533:3

npm ERR! Linux 4.4.0-87-generic
npm ERR! argv "/home/gosteem/.nvm/versions/node/v7.5.0/bin/node" "/home/gosteem/.nvm/versions/node/v7.5.0/bin/npm" "run" "build-browser"
npm ERR! node v7.5.0
npm ERR! npm  v4.1.2
npm ERR! code ELIFECYCLE
etc........

The webpack.js file is present in condenser/node_modules/webpack/bin/webpack.js and not in condenser/node_modules/steem/node_modules/webpack/bin/webpack.js

@valzav
Copy link
Contributor

valzav commented Oct 27, 2017

Probably we need to use global webpack instead of ./node_modules/webpack/bin/webpack.js . Any opinions on this?

@skenan
Copy link

skenan commented Oct 27, 2017

@Jolly-Pirate Did you try change the steem version in package.json, that works for me.

@Jolly-Pirate
Copy link
Contributor Author

Jolly-Pirate commented Oct 27, 2017

@bnchdrff thanks a bunch for your solution, it saved the day(s).
@skenan editing the package.json worked flawlessly.

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

5 participants