Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

System Error when running Ganache 2.0.0 on darwin #1231

Closed
vermi opened this issue Apr 9, 2019 · 8 comments
Closed

System Error when running Ganache 2.0.0 on darwin #1231

vermi opened this issue Apr 9, 2019 · 8 comments

Comments

@vermi
Copy link

vermi commented Apr 9, 2019

Attempting to establish a websocket connection from python-web3 using WebsocketProvider, receive the following error:

PLATFORM: darwin
GANACHE VERSION: 2.0.0

EXCEPTION:

TypeError: connection.reject is not a function
    at WebSocketConnection.<anonymous> (/node_modules/ganache-core/lib/webSocketServer.js:49:18)
    at emitOne (events.js:115:13)
    at WebSocketConnection.emit (events.js:210:7)
    at WebSocketConnection.processFrame (/node_modules/ganache-core/node_modules/websocket/lib/WebSocketConnection.js:529:26)
    at /node_modules/ganache-core/node_modules/websocket/lib/WebSocketConnection.js:321:40
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

APPLICATION LOG:

T+0ms: Starting server (version 2.0.0) with initial configuration: {"gasLimit":6721975,"gasPrice":20000000000,"hardfork":"petersburg","hostname":"127.0.0.1","port":8545,"network_id":5777,"default_balance_ether":100,"total_accounts":10,"unlocked_accounts":[],"locked":false,"vmErrorsOnRPCResponse":true,"verbose":false}
T+48ms: Ganache started successfully!
T+48ms: Waiting for requests...
T+54ms: eth_subscribe
T+55ms: eth_getLogs
T+55ms: eth_subscribe
T+2904ms: eth_blockNumber
T+7369ms: eth_blockNumber
T+8375ms: eth_blockNumber
T+9382ms: eth_blockNumber
T+10309ms: eth_unsubscribe
T+10310ms: eth_unsubscribe
T+10311ms: eth_unsubscribe
T+10312ms: eth_unsubscribe
T+10312ms: eth_unsubscribe
@davidmurdoch
Copy link
Member

Thanks for opening the issue, @TheRealPOTUS. We don't currently support binary data over websockets. Is it possible for you to transmit via utf8 instead?

@vermi
Copy link
Author

vermi commented Apr 9, 2019

I'm not super knowledgeable about python websockets, but there doesn't appear to be a kwarg that can change the encoding from binary to utf-8.

I attempted to switch to HTTPProvider instead of WebsocketProvider, but ganache throws a 403 on those requests.

@davidmurdoch
Copy link
Member

Can you share the exact output for the 403 error response here?

@vermi
Copy link
Author

vermi commented Apr 9, 2019

self.web3.eth.defaultAccount = web3.eth.coinbase returns the following error:
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: http://127.0.0.1:8545/

@davidmurdoch
Copy link
Member

Hmm. I didn't think Ganache itself ever returns a 403 status code. Are there any logs showing in Ganache's Logs tab when you receive this error?

@vermi
Copy link
Author

vermi commented Apr 9, 2019

No, no logs showing there when this error pops.

@davidmurdoch
Copy link
Member

Hm. I'm not sure what is sending that 403 response.

I've opened a PR to add binary websockets here to our core library: trufflesuite/ganache#410

Assuming our CI passes and code review goes well, it'll likely be another week (or two) until this is released in the next beta of Ganache UI.

@vermi
Copy link
Author

vermi commented Apr 9, 2019

Awesome, thanks for that info -- I'll keep an eye on the PR and test it out as soon as it's released. Much prefer ganache to geth for testing on Mac.

davidmurdoch referenced this issue in trufflesuite/ganache Apr 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants